Understanding this photoresistor circuit

First thing to understand is that voltage doesn't flow. Voltage is more alike hydraulic pressure, and resistors are like constrictions in pipes. Wires are like pipes the let water easily flow [big inner diameter], and resistors are like constrictions in the pipe, and resists the flow [smaller inner diameter]. A battery ( or power source) is like a big tank of water.

The higher the resistance value [e.g. the more ohms], the smaller inner diameter, and thus, the more constriction of the flow. If two resistors are in series, like your PhotoCell and 10k resistor, the current [i.e. the "water"] flows from the 5 volt supply [i.e. water "pressure" from the bottom of the tank], through the wire ["fatter pipe"], into the PhotoCell [a pipe who's inner diameter is dependant on the amount of light striking the face of the PhotoCell], then into the next wire [another fat pipe], then into the 10k resistor [a more narrow pipe, with a fixed inner diameter], then into the wire that runs back to the negative side of the power source [or a pipe lying on the ground with a big opening in it -- i.e. so the water can drain away -- not a perfect analogy, but suffices for the discussion -- the important aspect being that the pipe is open to atmospheric pressure -- the same pressure at the top of the tank that supplies the water].

As water flows through a pipe, a pressure gradient develops along the pipe. If it's just one long pipe with the same inner diameter along the entire pipe, the pressure gradient is going to a linear drop from the voltage at one end of the supply [the pressure at the bottom of the tank] to 0 volts at the other end [i.e. atmospheric pressure -- why atmospheric pressure and not zero pressure -- again imperfect analogy, but this illustrates the *relative* nature of voltage readings. If you put the "negative" probe of a voltmeter, on the negative side of a battery, and the "positive" probe on the positive side of the battery, you will read a positive voltage. If you switch the probes [positive probe on negative side of battery, etc], you will read a negative voltage. "Ground" is merely what you choose it to be. If you call the positive side of the battery "ground", then all the voltages in your circuit will be negative, etc. -- it's something that takes some getting used to.

Here's another "thought experiment" to either confuse you, or make this more clear: If you stack two batteries on top of each other -- say, two D-Cells -- such that the positive terminal of one is touching the negative terminal of the other, and then place the negative probe of your meter, at the point where the two batteries touch, then touch the positive probe to the exposed positive terminal [i.e. the positive terminal that is NOT touching another battery], you will read something like 1.5 volts (or even as much as 1.6V if the batteries are fresh). If you touch the positive probe to the exposed negative terminal, you will read something like negative 1.5 volts [also written as -1.5V]. So, basically, the point where the batteries are touching can be considered "Ground", and the two exposed terminals constitute a positive and negative 1.5v supply [also written as +1.5V/-1.5V supply]. Now, if you take that same battery arrangement, and place the negative probe on the exposed negative terminal, then then the positive probe on the exposed positive terminal, you will read something like +3V [also written 3V -- i.e. without the positive sign, because positive is implied]. And, again, if you touch the negative terminal to the exposed positive terminal and read the exposed negative terminal with the negative probe, you will get a -3V reading. When doing that, you can say that you chose the exposed positive terminal to be your "Ground" -- it's all relative!

Now, back to the PhotoCell circuit: If there's a lot of light shining on the PhotoCell, the resistance is lower [the inner diameter is greater]. And if there is very little light shining on the PhotoCell, the resistance is higher [the inner diameter is smaller]. A larger inner diameter is going to allow more current to flow. And a more constricted diameter will reduce current flow. What happens when you connect a smaller pipe [one with a smaller diameter], to a larger pipe? The pressure gradient is no longer linear, and the smaller pipe limits the current flow in the whole circuit [i.e. along the whole pipe system]. The smallest pipe [i.e. the one with the largest resistance to flow] will cause the greatest pressure drop [will have the greatest pressure (or voltage) across it].

Another way of saying this is: In a series circuit, the resistances add up, and the largest resistance always has the greatest voltage across it [i.e *drops* the greatest voltage]. Notice that the 10k resistor is always going to be 10k. The PhotoCell resistance, on the other hand, varies depending on how much light is shining on it. If the PhotoCell resistance is less than 10k, then the 10k resistor will have the most voltage across it. If the PhotoCell resistance is greater than 10k, then the PhotoCell will have the greatest voltage across it. AND, if the PhotoCell has a resistance of 10k [i.e. is *at 10k*], then it will have the same voltage across it as the 10k resistor -- in that case they will both have the same voltage across them.

Another property of a series circuit is, the voltage is always the same across the whole circuit, no matter what the individual resistances are, in the circuit. It's like how, no matter what kinds of varying diameters are going on in a length of pipe, the same amount water pressure exists across the pipe system, no matter how that system of pipes changes [i.e. you stick a valve in the middle of it, and crank it open and closed, the pressure at the bottom of the tank won't change and thus the pressure across the system won't change). Also, the same amount of current that goes into the pipe system, is what comes out of the pipe system. If the value is turned to more closed, the total amount of current will reduce, BUT same rate of water flow at the beginning of the pipe will still be the same that comes out (only at a lower rate). The PhotoCell is like the valve.

And BTW: The series arrangement of the PhotoCell and the 10k resistor form what is called a Voltage Divider -- I know..shocking!

So, if the voltage across our little circuit [composed of a PhotoCell in series with a 10k resistor], never changes, then what is the implication for those voltages across the PhotoCell and the 10k resistor, as the "valve' is changed? The voltage divides across the resistors [i.e. across the PhotoCell and the 10k resistor]. And those voltages always add up to the voltage across the series circuit [i.e. across the two resistors].

So, if they are both at 10k, then they will both have the same voltage across them. Since the supply voltage is 5V, then each would have 2.5V across them. When more light is shining on the PhotoCell, then the PhotoCell, having lower resistance, will have less voltage across it, the rest of the voltage will be across the 10k resistor, etc.

A0 (on the Arduino) is like a pressure gauge. And like a pressure gauge, it doesn't affect the voltages and currents in the circuit [in simplistic terms -- as you study electronics you will learn about caveats to that statement :wink: ] -- but, it does provide a "reading" of what the voltage is at the point where it is connected. And in the case of your circuit, that point is between the PhotoCell and the 10k resistor.

Since ground, in this case, is chosen to be the negative side of the voltage supply [which is conventional for this kind of circuit (and this kind of system)], then the A0 input is measuring the voltage across the 10k resistor. To get the voltage across the PhotoCell, simply subtract the voltage reading from 5V. Or actually, since the ADC that the A0 pin is connected to [internal to the MCU on the Arduino] will give you a number between 0 and 1023. The number will be relative to the voltage across the 10k resistor. Subtract that number from 1023 to get the number corresponding to the PhotoCell. Or, do a conversion: (5/1023) * A0 reading = voltage across the 10k resistor [approximately -- again, further studies will reveal why]. Then subtract that from 5V to get the voltage across the PhotoCell.

1 Like