Today I am going to show how to make a dark detecting nightlight. It is a basic light that lights whenever it detects no light, so when you turn off the lights in your room, it will light up by itself and give out a mild beautiful glow. If you are a beginner to electronics it is an extremely easy circuit to build.
DO NOT BE SCARED OF THE NUMBER OF STEPS!! I divided up the tutorial into many small steps so that it is easier to make and under stand. So here's the breakdown of the steps:
A) Introduction and a video of how to make it (I highly recommend watching my video on how to make it in step 1 )
B)How to make the circuit on a breadboard: 1)Materials. 2)Assembly. 3) How well it works.
C)How to make the circuit on a perfboard: 1)Materials 2)Assembly 3)Soldering and tips 4)Project encloser 5)How well it works.
D)How does it work?
E)Troubleshooting tips and improvements.
It is a very inexpensive yet fascinating circuit, and hope you would learn something from it! I am extremely sorry for any mistakes! Lets get to it!!
Step 1: A: Watch the Video to Learn How to Make It!!
Step 2: B: How to Make the Circuit on Breadboard: Materials List.
1)A solder-less breadboard.
2)Jumper wires. (If you don't have pre-made ones, then just take a piece of solid core wire and strip the ends and use it.
3)NPN Transistor- I used 2N3904, but any NPN transistor would work. But some good examples are BC337, 2N2222, BC547.
4)A 470 Ω resistor,
5)A 22K Ω (22000 Ω) resistor.
6)A L.E.D (Colorful LED s looks better. I chose a color changing LED.)
7)Light Dependent Resistor (L.D.R)
8)1.5 volt coin cell Battery ×3 and a battery holder.
Step 3: B: Basics of Breadboard.
I do not own this picture, so credit goes to who created this picture. (Sorry I couldn't find the name.)
Step 4: B: So How Do I Find Out the Polarity of the Components??
The LED is a polar component, and would not work if placed incorrectly. The longer lead of the LED is the positive lead, and the shorter lead is the negative. Also the head of the LED has a flat side near the negative lead.
The Resistors are non polar, and does not matter how you plug them in. They will work either way.
The LDR is just another form of resistor, so it doesn't have any polarity. So you can plug it in either way.
The transistor is polar, and in fact, it has three leads, which could be confusing. But when you have the flat side of the resistor facing you, the lead on the left is the emitter, the lead in middle is the base, the lead on the right is the collector. But always be sure to look at the datasheet to find out layout, because sometimes it could be different.
The batteries should have a sign on it saying + or -, use that information.
Credit goes to whoever created the pictures.
Step 5: B: Assembly Diagram of the Circuit on Breadboard.
Use the schematic to refer to the polarity of the circuit.
If you have any confusion on how to plug in the L.E.D here's a few tips. Remember the L.E.D has one long lead and one small lead. The smaller lead of the L.E.D is the negative side. Also one side of the L.E.D's head is flat. The lead on the L.E.D on the flat side is the negative lead. The negative lead of the L.E.D goes to the negative end of the battery.
Step 6: B: Lets Assemble the Circuit on Breadboard!!
But its not really permanent is it? We can not carry around a breadboard with this circuit all the time, because breadboards aren't really meant to make permanent circuits. Lets move on to the next step to make it permanent!!
Step 7: C: Lets Make It Permanent!! Perfboard!!
*(You do not need a breadboard now)*
1)NPN Transistor- I used 2N3904, but any NPN transistor would work.( BC 337, 2N2222 etc)
2)A 470 Ω resistor, and a 22K Ω resistor.
4)3- 1.5 volt coin cell Battery and holder.
5)A perfboard or vero board.
6)Light Dependent Resistor (L.D.R)
7)Two wires of about 1 foot.
8) A tic tac container for housing the circuit.
The tools you will need are:
1)A soldering iron.
2)Needle nose pliers or cutters.
4)Solder, soldering stand.
5)Hot glue gun.
6) Xacto knife (Optional)
Step 8: C: Shaping the Perfboard
Step 9: C: Plug in the Components!!
Do not plug in the LED, RESISTOR or attach the Batteries yet.
Sadly the picture doesn't show the second resistor plugged in, as I forgot to take a picture of it after plugging in both resistors.
Step 10: C: Make Extensions for LED,LDR and Battery
Cut 6 wires of about 1 inch length and strip insulation from the ends. Making them of different colors could be helpful. Now using a soldering iron tin the wires.
How to tin the wire? : To tin the wires means to apply a layer of solder to the wires' ends. This helps in soldering them to the board. To tin the wires, first take the wire and using a helping hand, hold it in place. Then touch the end of your soldering iron on to the end for 3 seconds. Now take the solder and touch it to the junction of the iron and the wire. You will see the solder melting and running up the wire. If the end of your wire is covered by a thin layer of silvery shiny solder then it is correctly tinned.
Step 11: C: Lets Finish the Circuit Board!!
Solder everything together.
Take a scissor or wire cutters, and cut of excess leads from the circuit.
How to solder?
Take the soldering iron, and touch the tip to the components' lead and the metal pads of the perfboard at the same time for 3 seconds. Then run the solder to the junction until it makes a shiny concave joint of solder. If its not shiny, or if it is a large blob of solder, then you should use soldering wick to get rid of the excess solder, and try soldering it again. There are many useful tutorials on instructables on how to solder, use them to your benefit.
Step 12: C: Lets Make It Look Nice
Now make a hole on top of the cap of the container, big enough to fit the LDR snugly.
Now put the circuit inside the container, and make the LDR's head stick out through the hole in the cap.
Use hot glue to fix everything in place. Adjust the leads of the LED to the fix it in place. Also use hot glue to insulate parts of the circuit, so that it doesn't short circuit.
Now time to test!!
Step 13: C:Lets Test It!!
It will light up brightly in a completely dark room, but it might light up dimly in a mildly dark room based on the light levels.
Yass, its working. Wondering why it works so easily? Look into the next steps.
Step 14: D: So How Does This Work?
The transistor can used as an amplifier or a switch. A normal NPN (Negative Positive Negative) transistor allows current to flow through the collector and emitter pin only when there is a small voltage is applied to the base of the transistor.
The LDR acts like a resistor. When there is no light, the resistance of the LDR is extremely high, , but when there is bright light applied to the LDR, the resistance of the LDR becomes extremely low.
I will be talking in terms of conventional current, assuming that the electricity is flowing from positive to negative side. (Electricity flows from negative to positive in terms of accepted science.) So according to the schematic, the current could flow from the positive side of the battery to the 22K resistor and the collector. Current can not flow the collector, as there is no current at the base yet, so current only flows through the 22K resistor now. Current flows through the 22K resistor and has two ways to choose, it could go the base of the transistor or the LDR. Assume there is bright light in the room. So the resistance of the LDR is extremely low. As the transistor's resistance is higher than LDR right now, the current chooses the easier path and goes through the LDR to the negative side of the battery. So the LED doesn't light up, as current isn't flowing through it.
But when there is no light, the resistance of the LDR rises substantially, and so the current chooses to go to transitor base rather than the LDR, and the current in the base of the transistor allows current to pass through the Collector and emitter and the LED to the negative side of the battery. The LED lights up!!
This is an extremely general explanation of how the circuit works. I am not an electrical engineer, or physics teacher, so I am bound to have limited knowledge about the circuit, so I request you to help me fix any mistakes I have.
Step 15: E: Troubleshooting and Tips for Improvements!
1) Well, my light isn't lighting up dude. Its fake, fake, FAKEE.
Solution: Well, I see a lot of people saying that, but no I do not have time to make fake circuits. So the problem in general is really broad, but here are a few solutions. Firstly check to see the circuit layout, make sure you haven't missed the components. Secondly check to see if your battery is working or not, using a multimeter.
2) My circuit doesn't turn off in bright light!!!
I had the same problem. To solve this you need to change the resistance of the 22k ohm resistor. take the multimeter and check the resistance is the LDR in bright light. Now switch the 22k resistor with a resistor with a higher resistance than the value we just measured. It should work!
3) It's really dim
Add new batteries, or decrease the resistance of the 470 ohm resistor.
Improvements: You could make tons of improvements with this circuit. You could make one that would light up your bedroom with adjustable brightness by adding potentiometer. You could use a switch to make sure it doesn't run out of batteries by constantly staying on all the time. You could also use this layout and switch the LDR with different types of sensors to sense different conditions and light up the LED. The possibilities are many, as long as your creative mind supports it.