138Views4Replies

# Hi, I need some help to understand how is this working. Answered

This is the source of my question.

My question is : why is the LED lighting up as it gets dark ? I taught that a LDR (light dependent resistor) is supposed to let current pass only when light is shining on it (source), so why here is it letting current pass only when it's dark. And what is the role of the transistor in this circuit ? Any clarification is much appreciated, Thank you.

Tags:

## 4 Replies

steveastrouk (author)2013-05-27

There isn't a clear circuit, but I think you can see that the BASE of the NPN transistor is fed by the LDR and 100K resistor. In the light condition, the voltage at the base of the transistor is kept low by the LDR. As it gets dark, and the LDR resistance climbs, the voltage on the base INCREASES, if enough current can flow through the 100K resistor, the LEDs will turn ON.

Eunix (author)2013-05-27

Thank you for answering my question in such a clear manner, this info is really helpful.

rickharris (author)2013-05-27

LDR is a low resistance when it is illuminated and a higher resistance when it is dark.

You need a transistor to switch the LED - the point of switching depends on the value of the resistor.

http://en.wikipedia.org/wiki/Photoresistor
Yes, light should lower the resistance and allow current to flow.

https://www.instructables.com/files/deriv/F30/RKHP/H5JCLTD0/F30RKHPH5JCLTD0.LARGE.jpg
per that image, the BC548 transistor is Collector on the bottom, Base on the middle left and Emitter on the top.

Current flows from the battery, through the leds, then through the transistor (if allowed), then back to the battery.

The resistor and the LDR form a voltage divider, with the resistor pulling the base UP to almost 4.5 volts (which would cause the transistor to conduct) and the ldr pulling the base DOWN (to near zero volts (which would cause the transistor to turn off), when light is shone on it.

So: Pullup is always 100k
Pulldown LDR is either 100k (dark) or say...1k (light)

When dark, the transistor sees 4.5 volts (9 split in half) which causes the transistor to conduct, which turns the light on.

When light, the transistor sees 9v through 100k and 0v through 1k; which results in the transistor base getting 0.089V - not NEARLY enough to make it conduct, and the led goes off.

Basically, the transistor is INVERTING the signal from the LDR because the current passing effect of the LDR is inverted from what you want.