3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

LED nightlight that turns on in the dark

LED nightlight that turns on in the dark
My first instructable! This is something I originally made for a friend who's still using it. It works very nicely at adding a nice ambient light to a dark room. I made this instructable because I decided to make one to stick in the bathroom at my house.

It's a small easy to build circuit that will, as the title says, turn an LED on when it's dark and turn it off when there's light, making it a perfect night light. It runs on a 12v wall adapter, so you won't need to worry about replacing a battery.
 
Remove these adsRemove these ads by Signing Up
 

Step 1What you need

What you need
So here's what you need for this project:

[Soldering iron, of course... and solder]

- 100k Resistor
- 1K Resistor
- NPN Switching transistor (2N4401)
- Photo Cell
- 3v LED
- 12v wall adapter (look around... I'm sure you've got one somewhere!)

Optional:

- Small circuit board (makes it easier!)
- SPDT Switch (for complete disconnection)
« Previous StepDownload PDFView All StepsNext Step »
25 comments
May 8, 2012. 1:33 AMpandyaketan says:
Nice work! 

Issue of 3 leds:

The reason why you are not satisfied with results using 3 leds is because:

a) you should have trippled the resistor values - 3 1k resistors in series and three 100k in series or
b) you should have used "H bridge" to increase the sensitivity.

Alternative voltages:

a) AC Mains & EL wire:

Instead of using a 12v adaptor, you can use a diode bridge with capacitor (see my Instructables).

EL wire can be used effectively with my  diode bridge and capacitor power circuit along with your front end sensor circuit. 

Or 

You can also use an old plone charger, negative of the main circuit touches the outer side of the charging pin, while the positive of the circuit goes inside the pin. 

b) DC voltage:

you can also use 9V, 6v or other battery pack variations without changing the main parts of the circuit!

Hope it helps...

reg
ketan
Mar 30, 2012. 10:24 AMCivicSiR says:
Thanks for sharing your design. I followed your method, but I'm using a 9V battery and 16 smd leds (it's a led for car dome rated at 12V). I got the photocell from ebay, but they don't seem to work as well. The leds only turn off when it's 10cm away from light source (i.e. yellow ccfl light or white led flash light).
What am I doing wrong here? Any way to increase the sensitivity of the photocell, so that it can turn off the leds with small amounts of light (clear sky during the day)?

Photocell specs:
size: 5.00x4.00mm
resistance on light: 5k-20k ohm
resistance in darkness: 1M ohm
max voltage: 150V (DC)
Peak sensitivity: 560nm

Thanks,

Jeff
Jan 25, 2012. 5:45 AMnodoubtman says:
do you use 3 leds or 1 led?

thank you!
marC:)
Apr 21, 2011. 5:59 PMThegame995 says:
Hello!

Do you know much much money it will cost me in electricity each month? Not exact, but is it expensive to have on like 7-8 hours a day? Does it use a lot of electricity? Thanks!
Jun 8, 2011. 2:04 PMcreatorroboto says:
Well, it it uses 12 volts so a nine volt battery in series with a 3 volt battery pack would work but an ac adapter shouldn't cost you too much...of course I not sure about the close count...
Apr 21, 2011. 5:56 PMThegame995 says:
Could you please please please PLEASE! Upload a video where you do this? Im very new and I would like this to be my project! I really want this as I have the same PCB board! Please tell me a bit more detail/more pictures/a video!
Thanks for the instructable!
Mar 27, 2009. 4:55 AMevilmadscientistman says:
can someone help me, I can't seem to make it so that if its past the "dark" threshold it goes on and if its brighter that that it goes off it doesn't have just 2 solid states it has this big gray area were its only partly on.
Mar 21, 2011. 7:03 PMElectricFeel says:
You can also do this with the same el wire inverter that was mentioned above, from http://www.ellumiglow.com.

You can add the light resister to the inverter to make this work.
Feb 14, 2011. 3:59 PMdawisch says:
I was wondering if it would be possible to setup something just like this but with EL wire instead of LED's.

I want a strip of blue EL wire going around the top of my room that turns on when the lights are off.
Feb 14, 2011. 4:41 PMdawisch says:
I looked into the EL wire a little and saw that they need inverters.

I found this one that runs at 12v: http://www.ellumiglow.com/Electric-Optics-EL-Wire-Inverter-p/eo25ei.htm

So now my question is, could I simply remove the 1K resistor all together so that a full 12v from the wall outlet is flowing through then solder the inverter leads into the circuit instead of the LED? Or does their need to be a resistor there still?
Feb 14, 2011. 8:25 AM20cookies says:
put the switch in a break in the pos wire off the battery
Jan 27, 2011. 5:55 PMsimdude2u says:
How would you change the circuit where the led turns on when there is light instead of darkness?
Aug 22, 2010. 10:34 PMjoasan18 says:
can you help me out please, where would i put the switch?
Jun 29, 2010. 11:50 PMzack247 says:
how do i make it so the light turns on when no power comes out of the wall? could i use say... a 5v adapter and put that where the photocell would go?
Jun 6, 2010. 12:04 AMzack247 says:
awesome! i found this instructabe a long time ago but i forgot to bookmark it. it took me about 3 months to finally find it again! (in my spare time, of course)
Feb 26, 2010. 6:25 AMLucasc95 says:
where do you take that photo cell from
?

Jun 6, 2010. 12:02 AMzack247 says:
i bought a pack at the source (radio shack for those of you in the U.S.) now i can actually use them...
Sep 1, 2009. 11:15 PMjoasan18 says:
is the NPN Switching transistor (2N4401) necessary? what is i want to use a 9v battery?
Jun 6, 2010. 12:01 AMzack247 says:
kind of. its what makes it turn on in the dark and not during the day. for a 9v battery use different resistors
May 14, 2010. 12:37 PMJustXtreme says:
if i had a circuit in place already could i just add a photocell to the - side of the circuit?
Aug 24, 2009. 4:29 AMmhkabir says:
Can 30-40 LEDs be used with this circuit???? Any modifications needed???Which resistor to change etc.
Jul 30, 2009. 11:36 PMEddiev1985 says:
Thank you very much for posting this! I was just playing around with a photo cell or light dependent resistor and an led. Sure enough, the less light the LDR received the dimmer the led became. I've been promising my wife a purple LED night light. You just gave me the answer I've been looking for. Very cool project! Well done! Thanks again. Eddie
Jul 21, 2009. 12:24 AMagis68 says:
usually the white striped cable in the packed adapters is the negative one...
Jul 1, 2009. 6:58 PMb3nj4m says:
What changes did you make to the circuit (if any) in order to use 3 LEDs?
Apr 3, 2009. 4:56 PMLocutis says:
I'm going to try to build this with 3 LR44 batteries instead of a 12V wall adapter. If it works I'll post it.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
2
Followers
1
Author:frostedminipete