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.

Step 1: 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!)


- Small circuit board (makes it easier!)
- SPDT Switch (for complete disconnection)
<p>inst aide of LED'S we can connect '0'watt bulb</p><p> and inst dide of 12volts we can connect to AC 230volts </p><p>plese help me in this</p>
<p>Two questions -</p><p>1. Will it work better with an old phone charger? (should be 5V DC)</p><p>2. What's the power consumption like? I built a similar circuit once, used cheap batteries and it finished them within a night. They're just cheap batteries, so I wasn't surprised, but I want to make sure I don't accidentally short something and discover it in the next bill.</p><p>(Yes, they're only LEDs, but there's always a way to screw something up)</p>
<p>I want to use it on 6v power source. Please tell me which things i have to change.</p>
<p>thats realy nice :)</p>
<p>Could I use a five volt iPod charger for this project? What would I need to change? Thanks!</p>
<p>I am a bit of a dummy when mathematics and electricity come together in the same issue. </p><p>.</p><p>How does one uprate the circuit, by selecting the right components, to switch 10 and 20W, 12V LED's?</p>
<p>is there any alternative for the 2N4401 transistor, i can't find it in stores...</p><p>thanks in advance</p><p>Rachit</p>
<p>The 2N4401 suggested is rated at 600mA Ic current. The LED in the picture consumes about 20mA at 3V. Even you use a high-power 1W LED, of course too bright for a night light, the LED will only consume about 280mA current. In case the LEDs connected are those small one rated at 20mA, you can use any small NPN transistor.</p><p>However, resistors value needed to adjust. For the transistor to turn on, the LDR (Photo Cell) has to establish a potential difference of 0.7V. With 12V power supply and 100k&Omega; resistor, the LDR will create 0.7V at roughly 6k&Omega; resistance. The transistor will only switch off in very bright environment. On the other hand, when 6V is used, the transistor will turn off when the resistance of the LDR drops to 12k&Omega;. Whether your circuit will work as expected depends on the specification of the LDR used.</p><p>This is what you need to do. Wait until the light intensity of your room drops to the level that you want the LED to turn on, measure the resistance of the LDR. Use this formula to calculate the value of the 100k resistor needed for your circuit.</p><p>Resistance of resistor = (Supplied Power x LDR Resistance) / 0.7</p><p>Assume LDR = 80k&Omega;, Power = 12V; Resistor = 80 x 12 /0.7 = 1371k&Omega;. Then you need to use a 1.3M&Omega; resistor in place of the 100k&Omega; shown in the circuit.</p><p>However, it creates another problem, with a 1.3M&Omega; resistor connected, the maximum base current will reduce to about 10uA, and a darlington transistor or two regular transistors are required to amplify the current to 20mA.</p><p>All in all, it's not an easy job. In case you really want to build this circuit, give me the measured resistance of the LDR decribed above and the supplied voltage you intend to use, I will then give you the circuit with all the correct component values. If you have some small transistor (NPN or PNP) already in hand, give me the numbers.</p>
<p>This is what I was looking for but I need it to run 2-3 LED's using 120 AC Volts??? Anybody know how to do this??</p>
Capacitor does the trick. <br>Once you get it working, please share. http://www.discovercircuits.com/H-Corner/AC-Powered.htm
<p>Hey the transistors very difficult to get as they are very rarely available. May i have options for any other alternative transistor?</p>
<p>Did you ever have Snapcircuits or a similar electronics kit?</p><p>they were also availbale in the uk, but a bit harder to find</p>
I made a similar project for my electronics class, but it uses a potentiometer to adjust the brightness/light sensitivity from to photocell, two red LEDs, similar resisitors, 9volt battery for power, and I created and etched my own board. All together it's inside a case with a battery snap I cut out of plastic. I can't add any photos right now because my teacher didn't grade it yet.
I made a similar project for my electronics class, but it uses a potentiometer to adjust the brightness/light sensitivity from to photocell, two red LEDs, similar resisitors, 9volt battery for power, and I created and etched my own board. All together it's inside a case with a battery snap I cut out of plastic. I can't add any photos right now because my teacher has it.
Anyone know what changes i will need if i use 30+ LED's for this circuit? Does each LED require a 1k resistor coming from a 12v 1800 MaH Ni-Mi Battery?
this circuit works great for my solar led windows <br>any one needs one solderd up let me know <br>
usually the white striped cable in the packed adapters is the negative one...
Of all the powerpacks I have worked with, all of them had solid black as negative, and white stripe as positive. Maybe you have a very unusual powerpack
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.
Any luck with 3LR44 batteries ?
Nice work!&nbsp;<br> <br> <strong>Issue of 3 leds:</strong><br> <br> The reason why you are not satisfied with results using 3 leds is because:<br> <br> a) you should have trippled the resistor values - 3 1k resistors in series and three 100k in series or<br> b) you should have used &quot;H bridge&quot; to increase the sensitivity.<br> <br> <strong>Alternative voltages:</strong><br> <br> a) AC Mains &amp; EL wire:<br> <br> Instead of using a 12v adaptor, you can use a diode bridge with capacitor (see my Instructables).<br> <br> EL wire can be used effectively with my &nbsp;diode bridge and capacitor power circuit along with your front end sensor circuit.&nbsp;<br> <br> Or&nbsp;<br> <br> 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.&nbsp;<br> <br> b) DC voltage:<br> <br> you can also use 9V, 6v or other battery pack variations without changing the main parts of the circuit!<br> <br> Hope it helps...<br> <br> reg<br> ketan
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).<br>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)?<br><br>Photocell specs:<br>size: 5.00x4.00mm<br>resistance on light: 5k-20k ohm<br>resistance in darkness: 1M ohm<br>max voltage: 150V (DC)<br>Peak sensitivity: 560nm<br><br>Thanks,<br><br>Jeff
do you use 3 leds or 1 led?<br><br>thank you!<br>marC:)
Hello!<br><br>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!
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...
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! <br>Thanks for the instructable!
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.
You can also do this with the same el wire inverter that was mentioned above, from http://www.ellumiglow.com.<br><br>You can add the light resister to the inverter to make this work.
I was wondering if it would be possible to setup something just like this but with EL wire instead of LED's.<br><br>I want a strip of blue EL wire going around the top of my room that turns on when the lights are off.
I looked into the EL wire a little and saw that they need inverters. <br><br>I found this one that runs at 12v: http://www.ellumiglow.com/Electric-Optics-EL-Wire-Inverter-p/eo25ei.htm<br><br>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?
put the switch in a break in the pos wire off the battery
How would you change the circuit where the led turns on when there is light instead of darkness?
can you help me out please, where would i put the switch?
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?
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)
where do you take that photo cell from <br /> ?<br /> <br />
i bought a pack at the source (radio shack for those of you in the U.S.) now i can actually use them...
is the NPN Switching transistor (2N4401) necessary? what is i want to use a 9v battery?
kind of. its what makes it turn on in the dark and not during the day. for a 9v battery use different resistors
if i had a circuit in place already could i just add a photocell to the - side of the circuit?
Can 30-40 LEDs be used with this circuit???? Any modifications needed???Which resistor to change etc.
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
What changes did you make to the circuit (if any) in order to use 3 LEDs?

About This Instructable


101 favorites


More by frostedminipete: LED nightlight that turns on in the dark
Add instructable to: