This document describes a project to build an automatic street light controller. It uses a light dependent resistor (LDR) and Arduino board to sense light levels and control an LED. When the LDR senses darkness, the circuit powers an LED. In daylight, the LED turns off. This automatic system saves time and electricity compared to manual control, and ensures lights are always operated punctually. The parts list and 8 steps show how to assemble the circuit on a breadboard and program the Arduino board to read the LDR sensor and control the LED.
Separation of Lanthanides/ Lanthanides and Actinides
Project 6: Automatic Street Light Controller
1. 55
PROJECT 6 : Automatic street light Controller
What we are making
Have you ever wondered, who switches ON the street lights in evening ?
And who switches them OFF in the morning ?
At most places, a human is employed whose job is to turn the street lights
ON and OFF.
In this project, we will build a system that automatically switches
ON lights when there is darkness, and switches OFF the lights
when there is brightness !
PROJECT 6
2. Parts Required:
56Pause a moment and think how such a system will help
the society ?
Well, such a system:
- Saves time for a human. No one needs to go anywhere to operate.
- Works even when human is on a leave.
- Is always punctual.
- Saves electricity as it switches ON only when needed,
and switches OFF as soon as the Sun comes up.
PROJECT 6 : AUTOMATIC STREET LIGHT CONTROLLER
PARTS :
+ This section lists the parts you
will need to complete the project.
150
RESISTOR
LED JUMPER
WIRES
x 1 x 2 x 4 x 1
Ω LDR
3. 57Step 1:
Connect a Black jumper wire: UNO GND pin <-------> - line on Breadboard
Connect a Red jumper wire: UNO 5V pin <-------> + line on Breadboard.
PROJECT 6 : AUTOMATIC STREET LIGHT CONTROLLER
4. 58Step 2:
Take an LDR ( Light Dependent Resistor - sometimes also
called Photo-resistor).
Connect one end to 10-i.
Other end to + line on breadboard. (Just like normal Resistors,
LDR has no polarity - so you can connect any end to 10-i)
PROJECT 6 : AUTOMATIC STREET LIGHT CONTROLLER
5. 59Step 3:
Take a 150 Ohm Resistor.
Connect one end to 10-f.
Other end to Negative (-) line.
PROJECT 6 : AUTOMATIC STREET LIGHT CONTROLLER
6. 60Step 4:
Take a Yellow Jumper wire.
One end in A0 pin on UNO board.
Other end in 10-h on Breadboard
PROJECT 6 : AUTOMATIC STREET LIGHT CONTROLLER
7. 61Step 5:
Take a Green jumper wire.
One end in Pin 7 in UNO board.
Other end in 20-j on Breadboard.
PROJECT 6 : AUTOMATIC STREET LIGHT CONTROLLER
8. 62Step 6:
Take a red LED.
Connect longer side to 20-f.
Connect shorter side to 20-e.
PROJECT 6 : AUTOMATIC STREET LIGHT CONTROLLER
9. 63Step 7:
Take a 150 Ohm Resistor.
Connect one end to 20-c.
Connect other end to Negative (-) line on Breadboard.
This completes our circuit !
PROJECT 6 : AUTOMATIC STREET LIGHT CONTROLLER
10. 64Step 8:
Open Arduino software (IDE) on your computer and write below code in it:
Now press the upload button in Arduino software.
Note: Try changing the number 50 to 10 if the LED is always ON in your
room. If the LED is always OFF, then change 50 to 500 and try.
11. BINGO !!
Explanation:
65
PROJECT 6 : AUTOMATIC STREET LIGHT CONTROLLER
You should see your LED switched ON when you enter a dark room. You
can also test this by covering the top of the LDR with your fingers.
The LED should switch OFF automatically when there is
light in the room.
In order to detect the intensity of light, we use a sensor called
LDR (Light Dependent Resistor).
The LDR is a special type of resistor which allows higher current to pass
through it whenever there is a high intensity of light, and passes a low
current whenever it is dark.
12. 66
Since the LDR gives out an analog output, it is connected to the
analog input pin on the Arduino (A0 in our case).
Thus, the LDR gives out an analog output which varies in magnitude in
direct proportion to the input light intensity on it.
The greater the intensity of light, the greater the value coming
from LDR.
The Arduino, with its built-in Analog to Digital Converter, converts the
analog value coming from LDR into a digital value in the range of 0 - 1023.
This value is read by our code using the function analogRead(A0).
int sensorValue = 0; In our code, we declare a variable called
sensorValue and assign initial value 0 to it.
pinMode(7, OUTPUT); In the setup() function, we set pin 7 as OUTPUT
so that later in the program we can pass current in pin 7 to light the LED.
sensorValue = analogRead(A0);
In the loop() function, we read the value of LDR into sensorValue.
If the sensorValue is less than 50, it means its dark - so we pass
current to the LED using digitalWrite(7, HIGH).
Otherwise, we switch off the LED using digitalWrite(7, LOW)