Need help with operation

Thread Starter

crash563

Joined Feb 25, 2013
47
Can anyone help with the operation of this circuit in the PDF file. RX and Ry are photocells. The main idea is that when RX and Ry see the same amount of light, the comparator should give a low signal.
 

Attachments

#12

Joined Nov 30, 2010
18,224
As long as Rx and Ry are zero, you will get nothing useful.

The LM339 is an open collector device. It's output is, "no current" until the negative input pin is at a higher voltage than the positive input pin. Then, the output transistor becomes, "on" and the voltage at the output pin becomes close to zero as the chip dumps the current provided by R4.

Apparently the "photocells" are variable resistance devices. You are supposed to adjust VR1 until you get the right response.
 
Last edited:

WBahn

Joined Mar 31, 2012
30,058
Can anyone help with the operation of this circuit in the PDF file. RX and Ry are photocells. The main idea is that when RX and Ry see the same amount of light, the comparator should give a low signal.
This circuit will not do what you want. This circuit is a hysteretic comparator that will have two transition points. A HI->LO and a LO->HI. When the output of the comparator is LO, the voltage on the non-inverting input will be at the LO->HI transition threshold. Since it is an inverting comparator, all we know about the input voltage (the voltage at the invering input) is that it is somewhere higher than this voltage. Once the input voltage drops below this threshold, then the comparator changes state and goes HI and the voltage at the non-invering input changes to a higher threshold, which is the HI->LO threshold. So, to switch states again, the input voltage must rise not only above the threshold that caused the last switch, but a higher threshold. The same is true in reverse once it does cross that higher threshold -- the threshold changes back to the lower LO->HI threshold.

Between these two thresholds, the output could be either HI or LO, so you don't know.

If you are truly wanting to know when the two are seeing equal light (within some tolerance), then you need a window comparator.
 

Thread Starter

crash563

Joined Feb 25, 2013
47
I understand that to calculate these thresholds are also diffacult i beleive due to the change in inputs if i can be given a general set of equations that can be used to calculate the thresholds and input values it can also really help me.
 

#12

Joined Nov 30, 2010
18,224
For Vin ~4.5V and Vout is either 0 or 9 V
Ifeedback is 4.5/1010000= 44.55ua.

impedance at the positive input is 10300 ohms.
for V=IR, the change in input voltage caused by the feedback current is 44.55ua x 10300 = .046 volts

It's all Ohm's Law.

correction: that math was for half a flop. When the circuit flops from 0 to 9 or 9 to 0, the difference in the threshold voltage will be twice as much....092 volts
 
Last edited:

WBahn

Joined Mar 31, 2012
30,058
I understand that to calculate these thresholds are also diffacult i beleive due to the change in inputs if i can be given a general set of equations that can be used to calculate the thresholds and input values it can also really help me.
But what's the point?

The circuit you show will not do what you say you want it to do, which is to give you a LO output when the light seen by the two sensors is equal. So why go down a rabbit hole only to discover, at the end of the day, that you have a circuit that doesn't do what you want?

Are you even clear on what you want?

If sensor A is seeing considerably less light than sensor B, what do you want the output to be?

If sensor A is seing about the same amount of light as sensor B, what do you want the output to be?

If sensor A is seeing considerably more light than sensor B, what do you want the output to be?
 

Thread Starter

crash563

Joined Feb 25, 2013
47
sensor A seeing less light the output is low.
if seeing the the same amount of light the ouput is low
sensor A seeing more light the output is high
 

#12

Joined Nov 30, 2010
18,224
Assuming you are using something like Cadmium Sulphide photocells that decrease resistance when light hits them, Rx (sensor1) (sensor A) is on the negative input and supplies current. When light hits Rx, it will decrease resistance and the voltage on the negative input will increase. When that voltage becomes more than the voltage on the positive input, the comparator will switch its internal transistor on and the voltage at its output will be close to zero. More light creates low output. This is backwards from what you asked for in post #12. One solution is to reverse the sensors with their resistors so that the resistors are connected to 9 volts on one end and the sensors are connected to ground on one end.

As for what happens when the inputs are equal, this is a positive feedback circuit so the answer depends on the previous state of the comparator. The output will remain the same as it used to be (a few minutes ago) until the input voltage passes the voltage on the other input by .092 volts.
 

WBahn

Joined Mar 31, 2012
30,058
sensor A seeing less light the output is low.
if seeing the the same amount of light the ouput is low
sensor A seeing more light the output is high
Okay, this definitely helps and it is very, very different than what you stated in your original post:

The main idea is that when RX and Ry see the same amount of light, the comparator should give a low signal.
That strongly implies that you want the comparator output to be low when they see the same amount of light and to be high otherwise, regardless of which one is seeing more light. This is further strengthened by the fact that you don't distinguish between Rx and Ry.

Do you see the value and importance of clearly stating what you want the circuit to do?

So, further to that end, you've now said that:

The output should be LO when Sensor A is seeing the same or less light than Sensor B.

You've also now indicated that Sensor 1 is Rx and Sensor 2 is Ry. Okay, now, which is Sensor A and which is Sensor B? I'm assuming that Sensor 1 and Sensor A are the same thing?

The next thing is that while you've said that rx and ry are nominally 600Ω under controlled lighting, you haven't indicated whether this goes up or down as the amount of light increases. I imagine it goes down, but don't leave information like that out. We are NOT mind readers!

Based on the revised specifications, you do not need a window comparator, but it is still unclear whether you need or want a hysteretic comparator. Do you want the switching point between LO to HI and HI to LO to occur as the amount of light seen by each sensor is the same?
 
Top