# A simple LED light night switch

#### tigfur

Jan 13, 2020
2
Hi,
i am a complete beginner and i would like to make a LED light, that turns off during the day.

I have found this diagram online, which seems simple enough.
- This shows a switch that turns on during light, so id have to change LDR and R2
- I would like to use a LED instead of an LDR (found online you can do that and i find that interesting and want to try it, though it uses mosfet)

Here are my questions:
- passive consumption > wouldnt this design consume power even when the LED is off due to the circuit being basically shorted through a resistor?
- Could it be modified to not consume any energy when dark?

- is the R2 even necessary? if there was no connection it would be equal to indefinitely large resistance and still would work if the LDR resistance is high enough since it could possibly cut off the connection entirely? Obviously here its a potenciometer which helps adjust the threshold but i am just curious.

- would i have to change anything in the math if i added a few more LEDS in paraler?

I would like to make a long lasting battery powered outdoor light, so its important it doesnt waste energy.
Eventually itd be nice to have it with a small solar charger but i dont know anything about that, as this already is beyond my knowledge.

Thank you for any help

#### PETERDECO

Dec 19, 2019
239
Tigfur unless I am missing something, your circuit will turn the LED on in light and off in dark. You would have to swap positions of the LDR and R2. BUT then you need a resistor in series with the base to prevent blowing the transistor when R2 is turned up to the + 9V.

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,194
I would like to use a LED instead of an LDR (found online you can do that and i find that interesting and want to try it, though it uses mosfet)
An LED can be used as a photosensor, but the signal is much, much weaker than the one from an LDR. You need some gain (amplifier) although a MOSFET based solution with a high impedance pull-up resistor may work. You'll have to give it a try.

wouldnt this design consume power even when the LED is off due to the circuit being basically shorted through a resistor?
It will, but only moderately (9 V / 100 kΩ = 90 µA).
Could it be modified to not consume any energy when dark?
Yes: use a mechanical switch
This is obviously not what you are thinking of. In other words: no. One can minimize energy consumption (e.g. by eliminating the base current through the use of a MOSFET), but not down to zero. Without a tiny tad of energy the circuit will not be able to detect the change in environmental light.
is the R2 even necessary?
When you swap R2 and the LDR, you need R2 to allow base current into the transistor (or to generate a positive gate voltage for a MOSFET).
- would i have to change anything in the math if i added a few more LEDS in paraler?
You should not connect LEDs in parallel. Due to slight differences in their characteristic they will light quite unevenly. You can add LEDs in series, or use a parallel circuit with a separfate resistor for each LED. See our resource "got a question about driving LEDs?"
I would like to make a long lasting battery powered outdoor light, so its important it doesnt waste energy.
Use a high capacity battery. The typical 9 V block is a poor source of energy for long term usage. This circuit requires ~ 18 mA when the LED is on. A typical alkaline 9 v block has a capacity of ~550 mA. At 18 mA the battery will be drained after ~30 hours of lighting, 3 days when the LED is on for 10 hours per night.
Eventually itd be nice to have it with a small solar charger but i dont know anything about that, as this already is beyond my knowledge.
Not to worry: This circuit will work equally well from a 5 V source (adjust R1 for LED current). SO you can use an off the shelf USB power bank (5 V) with solar charger which you can buy as a complete set from different vendors.

#### bertus

Moderator
Nov 8, 2019
2,920
Hello,

The given circuit does not have an hysteresis.
There is no switching point.
The transistor can get into a linear mode.
A circuit with a comparator and hysteresis will switch the led on and off.

Here is a circuit that will do that:
https://www.electroschematics.com/dark-activated-relay/
At the moment there is a relays in the circuit, but that can be replaced by the leds.

Bertus

Oct 5, 2014
6,339

#### Attachments

• LEDin.jpg
219.5 KB · Views: 4
• LDRin.jpg
78.1 KB · Views: 4

#### tigfur

Jan 13, 2020
2
Thanks for the tips.
I will try leds in paraler with each having its resistor of course and a mosfet as thats the easiest i can do.
I did some testing with a basic transistor and the LED resistance changed from unmeasurable to 500MegaOhm, which is indeed way too high for a regular transistor.
The relay seems a little bit complicated but i might give it a shot some day.
Buying it seems a valid option at this price as well.

#### Bluejets

Oct 5, 2014
6,339
Buying it seems a valid option at this price as well.

There are some that will argue, making it yourself is the way to learn.

My argument for that is, buy the elcheapo unit, reverse engineer it and one is in front on two levels.

Replies
2
Views
970
Replies
9
Views
1K
Replies
6
Views
1K
Replies
4
Views
3K
Replies
2
Views
2K