Automatic Street Lights On Motion Control: A Project Report On
Automatic Street Lights On Motion Control: A Project Report On
PROJECT REPORT
On
AUTOMATIC STREET LIGHTS ON MOTION CONTROL
MINI PROJECT
Submitted by
M.TANUSREE 1602-17-734-51
Department of
TELANGANA
1
INDEX
S.NO CONTEXT
PAGE.NO
1 INTRODUCTION 3
2 COMPONENTS 4
2.1 HARDWARE REQUIREMENT
2.2.2 LEDs 6
2.2.4 Resistor 7
2.2.5 LDR 7
2.2.6 Battery 7
3 Block Diagram 14
4 Designing Methodology 15
5 Working 16
6 Result 16
7 Application 17
8 Conclusion 18
9 References 18
2
I
INTRODUCTION
Automation systems are being preferred over the manual mode because it
reduces the use of energy to saves energy. These automation systems play an
essential role in making our daily life more comfortable and facilitate users from
ceiling fans to washing machines and in other applications. Among all exciting
applications, street lights play a vital role in our environment and also plays a critical
role in providing light for safety during night-time travel. In this scenario, when the
street lights are in working functionality over the whole night that consumes a lot of
energy and reduces the lifetime of the electrical equipment such as electric bulb etc.
Especially in cities’ streetlights, it is a severe power consuming factor and also the
most significant energy expenses for a city. In this regard, an intelligent lighting
control system can decrease street lighting costs up to 70% and increase the
durability of the equipment.
The traditional lighting system has been limited to two options ON and OFF only, and it
is not efficient because this kind of operations meant power loss due to continuing
working on maximum voltage. Hence, wastage of power from street lights is one of the
noticeable power loss, but with the use of automation, it leads to many new methods
of energy and money saving. In this regard, controlling lighting system using Light
Dependent Resistor (LDR), IR obstacle detector sensor and Arduino together is
proposed in the past.
3
II
COMPONENTS
2.1 HARDWARE REQUIREMENTS:
Components Specifications
1. Battery Voltage: 8V
Arduino board can be powered by using the USB cable from your computer. All you need to do
is connect the USB cable to the USB connection (1).
Arduino boards can be powered directly from the AC mains power supply by connecting it to
the Barrel Jack (2).
Voltage Regulator
The function of the voltage regulator is to control the voltage given to the Arduino board and
stabilize the DC voltages used by the processor and other elements.
Crystal Oscillator
The crystal oscillator helps Arduino in dealing with time issues. How does Arduino calculate
time? The answer is, by using the crystal oscillator. The number printed on top of the Arduino
crystal is 16.000H9H. It tells us that the frequency is 16,000,000 Hertz or 16 MHz.
Arduino Reset
You can reset your Arduino board, i.e., start your program from the beginning. You can reset
the UNO board in two ways. First, by using the reset button (17) on the board. Second, you can
connect an external reset button to the Arduino pin labelled RESET (5).
4
Pins
Most of the components used with Arduino board works fine with 3.3 volt and 5 volt.
GND (8)(Ground) – There are several GND pins on the Arduino, any of which can be used to
ground your circuit.
Vin (9) – This pin also can be used to power the Arduino board from an external power source,
like AC mains power supply.
Analog pins
The Arduino UNO board has six analog input pins A0 through A5. These pins can read the signal
from an analog sensor like the humidity sensor or temperature sensor and convert it into a
digital value that can be read by the microprocessor.
Main microcontroller
Each Arduino board has its own microcontroller (11). You can assume it as the brain of your
board. The main IC (integrated circuit) on the Arduino is slightly different from board to board.
The microcontrollers are usually of the ATMEL Company. You must know what IC your board
has before loading up a new program from the Arduino IDE. This information is available on the
top of the IC. For more details about the IC construction and functions, you can refer to the
data sheet.
ICSP pin
Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino consisting of MOSI,
MISO, SCK, RESET, VCC, and GND. It is often referred to as an SPI (Serial Peripheral Interface),
which could be considered as an “expansion” of the output. Actually, you are slaving the output
device to the master of the SPI bus.
This LED should light up when you plug your Arduino into a power source to indicate that your
board is powered up correctly. If this light does not turn on, then there is something wrong
with the connection.
TX and RX LEDs
On your board, you will find two labels: TX (transmit) and RX (receive). They appear in two
places on the Arduino UNO board. First, at the digital pins 0 and 1, to indicate the pins
responsible for serial communication. Second, the TX and RX led (13). The TX led flashes with
different speed while sending the serial data. The speed of flashing depends on the baud rate
used by the board. RX flashes during the receiving process.
Digital I/O
The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM (Pulse Width
Modulation) output. These pins can be configured to work as input digital pins to read logic
values (0 or 1) or as digital output pins to drive different modules like LEDs, relays, etc. The pins
labeled “~” can be used to generate PWM.
5
AREF
AREF stands for Analog Reference. It is sometimes, used to set an external reference voltage
(between 0 and 5 Volts) as the upper limit for the analog input pins.
2.2.2 LEDs
A LED (light-emitting diode) is a PN junction diode which is used for emitting visible light
when it is activated, as presented in Fig. 4. When the voltage is applied over its elements,
electrons regroup with holes within the LED, releasing energy in the form of photons which
gives the visible light. LEDs may have the Dim/full capability.
6
IR obstacle detector sensor diagram and working
2.2.4 Resistors
A resistor is a passive electronic component, used with other electronic components such as
LEDs and sensors to prevent or limit the flow of electrons through them as illustrated in Fig.
6. It works on the principle of Ohm’s law which prevent overflow of voltage.
7
2.3 SOFTWARE REQUIREMENTS:
Step 1 – First you must have your Arduino board (you can choose your favorite board) and a
USB cable. In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega 2560, or
Diecimila, you will need a standard USB cable (A plug to B plug), the kind you would connect to
a USB printer .
USB Cable
You can get different versions of Arduino IDE from the Download page on the Arduino Official
website. You must select your software, which is compatible with your operating system
(Windows, IOS, or Linux). After your file download is complete, unzip the file.
8
The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw power from
either, the USB connection to the computer or an external power supply. If you are using an
Arduino Diecimila, you have to make sure that the board is configured to draw power from the
USB connection. The power source is selected with a jumper, a small piece of plastic that fits
onto two of the three pins between the USB and power jacks. Check that it is on the two pins
closest to the USB port.
Connect the Arduino board to your computer using the USB cable. The green power LED
(labeled PWR) should glow.
After your Arduino IDE software is downloaded, you need to unzip the folder. Inside the folder,
you can find the application icon with an infinity label (application.exe). Double-click the icon to
start the IDE.
9
Open Project
Here, we are selecting just one of the examples with the name Blink. It turns the LED on and off
with some time delay. You can select any other example from the list.
To avoid any error while uploading your program to the board, you must select the correct
Arduino board name, which matches with the board connected to your computer.
Select Board
Here, we have selected Arduino Uno board according to our tutorial, but you must select the
name matching the board that you are using.
Select the serial device of the Arduino board. Go to Tools → Serial Port menu. This is likely to
be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find
out, you can disconnect your Arduino board and re-open the menu, the entry that disappears
should be of the Arduino board. Reconnect the board and select that serial port.
10
Serial Port
Before explaining how we can upload our program to the board, we must demonstrate the
function of each symbol appearing in the Arduino IDE toolbar.
Upload program
F – Serial monitor used to receive serial data from the board and send the serial data to the
board.
Now, simply click the “Upload” button in the environment. Wait a few seconds; you will see the
RX and TX LEDs on the board, flashing. If the upload is successful, the message “Done
uploading” will appear in the status bar.
11
2.3.1 PROGRAM CODE
//int led = 2;
int led1 = 3;
int led2 = 4;
int led3 = 5;
int led4 = 6;
//intldr = A5;
//intir = A0;
void setup()
Serial.begin (9600);
//pinMode (led,OUTPUT);
pinMode (led1,OUTPUT);
pinMode (led2,OUTPUT);
pinMode (led3,OUTPUT);
pinMode (led4,OUTPUT);
//pinMode (ldr,INPUT);
//pinMode (ir,INPUT);
pinMode (ir1,INPUT);
pinMode (ir2,INPUT);
pinMode (ir3,INPUT);
pinMode (ir4,INPUT);
void loop()
//Serial.println(analogRead(A5));
12
//if (ldrStatus<=500)
//{
//digitalWrite(led, HIGH);
// analogWrite(led,255/5);
//digitalWrite(led1, HIGH);
//analogWrite(led1,255/5);
// digitalWrite(led2, HIGH);
// analogWrite(led2,255/5);
//digitalWrite(led2, HIGH);
//analogWrite(led2,255/5);
if (analogRead(A0)<300) // IR 1 CODE
digitalWrite(led1,HIGH);
analogWrite(led1,255);
Else
digitalWrite(led1,LOW);
analogWrite(led1,0);
If (analogRead(A1)<300) // IR 1 CODE
digitalWrite(led2,HIGH);
analogWrite(led2,255);
Else
digitalWrite(led2,LOW);
analogWrite(led2,0);
13
}
If (analogRead(A2)<300) // IR 2 CODE
digitalWrite(led3,HIGH);
analogWrite(led3,255);
Else
digitalWrite(led3,LOW);
analogWrite(led3,0);
If (analogRead(A3)<300) // IR 2 CODE
digitalWrite(led4,HIGH);
analogWrite(led4,255);
Else
digitalWrite(led4,LOW);
analogWrite(led4,0);
3 BLOCK DIAGRAM
For the simplicity of discussion, illustrates the overall working mechanism and the
features of the proposed lighting concept. Firstly, LDR will sense the intensity value of
sunlight and send it to Arduino. Arduino will judge if the received value is above the
threshold level (which is set independently by the user from the discrete value: 0-2023), then
it will consider it as daytime and LEDs will remain OFF, or if the received value below the
threshold level, Arduino will consider it as a night-time. In the night-time, if the value of IR
14
obstacle detector sensor is LOW and detects no object, then DIM LEDs (half of its maximum
voltage) will glow, or if IR obstacle detector value is HIGH and detects any object, then HIGH
LEDs (full of its maximum voltage) will glow. Arduino will also count the total number of
vehicles that crossed the street in the nighttime with the help of IR obstacle detection sensor
and will demonstrate it to the serial monitor.
4 DESIGNING METHODOLOGY
Fig shows the circuit design of automatic street light control system based on vehicle detection
using Arduino Uno having feature of Dim light capability. In this task, 01 LDR sensor, 12 LEDs,
13 resistors, 03 IR obstacle detector sensors and 01 Arduino UNO have been used.
15
Circuit designof automatic street light control system with the Dim light capability.
One leg of LDR sensor is connected to Arduino analog pin number A0 and another leg
to VCC pin and same with a resistor to the ground port of Arduino. In addition, the threshold
value is adjusted to 10 from the discrete values (0-1023) for understanding whether it is day
or night. After that, all the positive terminals of the LEDs are connected with resistors to pin
number 3, 5, 7, 8, 9 and 11, depicting the streetlights as the outputs of the Arduino signals.
Furthermore, connected the ground of all the LED’s to Ground port as per the circuit diagram
shown in Fig. 7. The IR obstacle avoidance sensors are connected to the Arduino port from
pin number 2, 4 and 10, respectively, which is the input signal to the Arduino board. Similarly,
the ground of all the IR obstacle avoidance sensors are connected to GND port and all VCC of
IR obstacle avoidance sensors are attached to Arduino 5V pin. Initially, set the IR obstacle
avoidance sensors to HIGH at the start if there is no motion.
5 WORKING
In the beginning, the LDR sensor will sense the light intensity in the atmosphere at that time
and consequently sends the data to Arduino. After receiving the data, Arduino will convert it
into different discrete values from 0 to 1023 (In which 0 represents maximum darkness and
1023 represents maximum brightness) and then it will adjust the output voltage accordingly
from 0 to 2.5v/5v (Dim/High) depending upon the received value (0-2023) by comparing with
threshold value. So, the output will be 2.5v in the complete darkness (night time) if the
received value is less than the threshold value. As a result, Dim LEDs will glow that is the half
16
of maximum brightness, and when there is completely shine (daytime), the received value
will be higher than the threshold value, and the output voltage would be 0v resulting the
LEDs to be entirely switched OFF.
Initially, the IR obstacle detection sensor will be HIGH. So, when there is no
vehicle/obstacle in-front of the sensor, IR Transmitter does continuously transmit the IR light.
Whenever, a car or any other object blocks any of the IR sensors, then the emitted rays will
reflect the IR receiver after hitting the object, then microcontroller will sense it as a motion.
In simple words, when any object passed in front of the first IR sensor, the corresponding
LEDs will be turned from DIM to HIGH (5v) by the microcontroller. As the object moves
forward and blocks the next IR sensor, the next three LEDs will be turned to HIGH from DIM,
and the LEDs from the previous set is switched to DIM from HIGH. The process continues this
way for the entire IR obstacle detector sensors and LEDs. These kinds of application can be
implemented in the headlights of vehicles, street lights, parking lights of hotels, malls and
homes, and it can be very beneficial.
6 RESULT
Fig. shows the result diagrams of automatic streetlights that turn to DIM at night and
HIGH on vehicle movement using Arduino Uno. Fig. 8a represents the daytime with no LEDs
are glowing after measuring the sensed intensity value of sunlight with the threshold value
by the LDR sensor. In the meanwhile, Fig. 8b shows the nighttime because the sensed
intensity value of sunlight by LDR is below than the threshold value (10) and there is no
motion detected by any of IR sensors, so as a result, the DIM LEDs are glowing. Moreover, the
beauty of the proposed model can be seen in Fig. 8(c-d) with the motive that only those LEDs
will glow higher whose will detect the object’s presence and the remaining LEDs will keep
maintain their DIM state. As an example, in Fig. 8c, the first set of LEDs are glowing HIGH and
remaining are in DIM mode because the sensed intensity value of sunlight by LDR is below
then the threshold value so, it considered nighttime and, there is an object detected by the
first IR sensor. Moreover, when the object moved to the second IR obstacle detector sensor,
the second set of High LEDs are glowing and the first set again turns to DIM state (Fig. 8d).
These results show the efficiency of proposed idea and gives the immediate validation of the
17
proposed mod
Result diagramsof automatic streetlight control system that turn to DIM at night
and HIGH on object detection. (a) Shows it is a day-time, so LEDs are not glowing. (b)
Shows it is a night-time and Dim LEDs are glowing. (c) Shows object in-front of first IR
sensor and first set of High LEDs are glowing while remaining are in DIM mode. (d)
Shows motion in-front of second IR sensor so, only second set of LEDs are glowing HIGH
and others are in DIM state.
8 CONCLUSION
The proposed streetlight automation system is a cost effective and the safest way to
reduce power consumption. It helps us to get rid of today's world problems of manual
switching and most importantly, primary cost and maintenance can be decreased easily. The
18
LED consumes less energy with cool-white light emission and has a better life than high
energy consuming lamps. Moving to the new & renewable energy sources, this system can
be upgraded by replacing conventional LED modules with the solar-based LED modules. With
these efficient reasons, this presented work has more advantages which can overcome the
present limitations. Keep in mind that these long-term benefits; the starting cost would never
be a problem because the return time of investment is very less. This system can be easily
implemented in street lights, smart cities, home automation, agriculture field monitoring,
timely automated lights, parking lights of hospitals, malls, airport, universities and industries
etc.
9 References
International Journal of Innovative Research in
Computerand Communication Engineering.
19
20