Electronic – Basic circuit to keep LED either on or off depending on night/day

ledlightphotoresistorswitches

How can I have a LED either on or off (not in between) depending on night or day with basic electronics? I have created the circuit below, but it only shines and in darkness it dims.

This is my attemp

The photo-resistor is about 3kΩ when light shines and about 1MΩ when dark.

I want my LED to shine at night and be off at day.

What is the simplest way I can achieve this?

Best Answer

You need the LED to be lit when the photoresistor is high resistance. So replace the photoresistor with a fixed resistor R3, to supply the base current to turn the transistor on.

Then you need the LED to turn off when the light shines, and the photoresistor is low resistance. So connect the photoresistor from base to ground.

Now, when its resistance is low enough, it will drain the current from R2 to ground, and hold the base voltage below 0.6V turning the transistor off.

Say, at 3kilohms we aim to get the base voltage down to 0.3V. Then 0.3V/3k = I = 0.1ma. Then R3 must drop the remaining voltage 4.7V at 0.1ma, so R3 should be 47k.

Now the transistor will start to turn on when the photocell resistance exceeds 6 kilohms. If that's still too bright, increase R2.

Answer in a schematic

Schematic