My night light does not begin glowing until the ambient light in the room is very dim. Others I've seen on here begin glowing when the light in the room is still fairly bright. If your night light comes on when the light in the room is still bright you're going to be wasting a lot of the electricity in your battery. Another feature is the use of the 9 volt battery using the built-in 5 volt regulated power supply. My thinking here is by powering the night light with a 9 volt battery it should operate for quite a while before the battery will need to be replaced.

Step 1: What You Will Need


  • SPST on/off switch
  • LM7805 Voltage Regulator
  • 0.33uF ceramic capacitor
  • 0.1uF ceramic capacitor
  • 820R ohm resistor
  • 100k resistor
  • LED - Bright red is easier on sleepy eyes but white will probably be brighter

  • LDR: also known as a Photocell - Photo Resistor - Light Dependent Resistor
    Bright Resistance (10Lux) (KΩ): 10-20Dark Resistance (MΩ): 1

  • 9 volt battery snap

  • 9 volt battery

  • Breadboard for testing

Step 2: The Circuit Schematic

This is the complete circuit. I used CadSoft's Eagle schematic design software and the LDR symbol is a little different from the LDR symbols I've seen on other schematics. If you are interested in using the Eagle software I recommend reading the Instructable by westfw on where to obtain and using the software. And he also provides a couple of useful links.

Step 3: The Voltage Regulator

I built the voltage regulator first and then tested it to make sure it was actually putting out 5 volts. As the 9 volt drains it will maintain the correct voltage this night light needs to operate correctly. I really think it should be able to go for quite some time before the battery will need to be replaced.

Step 4: The Completed Circuit

Here's a close-up of the completed circuit. You can see it's really very simple. In the picture where the LED is lit I have placed a Sharpy pen cap over the LDR to put it in complete darkness. I plan to make some birthday and Christmas gifts using this circuit. Maybe find a Statue of Liberty model where the LED can be placed in the torch Lady Liberty is hoisting up in the air. Another couple of ideas I've had are to place the night light in a tiny house so the glow comes through the windows, or a little campsite with the LED in the campfire. You should be able to come up with some great ideas too!

