Automatic Street Light Box (Using LDR - “Light Sensor”)
by mulve84815 in Circuits > Gadgets
1159 Views, 8 Favorites, 0 Comments
Automatic Street Light Box (Using LDR - “Light Sensor”)
What is this product:
This is an LDR circuit which will turn a LED on at night (when it is dark out), and off in the day (when it is bright out). This concept is similar to the street light system (on at night, off in day). Additionally, a potentiometer is added in order to adjust the sensitivity of the LDR. For example, if it is a cloudy day, we could rotate the potentiometer, so it is more sensitive to the reduced amount of light.
Supplies
Items needed:
- 5cm x 7cm Perf board
- Jumper wires (strip wires)
- 470 Ohm Resistor
- 1K Ohm Resistor
- Photoresistor (LDR)
- 1K Potentiometer
- 2N2222A NPN Transistor
- Safety goggles
- Soldering iron
- Small sponge
- Push button switch (Latch switch)
- Insulating tape
- Potentiometer cover
- Battery holder
- TinkerCAD (free website)
- Autodesk Fusion 360 Software
- Flashprint application
Get Set Up on TinkerCAD
Firstly, I would recommend building the circuit on TinkerCAD (a free website for circuit design). Once you have created an account, it should take you to the home page. Proceed by clicking the “Create” button in the top right corner, followed by “Circuits”.
Start Building on TinkerCAD
The components you will need to add include:
- 9V battery
- NPN transistor (Has a collector, base, and emitter. Electricity will flow to the collector, and will only flow out of the emitter when the base is given electricity. Base acts as a bridge)
- Potentiometer (Adjusts the sensitivity of the LDR to light)
- Photoresistor (Decreases resistance when luminosity is high, and increases when it is low - dark)
- LED
- 470 Ohms Resistor
- 1000ohms Resistor
We will connect these components with 9 wires.
The first thing to know is during the day (when it’s bright), resistance is low; conversely, when it’s night (dark outside), resistance is high. The way this circuit works is as follows. The electricity comes from the positive side, and goes to the collector of the Transistor (via a strip wire). Some electricity also comes from the positive side, and connects to Terminal 2 of the Potentiometer (via another strip wire). Adding a wire to connect the Wiper to Terminal 1 of the Potentiometer allows the electricity to now flow to Terminal 1. We then add a wire to connect Terminal 1 of the Potentiometer to Terminal 2 of the Photoresistor. What happens next depends on the brightness outside.
- When it’s day time:
During the day, it is bright out, and thus the Photoresistor’s resistance is low. According to Ohm's Law, the current will take the path of least resistance in a circuit. This means that the electricity to go through the Photoresistor, and out (through Terminal 1), and to ground (negative).
- When it’s night time:
At night, it’s dark out, and thus the Photoresitors’s resistance is high. This means that the electricity current will take another path. In this case, we put a jumper wire to connect Terminal 2 of the Photoresistor to a 1000 Ohms Resistor, and this Resistor is connected to the base of the Transistor, (which connects the electricity that’s at the collector of the Transistor, to the emitter side). Then the current goes through a 470 ohms Resistor, to the Anode of the LED. Thus lighting up the LED. Then we attach a jumper wire going from the Cathode of the LED, to ground.
You can also build this circuit on an actual breadboard if you prefer.
Soldering on a Perf Board
Before we get into where we solder, one needs to know how to solder. Some basics for soldering include wearing safety glasses, and using a soldering clamp stand. Make sure to have a sponge so that you can wipe the soldering iron on.
Soldering on the Perf Board is similar to the breadboard we designed on TinkerCAD. Some key differences are as follows. While the horizontal holes are still connected in groups of 5 in the two middle columns, groups of 2 on the left hand side, and groups of 3 on the right; the perf board is not connected vertically on the outer columns. In order to connect the components to negative (the black wire coming out of the board on the left), I used a wire to connect the Cathode of the LED, to the wire which comes connects to Terminal 1 of the Photoresistor. This means that all my components that need to be connected to ground/negative are all connected together. I then proceeded to solder the negative wire (black wire coming out of board), to the yellow wire on the left. Now all my components which need to be connected to negative, are actually connected to the negative wire (which will later be connected to the battery). Likewise for the positive side I used the red wire (on the rightmost column) to join the transistor and potentiometer. I then soldered the top of that wire to the positive wire (yellow wire coming out of board).
Designing a Box on CAD
I designed a box to fit my perf board in. I used Autodesk Fusion 360. The box is 23mm (Height) x 52mm (Width) x 72mm (Length). The base of the lid follows the same width and length, with a height of 5mm; and the inner part of the lid is 2mm (Height) x 45.225mm (Width) x 69.225mm (Length). Next, I added a photo of my perf board and laid it on the same face as the top of the box (as displayed in the photo above), and lowered the transparency. This allowed me to trace a hole where the potentiometer is (4mm radius), where the LED is (3mm radius), and where the LDR is (3mm radius). Additionally, I placed a hole with the radius of 6mm in the corner; this is where a switch will be added.
I have added my box, and lid if you would like to just use that instead.
3D Printing the Box and Lid
First, you select the whole body of the box (not including the lid). Then you right click and press “Isolate Selection”. Next you press “Export” (this will be under “File” on the menu bar of a Mac), and you export it as a STL file. The next step is to connect you laptop to the wifi of the 3d printer, and open the application “Flash Print”. After dragging the file you just made into Flash Print, you need to make sure there is no raft on the bottom (as shown in the photo above). Then you click the “Start slicing” button. Once these steps are all complete, you are ready to press print! Press the button on the top right (the one circled in pink). When the box has finished printing, repeat these same steps for printing the lid. If the lid and box are in the same file, you may need to right click the box, and press "unisolate".
Assembling the Components
The negative wire coming out of the perf board is soldered to the battery holder’s black negative wire. The battery holder’s red positive wire is soldered to one side of the latch switch. The other side of the latch switch is soldered to the positive wire coming out of the perf board. This means that when you press the switch down, the circuit turns on. When the switch is up (off), the circuit is not running, meaning that the photoresistor will not detect whether its light or dark, and the LED will always remain unlighted. Additionally, I covered the battery insulated tape, as he tape helps to ensure that the batteries remain electrically isolated from other conductive elements in the circuit, as if the battery comes in contact with a conductive part of the circuit it could cause a short circuit. The final assembly is as follows: the switch is placed from top to bottom, so the switch lies above the box. The perf board goes upside down, so that the some components of the circuit can be seen through the holes. The battery is placed next, so that the base of the holder sits on the lid. Last but not least, the lid is added, and can be sealed with blu-tack from the inside. Furthermore, if desired, a cover for the potentiometer can be added on top for aesthetic purposes.
Final Product
And there you have it, a little box with a LDR circuit which follows the street light system.