Herbie Photovore question

Thread Starter

khayman218

Joined Jan 9, 2008
9
I was building this circuit and couldn't find the answers to a question that I had. Maybe someone here would be able to help.

I used CdS photoresistors instead of the LED detectors they have and I don't have the reverse behavior (touch switch and relay removed). After building it, I have found that only one motor reacts to changes in the photoresistors. The inputs to the LM386 change appropriately when the photoresistors are un/covered; however, the ouput only changes for one of them.

It's possible that I do not understand the op amp enough to know what should be happening. But, from what I have read, the op amp should increase/decrease the current on the output based on the difference from the inputs. So, I originally thought that only one motor would be steered by the op amp because the other motor is getting all its power straight from the batteries. But then I did not understand why two photo detectors were needed.

Maybe if someone could take a shot at explaining how the op amp is splitting the power between the motors it would clear up what I am doing wrong.

Thanks!
 

beenthere

Joined Apr 20, 2004
15,819
At a guess, the CdS cells have a different enough response from the LED's that the steering circuit won't work without some further changes. I would source each cell through a separate resistor, and put a trim pot configured as a variable resistor in series with one resistor as a balance control. I would set up the resistor/CdS cells as voltage dividers, and attach each LM386 input to each resistor/CdS cell connection.

Do you know the resistance of the CdS cells under illumination?
 

Thread Starter

khayman218

Joined Jan 9, 2008
9
Do you know the resistance of the CdS cells under illumination?
Room lighting: 2.5k-3.1k
Covered by hand: 15k-16k

At a guess, the CdS cells have a different enough response from the LED's that the steering circuit won't work without some further changes. I would source each cell through a separate resistor, and put a trim pot configured as a variable resistor in series with one resistor as a balance control. I would set up the resistor/CdS cells as voltage dividers, and attach each LM386 input to each resistor/CdS cell connection.
I have added your suggestions; however, the behavior seems unchanged. When running each input goes from ~300mV (uncovered) to 1.4V (covered). When covering the "working" CdS cell, the output of the op amp goes from .6V to 4.3V. Covering the non-"working" CdS cell does not impact the output, even though I can measure the input changing as I described before. I substituted a LM324 op amp in place of the LM386 and the behavior seemed identical.

I assume there must be some kind of wiring problem, but I cannot see what it could be.

The power supply is 4 1.5V AAs.

Here is a picture of the circuit:

Thanks for the help!

EDIT: I realized that I did not at the trimpot as you suggested. However, the resistances on the cells were very similar (both within the ranges I mentioned above) - do you think it is still necessary?
 

hgmjr

Joined Jan 28, 2005
9,027
From your picture, the wires to your motor do not appear to be soldered. Is it possible that you have a poor connection to the motor that isn't operating?

hgmjr
 

hgmjr

Joined Jan 28, 2005
9,027
Since you are using the LM386 as a comparator, how about taking your two 4.7K resistors and connect them up to form a voltage divider that that gives you a reference voltage that is half your supply. Use this reference voltage to feed either the plus or minus input to the LM386.

Then do the same thing with your photocells so that they form a voltage divider from the positive voltage to ground. Connect the junction of the two photocells to the other input to the LM386.

That way when you cover one photocell the voltage will be greater than the reference created by the two 4.7K resistors and when the cover the other cell the voltage will be less that the reference created by the two 4.7K resistors. You should not need to put any resistors in series with the photocells.

hgmjr
 

Thread Starter

khayman218

Joined Jan 9, 2008
9
From your picture, the wires to your motor do not appear to be soldered. Is it possible that you have a poor connection to the motor that isn't operating?

hgmjr
At one point, I did see some sparking on one of the connections. But they are in there pretty solidly now.

Also, both motors do spin when I turn on the power. The only problem is that the bottom motor (in the picture) is the only one that responds to the lower cell being covered. When I cover the upper cell, neither motor changes speed. When I cover the lower cell, the top motor slows and the bottom motor speeds up.

It seems strange that the input voltages to the op amp both change, but the output only changes in response to one of them. Shouldn't the op amp output change if either of the inputs changes?
 

beenthere

Joined Apr 20, 2004
15,819
What happens if you switch the LM386 input connections? Do the motors continue to operate as in your last post, or does the other motor start to change speed? Have you got a voltmeter to measure the 386's output?

It's worth mentioning that 9 volt batteries are pretty weenie for running 2 motors.
 

Thread Starter

khayman218

Joined Jan 9, 2008
9
Since you are using the LM386 as a comparator, how about taking your two 4.7K resistors and connect them up to form a voltage divider that that gives you a reference voltage that is half your supply. Use this reference voltage to feed either the plus or minus input to the LM386.

Then do the same thing with your photocells so that they form a voltage divider from the positive voltage to ground. Connect the junction of the two photocells to the other input to the LM386.

That way when you cover one photocell the voltage will be greater than the reference created by the two 4.7K resistors and when the cover the other cell the voltage will be less that the reference created by the two 4.7K resistors. You should not need to put any resistors in series with the photocells.

hgmjr
I will give that a shot, but I do have a question about it. I thought the CdS cells and resistors were already forming voltage dividers (two separate parallel ones). Then the inputs into the LM386 are the divided voltages from each. So when input 1 is covered, its voltage is higher than input 2 - and vice versa.

But your solution would have the reference voltage not changing where, in the current circuit I have, both inputs change. Is that important for the op amp? I am still a bit new to them, and am not 100% clear on how they work.

Thanks again for all the help! This is still fun when the circuits require some troubleshooting (as long as I don't melt any motors or shock myself ;)).
 

Thread Starter

khayman218

Joined Jan 9, 2008
9
What happens if you switch the LM386 input connections? Do the motors continue to operate as in your last post, or does the other motor start to change speed?
Switching the inputs switched the motor behavior: the opposite motor would slow down when the bottom CdS cell was covered. When both CdSes are uncovered, one motor runs much faster than the other. That also switched when the inputs were switched.

So maybe the problem is as hgmjr suggested (the reference voltage and the comparison voltage change)?


It's worth mentioning that 9 volt batteries are pretty weenie for running 2 motors.
They scream along pretty ferociously with no load. I guess they wouldn't move at all under load though?

Have you got a voltmeter to measure the 386's output?
386 output
Both Uncovered: ~2.8V
Lower CdS Only Covered: ~0.8V
Upper CdS Only Covered: ~2.8V (no change from both uncovered)
 

hgmjr

Joined Jan 28, 2005
9,027
I will give that a shot, but I do have a question about it. I thought the CdS cells and resistors were already forming voltage dividers (two separate parallel ones). Then the inputs into the LM386 are the divided voltages from each. So when input 1 is covered, its voltage is higher than input 2 - and vice versa.
It is true that the technique you were using did involve two voltage dividers.
But your solution would have the reference voltage not changing where, in the current circuit I have, both inputs change. Is that important for the op amp? I am still a bit new to them, and am not 100% clear on how they work.
This approach is just a twist on what you were doing. By holding one input at a constant voltage, it should be pretty obvious by using a voltmeter that the voltage at the junction of the photocells is greater than or less than the reference voltage.
Thanks again for all the help! This is still fun when the circuits require some troubleshooting (as long as I don't melt any motors or shock myself ;)).
Don't tell anybody but this is fun for us too:).

hgmjr
 

linkz601

Joined Jun 10, 2009
3
try using the relay because without it,the motors don't get the signal coming in from the cds photoresistors.the touch switch should also be used because that way you dont have to keep flicking the regular switch back and forth again and again. In other words without the relay, the motors would not stop, instead they keep going.
 
Top