# How is this simple circuit working?

I'm trying to understand why this simple circuit below works the way does: As it gets darker over the photoresistor (RP) the LED gets brighter.

I'm trying to understand it by following the path the electricity takes through it (from - to +).

My theory is that when the room is bright, the electricity flows through the photoresistor and never actually gets to the transistor's emitter (so the LED stays off). When the room is dark, the photoresistor has near infinite resistance and thus the electricity is forced to go through the transistor (so the transistor is activated and the LED goes on).

• google voltage dividers Commented Apr 20, 2018 at 1:52
• Your theory is correct. Commented Apr 20, 2018 at 1:52
• Welcome to Electronics SE. Feel free to take the tour at electronics.stackexchange.com/Tour that will help you get the most from this site. And at the risk of adding yet another answer in comments, Ali is correct that you are correct. I trust someone will write a more complete answer for you. Commented Apr 20, 2018 at 2:27
• Hi, Alex. When you get a moment, try this one A slightly fancier version.
– jonk
Commented Apr 20, 2018 at 3:36
• Out of interest, what's the name of this circuit making kit? It looks pretty cool. Commented Apr 20, 2018 at 7:02

simulate this circuit – Schematic created using CircuitLab

Roughly speaking, $Q_1$ turns on when the base voltage exceeds about $650\:\text{mV}$. The LDR and $R_5$ form a voltage divider with the following equation:

$$V_\text{BASE}= 3\:\text{V}\cdot\frac{R_\text{LDR}}{R_\text{LDR}+R_5}$$

This solves out so that the LED is on (active) roughly when:

$$V_\text{LDR}\gt 27.66 \:\text{k}\:\Omega$$

I've got your exact kit. (Nice kit. Love the people that helped create it.) I get about $5\:\textrm{k}\Omega$ in bright light and get well over $10\:\textrm{M}\Omega$ in the dark.

So you can see that at some point your transistor will turn on sufficiently when the ambient light is dim enough. Before that point, $R_5$ will still be able to supply enough base current to $Q_2$ to keep it ON and therefore $D_2$ will be ON. Below that point, the LDR is sinking so much current that there isn't enough left over for $Q_2$. So $Q_2$ gradually turns OFF when the ambient light is strong enough.

For a more "crisp" turn on/turn off behavior you can try the following schematic:

simulate this circuit

The picture looks like this:

You can adjust the threshold with RV.

• What is the name of that kit out of curiosity? There are many similar kit, but this one is peeking my interest. With 3 younglings growing awefully fast, it is time for me to think about their scientific education and I think we did enough gravity testing (aka dropping stuff on the floor) for a while and we're ready for something else. Commented Apr 20, 2018 at 12:58
• @SimonMarcoux google hot wires electronic kit Commented Apr 20, 2018 at 14:29
• @SimonMarcoux Snap Circuits 300. \$45 for 300 projects. amazon.com/Snap-Circuits-SC-300-Electronics-Discovery/dp/… Commented Apr 21, 2018 at 4:16

You are basically correct, but it is the base where the voltage rises as the room gets dark. The emitter rises as well but is ~0.65 volt lower.

This means the gain/beta/hFE of the transistor is important as to how sensitive it is. A old transistor with poor gain (10) acts as a load to the photoresistor, thus more darkness is needed to make the LED bright.

Todays GP transistors have a gain of about 100, and a MPSA28 Darlington has a gain of 10,000. R5 looks to be 100K, which is fine for the transistor you have.

With a transistor of a gain of only 10, R5 might be as low as 10K, to supply enough drive current to the base. With the MPSA28 R5 could be 1M ohm. Darlingtons have a Vbe drop of ~1.3 volts.

The photoresistor has a wide dynamic range of resistance, so this is a good circuit to practice with in terms of transistor gain vs. bright/dark room, etc.

• I have the same kit as the OP (and then some -- fun system for teaching kids.) I get about $5\:\textrm{k}\Omega$ in bright light and get well over $10\:\textrm{M}\Omega$ in the dark. It's actually a quality photoresistor.
– jonk
Commented Apr 20, 2018 at 6:12

More formally, a transistor (the red NPN in that case) will start to transmit when the voltage on the base (in between the yellow resistor and the photoresistor) is above 0.7 volts.

The equation to calculate the base voltage is: Vb = Rphotoresistor / (photoresistor + Ryellow) * battery voltage

Like you predicted, if the photoresistor value become really small compared to Ryellow, the Vb will at some point fall bellow 0.7 volts and the transistor will be completely cut off.

That is a simplified version of what could really be going on. In reality, the base current will modulate the current that is passing through the Collector (the top of the transistor). The smaller the photoresistor, the more current flow through B and more importantly through C.

To conclude, the transistor can take different state: it can be cut-off (not letting any current flow between the collector (top) and the emitter (bottom), it can be in active mode (letting a current flow in between the collector and emitter proportional to the current flowing through the base) or it can be in saturation where the collector current for a given circuit is maxed out and an increase in the base current will not create an increase in the current circulating on the collector. The LED can be powered in the active or saturation mode. If the LED is powered in the active mode, chances are that you will see a dimming effect before a complete power off if the light change is slow. switching between saturation and cut off will act like an on/off switch.

To read further on transistors if you're interested: https://learn.sparkfun.com/tutorials/transistors

I hope this helps you getting started and I hope I was clear enough in my explanations.