<p>And of course a 2N2222 NPN transistor will <br>work in this circuit just as well as the 2N3904. The main difference <br>between the two transistors is the amount of amperage they can handle. <br>If you'd like to see a page comparing the two in depth visit: </p><p><a href="http://www.learningaboutelectronics.com/Articles/2N3904-vs-2N2222.php" rel="nofollow">2N3904 vs 2N2222</a></p>
<p>what is the work of SPST when it is automatic ?</p>
<p>Adding the switch was a mistake. Really serves no purpose. </p>
<p>oh.. thanks to all :) i am done with this project. Could you guys provide me some new one too.</p>
<p>what is the work of SPST when it is automatic ?</p>
<p>hi </p>
<p>Nice project, good explanation!</p><p>Some fundamental concepts to clear possible misunderstandings you may have.</p><p>In term of power consumption, the higher the supplied voltage, the higher is the power consumed by the circuit. Hence, if you want to save battery power, the supplied voltage should be as close as possible to the working voltage of the LED plus voltage drop by the transistor.</p><p>Power consumed by the circuit depends on supplied voltage. Assume the LED consumes 20mA at 2.2V, with a 9V battery, the circuit consumes (9 x 0.02)W = 0.18W. The 7805, the LED limiting resistor and the transistor (Vce) will together consume (9 - 2.2) x 0.02W = 0.136W; the LED only consumes 0.044W.</p><p>If you use 3V, the LED still consumes 0.044W, but the whole circuit consumption will reduce to 3 x 0.02W = 0.06W. And you need to adjust the value of R1 and R2.</p>
<p>Thank you so much JohnL8 for taking the time to help me out with the information. I have learned some things since I wrote this Instructable but I really have so much yet to learn, and of course the more I know, the more I realize how much more there is yet to learn! One area that is really hard me to calculate/learn/understand is figuring the correct voltage to apply to the base of transistors. I think my biggest problem there is figuring the correct values to use in the equation.</p>
<p>I have the same feeling that a little more I know (learn) the more I am confused. And then I realize only because I am looking at one small corner of an huge iceberg. Learning is a lifelong task.</p><p>For your circuit, first thing is to decide what power supply voltage is connected to the transistor. Although the 7805 may not be necessary in your circuit, and If you still want it there for experimentation, then we start with 5V.</p><p>For 2N3904 or any small transistors, it has to establish a base-emitter voltage (Vbe) of 0.65-0.80V for collector-emitter (ce) conduction. Current drawn by the LED used is comparatively small and we can assume we need a Vbe of 0.65V. That means we need the LDR to establish 0.65V in a particular ambient room light to turn on the transistor.</p><p>LDR has different specifications, so next is to measure its resistance at the light level you want the LED turns on. Assume x&Omega;. R2 and LDR form a voltage divider connected to 5V, we need to calculate R2 (y&Omega;) in terms of x&Omega;. Therfore, we have: 5x / (x + y) = 0.65; and y = 6.69x. So if the measured x is 100k&Omega;, then R1 will be 669k&Omega;, and a standard 680k&Omega; resistor can be used. Simply to say, the LED will then turn on at the exact light level you want, when the resistance of LDR increase to 100k&Omega;. Now there is a problem.</p><p>With 5V and 780k&Omega;, the current is 6.4uA, we need an amplification of 3125 times to get 20mA to light up the LED fully, and 2N3904 is incapable to do that. And we need either a darlington transistor or two small regular transistors to do the job.</p><p>Readers may complain about the LED turns on too early or too late, precisely not at the light level expected, simply because components interact with one another. Lately, I drew a similar circuit. If interested, I can attach as image.</p>
<p>A darlington setup is fine, but you can also use an N-channel MOSFET to do the job. Replace R2 with a variable resistor (maximum value equal to LDR's &quot;dark&quot; resistance) to make the circuit adjustable so you can fine-tune it to your room's ambient light levels.</p>
<p>Thank you for the info. Sure I would like to see your circuit!</p>
<p>Here's Youtube video I have watched a countless number of times and it seems i learn something new with each viewing. </p><p><a href="https://www.youtube.com/watch?v=8DMZSxS-xVc&index=1&list=PLgRpx8cm2qlXfYdJglfD0m7GwxB4nfvnL" rel="nofollow">Tutorial: How to design a transistor circuit that controls low-power devices</a></p><p>For example I have 4 sets of two LEDs in parallel. Four of the LEDs are blue and use 3.4 volts and 20 mA and the other four are red and take 2.4 volts and the same current. I use an 82 ohm resistor for the blue and 68 ohm for the red. I have several types of transistors I can use in this project, 304 NPN, PN2222A, BC547 and I can also use a various input volatges as well. I want to trigger this with a PIR which has a signal voltage of 3 volts which I think will be much more than I will need to cause the transistor to complete the circuit. I guess I just need to figure my Ic current which is what will run from base to emitter? And to figure that I need to know the wattage of the four combined LEDs? And then also there's the .7 used by the transistor itself. Anyway, good thing I have the rest of my life to learn this! </p><p><a href="https://www.youtube.com/watch?v=8DMZSxS-xVc&index=1&list=PLgRpx8cm2qlXfYdJglfD0m7GwxB4nfvnL" rel="nofollow"> <br> </a></p>
<p>Which component(s) do I need to change in order to change the light sensitivity?</p>
<p>It's the R2 100k resistor that controls how much ambient light will set off the night light. If you replace it with a lower value resistor (for example a 47K resistor) the LED will glow even though the room light is still plenty bright enough for you see around the room.</p>
<p>Since my voltage to LED1 is 5 volts and that particular LED is rated at 2.0 - 2.4 volts and 18 to 20 mA I could place a resistor (R1) as low as 150 ohms, if I use 2.2 volts as my estimated voltage drop in the eqation.</p>
Neat ! Love it! I think it is cool and will try it'
cool ideas for usage of the set up. and seems simple enough for a non- electronic minded person like myself could do. yes i am a knuckle dragger ( industrial mechanic).
<p>Thanks for the positive comment seamster! It's my first electronic Instructable and also my first time working with CAD.</p>
<p>Nice and simple! Thanks for sharing this!</p>

About This Instructable



Bio: Electronics have always been fascinating to me. Things that get my attention are clocks, lamps, motion activated devices, light activated devices, laser intruder alert systems ... More »
More by Volthaus Electronics Laboratory:Adeept TM1638 LED 4-Digit 7 Segment Digital Display Module Remote Control - Bluetooth - Arduino - Android RPi 
Add instructable to: