Automatic Street Light Control System
Automatic Street Light Control System
[Link](2020102060)
[Link] PITCHAI(2020102089)
[Link](2020102102)
of
BACHELOR OF ENGINEERING
in
MARCH 2023
1
SETHU INSTITUTE OF TECHNOLOGY
(An Autonomous Institution | Accredited with ‘A’ Grade by NAAC)
PULLOOR, KARIAPATTI-626 115.
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
Dr. [Link] Mrs. [Link]
HEAD OF THE DEPARTMENT SUPERVISOR
ACKNOWLEDGEMENTS
2
First we would like to thank GOD the almighty for giving us the
talent and opportunity to complete our project and our B.E degree.
We wish to express our earned great fullness to our Honorable
Founder and Chairman, Mr. S. MOHAMED JALEEL [Link]., B.L., for his
encouragement extended us to undertake this project work.
We wish to thank and express our gratitude to our Chief Executive Officer
Mr. S. M. SEENI MOHIDEEN [Link]., M.B.A., Director-Administration, Mrs.
S. M. NILOFER FATHIMA B.E., M.B.A., Director - R & D, Dr. S. M. NAZIA
FATHIMA [Link]., M.E.,Ph.D and Joint chief executive officer, Mr. S. M.
SEENI MOHAMED ALIAR MARAIKKAYAR B.E., M.E., M.B.A.,(Ph.D) for
their support in this project.
We would like to thank and express our gratitude to our Principal,
Dr. [Link] B.E., M.E., Ph.D., for providing all necessary for
the completion of the project. We wish to thank and express our
gratitude to our Vice Principal, Dr. [Link] KUMAR B.E., M.E., Ph.D.,
for his support to our project work.
We wish to express our profound gratitude to our Head of the
Department Dr. [Link] B.E., M.E., Ph.D., for granting us the
necessary permission to proceed with our project.
We are immensely grateful to our guide, supervisor and overseer
[Link] for encouraging us a lot throughout the course of the
project. We render our sincere thanks of her support in completing this project
successfully.
We thank our Parents, Faculty Members, Supporting Staff and Friends
for their help extended during these times.
3
ABSTRACT
Street lights are a large consumer of energy in cities using upto 50% of a
city’s energy budget. The main aim of our project is to control energy
efficient LED lights on highways (like NH44 & NH47 AND ALSO LOCAL
STREETS) to turn on when needed and to remain in a dim state otherwise
according to the sensor signals. The sensors used on one side of the road,
sense the vehicle movement and send logical commands to the
microcontroller .ARDUINO UNO and the lights will be brightened. Frequent
switching of street lights, reduces its life time. And the another think is fault
detection in that fault detection has been maintained the street light . when
the street light has been damaged using wi-fi connection to intimate the area
in the mobile application (name of the mobile app is tcp client) . In that
mobile application we can saw the damaged street light in which area.
4
TABLE OF CONTENTS
SYNOPSIS
5
The project is designed to detect vehicle movement on highways to
switch ON only a block of street lights ahead of it (vehicle), and to switch
OFF the trailing lights to save energy. During night all the lights on the
highway remain ON for the vehicles. But lot of energy is wasted when there
is no vehicle movement.
High intensity discharge lamp (HID) presently used for urban street
light are based on principle of gas discharge, thus the intensity is not
controllable by any voltage reduction. White Light Emitting Diode (LED)
based lamps are soon replacing the HID lamps in street light. Sensors used
on either side of the road senses vehicle movement and sends logic
commands to microcontroller to switch ON/OFF the LEDs. Thus this way of
dynamically changing intensity ON/OFF helps in saving a lot of energy.
BLOCK DIAGRAM
6
POWER SUPPLY
LCD DISPLAY
IR SENSOR 1
LDR
DAY\NIGHT
BLOCKDIAGRAM DESCRIPTION
7
ARDUINO UNO
The ARDUINO Uno is a microcontroller board based on the ATMEGA328 .
It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack,
an ICSP header, and a reset button.
IR SENSOR
The IR Sensor Module or infrared (IR) sensor is a basic and most popular
sensor in electronics. It is used in wireless technology like remote controlling
functions and detection of surrounding objects/ obstacles. IR sensors mainly
consist of an Infrared (IR) LED
PWM DRIVER
Pulse width modulation (PWM) is a power technique for controlling
analog circuit with a processor’s digital outputs. PWM is employed in a wide
variety of application, ranging form measurement and communications to
power control and conversion
LDR DETECTOR
Light dependent resistor—photo resistor or Cadmium –Sulfide (Cds) cell. As
their name suggests, these are resistors whose resistance is a function of the
amount of light falling on them
WI-FI MODULE
8
ESP8266 is an impressive, low cost WIFI module suitable for adding WIFI
functionality to an existing microcontroller project via a UART serial
connection. The module can even be reprogrammed to act as a standalone
WIFI connected device–just add power
LCD DISPLAY
LCD is mainly used for display the information. Here we are using 2x16
LCD. Operation of the LCD is the declining prices of LCDs. The ability to
display numbers, characters, and graphics. This is in contrast to LEDs, which
are limited to numbers and characters. The LCDs are light weight with only a
few millimeters
POWERSUPPLY
This power supply circuit is designed to get regulated output DC voltage. The
0-9 volt centre tape transformer is used to step down the main voltage (230v)
into 9 volts. The secondary voltage of transformer is rectified using bridge
rectifier
CIRCUIT DIAGRAM
9
LCD1
LM016L
VDD
O\P
VSS
VEE
1 1 3
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
VI VO
E
D1 D2 D3 D4
GND
1
2
3
4
5
6
7
8
9
10
11
12
13
14
D3 D4 R1 GND C
C2 C1 470k ARDUINO UNO R9
LED
-
2
1000mf
33R D5 D6 D7 D8
100mf SIM1
LED LED LED LED
+5V C
A
R6 + D9 D10 D11 D12
BEL 100N C LED LED LED LED
33R
AREF B
13 MJE 3055
A R D U IN O
RESET 12 E B
~11
5V ~10
IR SENSOR ~9 E
S IM U L IN O
8
POW ER
GND
+5V
ATM E G A3 2 8 P
O\P 7
D IG IT A L ( P W M ~ )
~6
AT M E L
ENTRY
A N A L O G IN
A0 ~5
A1 4
A2 ~3
gnd A3 2
A4 TX > 1
A5 RX < 0
O\P [Link] RX0 esp8266 3.3v
[Link]
+5V SIMULINO UNO
EXIT TX1
LDR DETECTOR
DAY\NIGHT MODE
gnd
R7 WI-FI MODULE
10K
R2 R3 O\P
47K 10K U1
7
3 R4 Q1
6 BC547
2 4K7
LDR1 R8 R5
1.0 10K
LDR
4
1
5
10K 741
GND
LDR DETECTOR
LIGHT FAIL
R14
10K
R10 R11 O\P
47K 10K U2
7
3 R12 Q2
6 BC547
2 4K7
LDR2 R15 R13
1.0 10K
LDR
4
1
5
10K 741
GND
11
Input Voltage (limits) : 6-20V
Digital I/O Pins : 14 (of which 6 provide PWM output)
Analog Input Pins : 6
DC Current per I/O Pin :40 mA
DC Current for 3.3V Pin : 50 mA
Flash Memory : 32 KB of which 0.5 KB used by bootloader.
SRAM : 2 KB
EEPROM : 1 KB
Clock Speed : 16 MHz
The ARDUINO Uno can be powered via the USB connection or with an
external power supply. The power source is selected automatically.
12
External (non-USB) power can come either from an AC-to-DC
adapter (wall-wart) or battery. The adapter can be connected by plugging a
2.1mm center-positive plug into the board's power jack. Leads from a battery
can be inserted in the Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If
supplied with less than 7V, however, the 5V pin may supply less than five
volts and the board may be unstable. If using more than 12V, the voltage
regulator may overheat and damage the board. The recommended range is 7
to 12 volts.
The power pins are as follows:
VIN. The input voltage to the ARDUINO board when it's using an external
power source (as opposed to
5 volts from the USB connection or other regulated power source). You can
supply voltage through
this pin, or, if supplying voltage via the power jack, access it through this pin.
5V. The regulated power supply used to power the microcontroller and other
components on the
board. This can come either from VIN via an on-board regulator, or be
supplied by USB or another
regulated 5V supply.
13
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum
current draw is 50 MA.
GND. Ground pins.
MEMORY:
The Atmega328 has 32 KB of flash memory for storing code (of
which 0,5 KB is used for the boot loader); It has also 2 KB of SRAM and 1
KB of EEPROM.
INPUT AND OUTPUT
Each of the 14 digital pins on the Uno can be used as an input or
output, using pin Mode(), digital Write(), and digital Read() functions. They
operate at 5 volts. Each pin can provide or receive a maximum of 40 MA and
has an internal pull-up resistor (disconnected by default) of 20-50 k Ohms. In
addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX)Used to receive (RX) and transmit (TX) TTL
serial data. These pins are
connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial
chip .
External Interrupts: 2 and 3 These pins can be configured to trigger an
interrupt on a low value, a
rising or falling edge, or a change in value. See the attach Interrupt() function
for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog
Write() function.
14
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication, which,
although provided by the underlying hardware, is not currently included in
the ARDUINO Language.
· LED: 13. There is a built-in LED connected to digital pin 13. When the pin
is HIGH value, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground
to 5 volts, though is it possible to change the upper end of their range using
the AREF pin and the analog Reference() function. Additionally, some pins
have specialized
functionality:
· I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the
Wire library.
There are a couple of other pins on the board:
· AREF. Reference voltage for the analog inputs. Used with analog
Reference().
· Reset. Bring this line LOW to reset the microcontroller. Typically used to
add a reset button
shields which block the one on the board.
CHARACTERITICS
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches
respectively, with the USB connector and power jack extending beyond the
former dimension. Three screw holes allow the board to be attached to a
surface
15
or case. Note that the distance between digital pins 7 and 8 is 160 mil (0.16"),
not an even multiple of the 100 mil spacing of the other pins.
Features:
• High Performance, Low Power AVR® 8-Bit Microcontroller
• Advanced RISC Architecture
– 131 Powerful Instructions – Most Single Clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 20 MIPS Throughput at 20 MHz
– On-chip 2-cycle Multiplier
• High Endurance Non-volatile Memory Segments
– 4/8/16/32K Bytes of In-System Self-Programmable Flash program memory
(ATmega48PA/88PA/168PA/328P)
– 256/512/512/1K Bytes EEPROM (ATmega48PA/88PA/168PA/328P)
– 512/1K/1K/2K Bytes Internal SRAM (ATmega48PA/88PA/168PA/328P)
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C(1)
– Optional Boot Code Section with Independent Lock Bits
In-System Programming by On-chip Boot Program
16
True Read-While-Write Operation
– Programming Lock for Software Security
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and
Capture
Mode
– Real Time Counter with Separate Oscillator
– Six PWM Channels
– 8-channel 10-bit ADC in TQFP and QFN/MLF package
Temperature Measurement
– 6-channel 10-bit ADC in PDIP Package
Temperature Measurement
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Byte-oriented 2-wire Serial Interface (Philips I2C compatible)
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
– Interrupt and Wake-up on Pin Change
• Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated Oscillator
– External and Internal Interrupt Sources
– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down,
Standby,
and Extended Standby
• I/O and Packages
– 23 Programmable I/O Lines
– 28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF
17
• Operating Voltage:
– 1.8 - 5.5V for ATmega48PA/88PA/168PA/328P
• Temperature Range:
– -40°C to 85°C
• Speed Grade:
– 0 - 20 MHz @ 1.8 - 5.5V
• Low Power Consumption at 1 MHz, 1.8V, 25°C for
ATmega48PA/88PA/168PA/328P:
– Active Mode: 0.2 MA
– Power-down Mode: 0.1 ΜA
– Power-save Mode: 0.75 ΜA (Including 32 kHz RTC)
18
PIN DESCRIPTIONS
1.1.1 VCC
l supply voltage.
1.1.2 GND
Ground.
1.1.3 Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port B output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port B
pins that are externally pulled low will source current if the pull-up resistors
are activated. The Port B pins are tri-stated when a reset condition becomes
active, even if the clock is not running. Depending on the clock selection fuse
settings, PB6 can be used as input to the inverting Oscillator amplifier and
input to the internal clock operating circuit. Depending on the clock selection
fuse settings, PB7 can be used as output from the inverting Oscillator
amplifier.
If the Internal Calibrated RC Oscillator is used as chip clock source, PB7..6 is
used as TOSC2..1 input for the Asynchronous Timer/Counter2 if the AS2 bit
in ASSR is set.
1.1.4 Port C (PC5:0)
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The PC5..0 output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port C
pins that are externally pulled low will source current if the pull-up resistors
are activated. The Port C pins are tri-stated when a reset condition becomes
active, even if the clock is not running.
19
1.1.5 PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note
that the electrical characteristics of PC6 differ from those of the other pins of
Port C.
If the RSTDISBL Fuse is un programmed, PC6 is used as a Reset input. A
low level on this pin for longer than the minimum pulse length will generate
a Reset, even if the clock is not running. T Shorter pulses are not guaranteed
to generate a Reset.
20
BLOCK DIAGRAM
The AVR core combines a rich instruction set with 32 general purpose
working registers. All the 32 registers are directly connected to the
Arithmetic Logic Unit (ALU), allowing two independent registers to be
accessed in one single instruction executed in one clock cycle. The resulting
architecture is more code efficient while achieving throughputs up to ten
times faster than conventional CISC microcontrollers.
The ATMEGA following features 4/8/16/32K bytes of In- System
Programmable Flash with Read-While-Write capabilities, 256/512/512/1K
bytes
21
EEPROM, 512/1K/1K/2K bytes SRAM, 23 general purpose I/O lines, 32
general purpose working registers, three flexible Timer/Counters with
compare modes, internal and external interrupts, a serial programmable
USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-
channel 10-bit ADC (8 channels in TQFP and QFN/MLF packages), a
programmable Watchdog Timer with internal Oscillator, and five software
selectable power saving modes. The Idle mode stops the CPU while allowing
the SRAM, Timer/Counters, USART, 2-wire Serial Interface, SPI port, and
interrupt system to continue functioning. The Power-down mode saves the
register contents but freezes the Oscillator, disabling all other chip functions
until the next interrupt or hardware reset. In Power-save mode, the
asynchronous timer continues to run, allowing the user to maintain a timer
base while the rest of the device is sleeping. The ADC Noise Reduction mode
stops the CPU and all I/O modules except asynchronous timer and ADC, to
minimize switching noise during ADC conversions. In Standby mode, the
crystal/resonator Oscillator is running while the rest of the device is sleeping.
This allows very fast start-up combined with low power consumption.
22
microcontroller that provides a highly flexible and cost effective solution to
many embedded control applications.
The ATmega48PA328P AVR is supported with a full suite of program
and system development tools including: C Compilers, Macro Assemblers,
Program Debugger/Simulators, In-Circuit Emulators, and Evaluation kits
IR SENSOR MODULE
The IR Sensor Module or infrared (IR) sensor is a basic and most popular
sensor in electronics. It is used in wireless technology like remote controlling
functions and detection of surrounding objects/ obstacles. IR sensors mainly
consist of an Infrared (IR) LED and a Photodiode, this pair is generally called
IR pair. An IR LED is a special purpose LED, it is can emitting infrared rays
ranging from 700 nm to 1 mm wavelength. These types of rays are invisible
to our eyes. In contrast, a photodiode or IR Receiver LED detects the infrared
rays.
23
Pin No Pin Name Description
VCC
1 +5 v power supply
2 GND Ground (-) power supply
IR Infrared LED
3) LM393 Comparator IC
Introduction
The LM393 integrated circuit (IC) is a dual differential comparator, it
consists of two inbuilt operational amplifiers. Each comparator accepts 2
inputs for comparison. The comparator compares these two input voltages
and measure which input voltage is the larger, then it provides output. These
ICs can perform different tasks using a single power supply. Also, it can be
work perfectly by the split power supply sources.
25
LM393 Comparator IC Internal Structure
26
Pin Number Pin Name Description
1 OUTPUT1 This is the output pin of the Op-Amp 1
2 INPUT1- Inverting Input pin of Op-Amp 1
3 INPUT1+ Non-Inverting Input pin of Op-Amp 1
This is the Ground pin of the IC. it needs to connect to the
4 VEE, GND Negative(-) terminal of Supply Voltage.
5 INPUT2+ Non-Inverting Input pin of Op-Amp 2
6 INPUT2- Inverting Input pin of Op-Amp 2
7 OUTPUT2 This is the output pin of the Op-Amp 2
This is the positive pin of the IC. it needs to connect to the
8 VCC Positive(+) terminal of Supply Voltage.
Working Principle
First of all, we need to connect the power source with the Vcc and GND pin
of the LM393 IC to activate the IC. Then, we need to provide two input
voltage to the Op-Amp for comparison. Now, we can get an output from the
Op-Amp.
27
preset knob to adjust the detection distance, the effective operation range 2-
10 cm. If the preset knob rotated clockwise, the detection range will be
increased. If it rotated counterclockwise, the detection range will be
decreased.
5. Power LED:
This onboard LED indicates the IR Sensor power supply is ON or
OFF. When we turn on the IR Sensor power supply this RED LED is also
turn on.
6. Output LED:
When infrared reflected back to the IR receiver and the sensor detects
an obstacle, the green LED lights up. So, the Green LED use to indicate the
sensor senses an obstacle.
PWM DRIVER
Pulse width modulation (PWM) is a power technique for controlling
analog circuit with a processor’s digital outputs. PWM is employed in a wide
variety of application, ranging form measurement and communications to
power control and conversion
In a nutshell, PWM is a way of digitally encoding analog signal levels.
Through the use of high-resolution counters. The duty cycle of a square
wave is modulated encode a specific analog signal level. The PWM signal is
still digital because, at any given instant of time, the full DC supply is either
fully on or fully off. The voltage or current source is supplied to the analog
load by means of a repeating series on and off pulses. The on-time is the time
during which the DC supply is applied to the load, and the off-time is the
period during which the supply is switched off. Given a sufficient
bandwidth, any analog value can be encoded with PWM.
28
BASIC HARDWARE CONTROLLERS:
Many microcontrollers include on-chip PWM units. For example,
Microchip’s PIC includes two, each of which has a selectable on-time and
period. The duty cycle is the ratio of the on-time to the period; the
modulating frequency is the inverse of the period. To start PWM operation,
the data sheet suggests the software should
Set the period in the on-chip timer /counter that provides the
modulating square wave
Set the on-time in the PWM control register
Set the direction of the PWM output, which is one of the general-
purpose I/O pins
Start the timer
Enable the PWM controller
Although specific PWM controllers do vary in their programmatic details,
the basic idea is generally the same.
29
PWM DRIVER
O\P
D14
LED
R16
33R
C
I\P
BEL 100N C
B
E B
30
communications channel dramatically. At the receiving end, a suitable RC
(resistor – capacitor) or LC (inductor-capacitor) network can remove the
modulating high frequency square and return the signal to analog form.
PWM finds application in a variety of systems. As a concrete
example, consider a PWM controller brake. A brake is a device that clamps
down hard on something. In many brakes, the amount of clamping pressure
(or stopping power) is controlled with an analog input signal. The more
voltage or current that’s applied to the brake, the more pressure the brake will
exert.
The output of a PWM controller could be connected to a switch
between the supply and the brake. To produce more stopping power, the
software between only increase the duty cycle of the PWM output. If a
specific amount of braking pressure is desired, measurements would need to
betaken to determine the mathematical relationship between duty cycle and
pressure. (And the resulting formulae or lookup tables would be tweaked for
operating temperature, surface wear, and so on).
To set the pressure on the brake to, say 100 psi, and the software would do a
reverse lookup to determine the duty cycle that should produce that amount
of force. It would then set the PWM duty cycle to the new value and the
brake would respond accordingly. If a sensor is available in the system, the
duty cycle can be tweaked, under closed loop control, until the desired
pressure is precisely achieved
LIGHT DETECTOR
Light sensor is LDR. Here we are using a light sensor which senses the
light level emitted from the machines (spark). The output of this sensor is
compared with a comparator circuit. The output signal is given to
microcontroller.
31
+5V
10K 10K
47K
741
O /P
7
2 4K7
-
6
3 BC 547
+
LD R
4
10K
10K
G ND
32
A photo resistor or light dependent resistor or cadmium sulfide (CdS) cell is a
resistor whose resistance decreases with increasing incident light intensity. It
energy to jump into the conduction band. The resulting free electron (and its
hole partner) conduct electricity, thereby lowering resistance.
APPLICATION
meters, street lights, clock radios, alarms, and outdoor [Link] are also
used in some dynamic compressors together with a small incandescent lamp or
light emitting diode to control gain reduction.
33
Lead sulfide and indium antimonide LDRs are used for the mid infrared spectral
WI-FI MODULE
ESP8266 is an impressive, low cost WIFI module suitable for adding
WIFI functionality to an existing microcontroller project via a UART serial
connection. The module can even be reprogrammed to act as a standalone
WIFI connected device–just add power!
The feature list is impressive and includes:
o 802.11 b/g/n protocol
o Wi-Fi Direct (P2P),
o Soft-AP Integrated TCP/IP protocol stack.
The hardware connections required to connect to the ESP8266 module
are fairly straight-forward but there are a couple of important items to note
related to power:
The ESP8266 requires 3.3V power–do not power it with 5 volts! The
ESP8266 needs to communicate via serial at 3.3V and does not have 5V
tolerant inputs, so you need level conversion to communicate with a 5V
34
microcontroller like most Arduino use. However, if you’re adventurous and
have no fear you can possibly get away with ignoring the second
requirement.
Introduction
ESPRESSIF Systems’ Smart Connectivity Platform (ESCP) is a set of
high performance, high integration wireless SOCs, designed for space and
power constrained mobile platform designers. It provides unsurpassed ability
to embed WIFI capabilities within other systems, or to function as a
standalone application, with the lowest cost, and minimal space requirement.
ESP8266EX offers a complete and self-contained WIFI networking
solution; it can be used to host the application or to offload WIFI networking
functions from another application processor. When ESP8266EX hosts the
application, it boots up directly from an external flash. In has integrated
cache to improve the performance of the system in such applications.
Alternately, serving as a WIFI adapter, wireless internet access can be added
to any micro controller based design with simple connectivity (SPI/SDIO or
I2C/UART interface). ESP8266EX is among the most integrated WIFI chip
35
in the industry; it integrates the antenna switches, RF balun, power amplifier,
low noise receive amplifier, filters, power management modules, it requires
minimal external circuitry, and the entire solution, including front-end
module, is designed to occupy minimal PCB area. ESP8266EX also
integrates an enhanced version of Tensilica’s L106 Diamond series 32-bit
processor, with on-chip SRAM, besides the WIFI functionalities.
ESP8266EX is often integrated with external sensors and other application
specific devices through its GPIOs; sample codes for such applications are
provided in the software development kit (SDK).
36
• Deep sleep power < 5Ua
• Wake up and transmit packets in < 2ms
• Standby power consumption of < 1.0mW (DTIM3)
• +20 dBm output power in 802.11b mode
• Operating temperature range -40C ~ 125C
• FCC, CE, TELEC, WiFi Alliance, and SRRC
LED
A light-emitting diode is like a standard diode in the fact that electrical
current only flows in one direction. The main difference is an LED will emit
light when electricity flows through it. Inside an LED there is an anode and
cathode. Current always flows from the anode (+) to the cathode (-) and
never in the opposite direction. The longer leg of the LED is the positive
(anode) side.
LCD DISPLAY
LCD is mainly used for display the information. Here we are using
2x16 LCD. Operation of the LCD is the declining prices of LCDs. The
ability to display numbers, characters, and graphics. This is in contrast to
LEDs, which are limited to numbers and characters. The LCDs are light
weight with only a few millimeters thickness. Since the LCDs consume less
power, they are compatible with low power electronic circuits, and can be
powered for long durations. The LCDs don’t generate light and so light is
37
needed to read the display. By using backlighting, reading is possible in the
dark. The LCDs have long life and a wide operating temperature range.
Liquid Crystal Displays (LCDs) have materials which combine the properties
of both liquids and crystals. Rather than having a melting point, they have a
temperature range within which the molecules are almost as mobile as they
would be in a liquid, but are grouped together in an ordered from similar to a
crystal.
An LCD consists of two Glass Panels, with the liquid crystal material
sandwiched in between them. The inner surface of the Glass plates is coated
with transparent electrodes which define the character, symbols or patterns to
be displayed. Polymeric layers are present in between the electrodes and the
liquid crystal, which makes the liquid crystal molecules to maintain a defined
orientation angle. One each polarizer’s are pasted outside the two Glass
Panels. This polarizer’s would rotate the light rays passing through them to a
definite angle, in a particular direction .When the LCD is in the off-state,
light rays are rotated by the two polarizer’s and the Liquid Crystal, such that
the light rays come out of the LCD without any orientation, and hence the
LCD appears transparent. When sufficient voltage is applied to the
electrodes, the Liquid Crystal molecules would be aligned in a specific
direction. The light rays passing through the LCD would be rotated by the
polarizer’s, which would result in activating / high lighting the desired
characters. The LCDs are light weight with only a few millimeters thickness.
Since the LCDs consume less power, they are compatible with low power
electronic circuits, and can be powered for long durations.
The LCDs don’t generate light and so light is needed to read the
display. By using backlighting, reading is possible in the dark. The LCDs
have long life and a wide operating temperature range. Changing the display
size or the layout size is relatively simple which makes the LCDs more
customers friendly. The LCDs used exclusively in watches, calculators and
38
measuring instruments are the simple seven – segment displays, having a
limited amount of numeric data. The recent advances in technology have
resulted in better legibility, more information displaying capability and a
wider temperature range. These have resulted in the LCDs being extensively
used in telecommunications and entertainment electronics. The LCD s has
even started replacing the Cathode Ray Tubes (CRTs) used for the display of
text and graphics, and also in small TV [Link] is mainly used for
display the information. Here we are using 2x16 LCD. Operation of the LCD
is
The declining prices of LCDs.
The ability to display numbers, characters, and graphics. This is in
contrast to LEDs, which are limited to numbers and characters.
Incorporation of a refreshing controller into the LCD, thereby relieving
the CPU of the task of refreshing the LCD. In contrast, the LED must be
refreshed by the CPU to keep displaying the data.
Ease of programming for characters and graphics.
BLOCK DIAGRAM
CONTROLLER
16
E
LCD
R/W
RS 40 40
TO
D7
4 DRIVER
VDD
VL
VSS
39
LCD PIN DESCRIPTIONS
VCC, VSS, and VL (PIN 1 to 3):
While VSS provide Ground Terminal, OV. VCC provide Supply
Terminal, +5. VL is a Liquid Crystal Drive Voltage
RS, register select PIN 4):
There are two very important registers inside the LCD. The RS pin is
used for their selection as follows. If RS=0 the instruction command code
register is selected, allowing the user to send a command such as clear
display, cursor at home, etc. if RS=1d the data register is selected, allowing
the user to send data to be displayed on the LCD.
R/W read or write (PIN 5):
R/W input allows the user to write information to the LCD or read
information from it. R/W =1 when reading; R/W=0 when writing.
E, enable (PIN 6):
The enable pin is used b y the LCD to latch information presented to
its data pins. When data is supplied to data pins, high-to-low pulses must be
applied to this pin in order for the LCD to latch in the present at the data pins.
This pulse is a minimum of 450 ns wide.
D0 – D7 (PIN 7 to 14):
The 8 bit data pins, d0 – d7, are used to send information to the LCD or
read the contents of the LCD’s internal registers. Bi-directional data-bus.
When interface data length is 8-bits, data transfer is done once through DB0-
DB7, when the interface data length is 4-bits, data transfer is done twice
through DB4 – DB7
BACKLIGHT (PIN 15 & 16):
In case of 15 Pin Modules, Pin 15 Is the Supply Voltage (+5V) for
the LED. In case of 16 pin Modules, Pin 15 is the Ground (0V) and Pin 16 is
the Supply voltage (+5V) for the LED.
40
Crystal Oscillator:
41
IMAGE OF LCD DISPLAY
The read and Write strobes of the Host, which provides the ‘E’
signal, should not be linked to the Module‘s R/W line. An address bit,
which sets up earlier in the Host Machine Cycle, can be used as R/W.
When the Host Processor is so fast that the strobes are too narrow to
serve as the ‘E’ pulse.
For 4-bit data interface, the bus lines DB4 to DB7are used for
data transfer, while DB0 to DB3 lines are disabled. The data transfer
is complete when the 4-bit data has been transferred twice. The Busy
flag must be checked after the 4-bit data has been transferred twice.
Two more 4-bit operations then transfer the Busy Flag and Address
Counter Data.
For 8-bit data interface, all eight-bus lines (DB0 to DB7) are
used.
A liquid crystal display (LCD) is a thin, flat panel used for electronically
displaying information such as text, images, and moving pictures. Its uses
include monitors for computers, televisions, instrument panels, and other
devices ranging from aircraft cockpit displays, to every-day consumer
devices such as video players, gaming devices, clocks, watches, calculators,
and telephones. Among its major features are its lightweight construction, its
portability, and its ability to be produced in much larger screen sizes than are
practical for the construction of cathode ray tube (CRT) display technology.
Its low electrical power consumption enables it to be used in battery-powered
electronic equipment. It is an electronically-modulated optical device made up of
any number of pixels filled with liquid crystals and arrayed in front of a light
source (backlight) or reflector to produce images in color or monochrome. The
43
POWERSUPPLY
Most electronic circuits require DC voltage sources or power
supplies. If the electronic device is to be portable, then one or more
batteries is usually needed to provide the DC voltage required by
electronic circuits. But batteries have a limited life span and cannot be
recharged. The solution is to convert the alternating current lose hold
line voltge to a DC voltage source.
44
Three important specifications are the secondary winding, power rating and
the regulation factor.
Rectifiers :
A rectifier circuit convertsan AC voltage into a pulsating DC voltage.
This is accomplished by using one or more diodes because diodes conduct
current in only one direction.
Types :
Half-wave Rectifier :
The transformer (T1) isolates the household voltage and also steps
down the household voltage to a more useful voltage level. The diode lets
current flow into the load in only one direction. The load current is
unidirectional; therefore, it has a significant dc component(or average value).
When V2 is positive, diode D1 conducts and V L=V2. when V2 is negative ,
diode D1 blocks the current flow and VL=0volts. The load voltage consist of
dc voltage along with ripple voltage. In a half-wave rectifier circuit, the
ripple component is lager than the DC component, which is undesirable.
USEFUL FORMULAS:
VAVG(DC) = 0.637V2
VL(DC) = 0.318V2
VL(AC) = 0.386V2
%RIPPLE = VL(AC)/VL(DC) = 121%
RIPPLE FREQUENCY = SUPPLY FREQUENCY
Full-wave Rectifier :
The full wave rectifier circuit requires a transformer with two
secondary windings. i.e. a center-tapped secondary winding.
45
negative. Diode D2 contacts when V2b is positive and does not conduct when
V2b is negative. One of the two diodes is conducting at all times because V2a
and V2b are 180 out of phase and thus producing full-wave rectified voltage.
In the Full wave rectifier, Dc component is larger than ripple.
USEFUL FORMULAS:
VL (DC) = 0.637V2
VL (AC) = 0.307V2
%RIPPLE = VL (AC)/VL(DC) = 48.2%
RIPPLE FREQUENCY = 2 x SUPPLY FREQUENCY
Full-wave bridge rectifier :
The full-wave bridge rectifier circuit requires four diodes. The
transformer has only one secondary winding.
When V2 is positive, diodes D1 & D3 conduct current through the
load. Diodes D2 and D4 block current flow. When V2 is negative,
diodes D2 and D4 conduct current through the load. Diodes D1 and
D3 block current flow. The full-wave bridge rectifier fully utilizes the
transformer winding during both half cycles.
USEFUL FORMULAS:
VL(DC) = 0.637V2
VL(AC) = 0.307V2
%RIPPLE = VL(AC)/VL(DC) = 48.2%
RIPPLE FREQUENCY = 2 x SUPPLY FREQUENCY
Filters:
The 121% ripple in the output of the half-wave rectifier and 48% in the
full-wave rectifier is more than can be normally tolerated. In the full wave
filtering, wherein the frequency of the ripple is 100Hz for a 50Hz ac line
voltage. This is an advantage where either an inductor is used to prevent the
passage of the ripple current(due to its high inductive reactance to ac but
46
quite low resistance to dc), or a capacitor is used to ‘short’ the ripple to
ground but leave the dc to appear at the output. Various combinations of L
and C are also used.
Regulators :
The simplest regulator is a large capacitor in parallel with the load. The
capacitor stores DC voltage while the load voltage increases to its peak value.
The capacitor converts the pulsating DC voltage of a rectifier into a smooth
Dc load voltage.
Two important parameters of a capacitor regulator are its working voltage
and its capacitance. The working voltage must be at least equal to no-load
output voltage of power supply. The capacitance determines the amount of
ripple that appears on the Dc output when current is drawn from the circuit.
The amount of ripple decreases with increase in capacitance.
Capacitance regulator circuit :
L-regulator circuit :
This circuit consists of a series inductor and a capacitance in parallel with
load. The L-regulator is often used in high-power DC supplie
MC 7800 and 7900 Regulators standard application circuit:
The Mc 7800 is a 3 terminal, positive, fixed voltage integrated
circuit regulator. These regulators employ internal current limiting,
thermal shutdown and safe area compensation. The Mc 7900 is a 3
terminal, negative, fixed voltage integrated circuit regulator.
47
Block diagram of Mc 7800 and Mc7900 regulator:
The unregulated input voltage is fed to the control element and the reference
voltage. The output voltage is sampled and fed into one of the error amplifier
inputs. The other error amplifier input connected to the reference voltage.
When the error amplifier senses a difference between the reference and
sampling voltages it acts upon the control element to correct the error by
dropping a greater portion of the input voltage across the control element.
The control element is a transistor which acts as a variable resistor, in which
the resistance is controlled by the error amplifier.
The input voltage however must not be large enough to exceed the
regulator power dissipation specification. Both series have an internal
protection circuit, a current limiting circuit, and a safe-area protection circuit.
The safe-area protection circuit limits the regulator output voltage when the
input voltage is too higher ensuring that the pass transistor control element
operates within its allowed voltage and current ranges
48
CIRCUIT DIAGRAM
7805
1 3 +5V
2
IN4007 IN4007 470E
STEP DOWN
TRANSFORMER
1000MF/25V 100MF/25V +
0.1MF
0-230V 0-9V
IN4007
IN4007
RED
50
PCB in the solution for about 20 minutes occasionally altering the solution by
giving the seesaw reaction to the disk storing reduces the etching time.
Observe the changing color on the copper surface. Take out the PCB only
when the unpainted portion of the copper surface is completely dissolved in
the solution wash the PCB with the water. After the PCB is thoroughly
washed remove the paint by soft pieces of the cloth dipped in thinner or
turpentine.
5. DRILLING OF HOLES:
Then take a drilling machine with 1/32 drill bit to make holes for the
incretion of the components use 1/18 drill bit for inset wires and other thick
components. Now the PCB is ready to use.
ADVNTAGES:
1. Reliability in operation and low cost.
2. Space required becomes less.
DISADVANTAGES:
It can’t withstand larger weight such as transformer.
6. MATERIAL REQUIRED:
Copper clad sheet [It is made of hylam or nylon board over which the
sheet of copper is pressed.]
“Paint or “Nail polish” or even “PCB Ink”.
Painting brush, tray.
Ferric chloride solution and also few drop of dilute HCL or H2SO4.
Thinner or kerosene or petrol.
Cotton cloth.
Trace paper.
51
SOLDERING
SOLDERING
Solder is an alloy of tin and lead used for using metals relatively low
temperature about 260-315k the point where two metal conductors are to be
fused is heated and then solder is applied so that it can melt and cover the
connection. The reason for soldering connection is that it makes a good
blend between the joined metals.
Covering the joint completely is to prevent oxidation. The coating of
solder provides protection for practically an in definitive period of time. The
trick in soldering is to heat the joint, not the solder. When the joint is not
enough to melt the solder the cracks, forming a shifty cover without until the
solder has set, which takes only a few seconds. Either a soldering gun can be
used, rated at 25-10,000. The gun is convenient for the intermittent
operation, since it heats almost instantaneously when for press the trigger.
The small pencil iron of 25-4,000 is helpful or small connections where
excessive heat can cause damage. This precaution is particularly important
when working on PCB boards, where too much heat can soften the plastic
form and loosen the printed writing, a soldering iron for F&T devices should
have the tip ground to eliminate static charge.
The three grades of solder, generally used for electronics work are 40-60, 50-
50, 60-40 solder. The 60-40 solders costs more but it melts at the lowest
temperature flows more freely takes less time to harder, and generally makes
it easier to do a soldering [Link] addition to the solder there must be flux to
move any oxide film on the metals being joined otherwise they cannot fuse.
The flux enables the molten solder to wet the metals so that the solder can
stick. The two types are acid flux and rosin flux. Acid flux is more active in
52
cleaning metals but is corrosive. Rosin flux is always used for the light
soldering work in making wire
APPLICATIONS:
Shopping Malls
Parking area
Restaurants
Recreation Areas
House hold Applications
Industries,
Banks,
Office,
Highways
53
WORKING OF THE PROJECT
54
CONCLUSION
This project on ”AUTOMATIC STREET LIGHT WITH FAULT
DETECTION & LOCATION TRACKING” is working fire, getting the
parameter envisaged during the conceptual stage. During the design, as well
as during the construction, greater care has been put in to avoid hiccups at the
final stage. The PCB layouts were prepared with at most care to incorporate
the circuits in a modular manner. The circuit is made as simple as to our
knowledge. Also components and cost. It was a very interesting process of
developing the prototype, stage by stage and testing the same. We have to go
through fairly large pages of data related to the components etc. It was a
useful and fulfilling assignment to get the project completed in time. This
gave as a sense of satisfaction and accomplishment
PROGRAM:
/*
STREET LIGHT THAT GLOWS ON VEHICLE DETECTION ENERGY
SAVER SYSTEM with Fault Identification
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
55
*/
int sensor1Value = 0;
int sensor2Value = 0;
int ldrValue = 0;
int fault_detect_ldrValue = 0;
void setup()
{
[Link](115200); // Setting the baud rate of IoT Module
delay(100);
// set up the LCD's number of columns and rows:
[Link](16, 2);
// Print a message to the LCD.
[Link](0, 0);
[Link](" STREET LIGHT ");
[Link](0, 1);
[Link](" ENERGY SAVER ");
delay(2000);
pinMode(sensor1Pin, INPUT);
pinMode(sensor2Pin, INPUT);
pinMode(ldrPin, INPUT);
pinMode(fault_detect_ldrPin, INPUT);
56
analogWrite(pwmPin, 0);
[Link]();
[Link](0,0);
[Link](" WiFi ");
[Link](0,1);
[Link]("Initialising....");
delay(1000);
wificonfig();
delay(3000);
[Link]();
}
void loop()
{
Start:
ldrValue = analogRead(ldrPin);
delay(100);
[Link](0, 0);
[Link]("STREET LIGHT OFF");
[Link](0, 1);
[Link]("DAY; ");
delay(500);
goto Start;
}
analogWrite(pwmPin, 50);
delay(100);
57
ScanIr:
[Link]("AT+CIPSEND=0,24");
delay(500);
[Link](" ");
[Link]();
delay(1000);
sensor1Value = analogRead(sensor1Pin);
sensor2Value = analogRead(sensor2Pin);
ldrValue = analogRead(ldrPin);
fault_detect_ldrValue = analogRead(fault_detect_ldrPin);
delay(100);
[Link]("AT+CIPSEND=0,62");
delay(500);
58
[Link]("AT+CIPSEND=0,64");
delay(500);
analogWrite(pwmPin, 255);
delay(500);
}
if((sensor1Value < 250) && (sensor2Value > 800) && (ldrValue < 100))
{
[Link](0, 0);
[Link]("STREET LIGHT ON ");
[Link](0, 1);
[Link]("NIGHT;OBJECT OUT");
delay(100);
analogWrite(pwmPin, 50);
delay(100);
goto Jump;
}
Jump:
delay(100);
}
59
goto Start;
}
BIBLIOGRAPHY
PROCESS DATA HAND BOOK
WRITTEN BY : MALVINO
60