You are on page 1of 59

1.

1 INTRODUCTION
OVER VIEW OF THE PROJECT
Let us imagine how amazing it would be if the street lights are controlled by IR
sensor systems. Yes, it is possible by using Embedded System Technology. Its a quite
simple task, i.e. when a person enter at the road then, the IR sensors detect the person and
street light glows automatically and gets OFF when the person cross the light. The delay
is set by using microcontroller. The design of the project is IR sensor Based STREET
LIGHT THAT GLOWS ON VEHICLE MOVEMENT does this for us.
We have designed the modern street light controllers, in which the light gets ON
automatically when the object or vehicle travels in that path, and once the object crosses
the light the present and preceding light gets ON automatically and the first light gets
OFF automatically. The object in a particular path is sensed by an IR (infrared radiation).
Each IR is connected to microcontroller AT89S52 through a potentiometer in order to set
the delay of the lights glow. This can be practically applied to street light by just
connecting outputs of microcontroller to receiving IR sensor photodiodes. The output of
IR receivers is connected to light.
The program is developed and written in KEIL IDE. First of all, the program is
debugged and tested. By using Micro Flash burner /loader /programmer, we can
dump/load the program into the chip.

Purpose
The main aim of designing this project is to save the power in the areas which are
not used frequently. Instead of glowing the street lights continuously for the whole nights
in the areas where there is very less traffic we can use the street light controllers which
saves maximum power.

1.2 EXISTING SYSTEM


Industry of street lighting systems are growing rapidly and going to complex
with rapid growth of industry and cities. Automation, Power consumption and Cost
Effectiveness are the important considerations in the present field of electronics

and electrical related technologies. To control and

maintain

complex

street

lighting system more economically, various street light control systems are
developed.

These

systems

are

developed

to

control

and reduce

energy

consumption of a town's public lighting system using different technologies.

1.3 PROPOSED SYSTEM


Automation, Power consumption and Cost Effectiveness are the important
considerations in the present field of electronics and electrical related technologies.
Industry of street lighting systems are growing rapidly and going to complex with
rapid growth of industry and cities. To control and maintain complex street lighting
system more economically, various street light control systems are developed.
These systems are developed to control and reduce energy consumption of

town's public lighting system using different technologies. The Proposed work is to
control switching of street light automatically according to light intensity to develop
flow based dynamic control statistics using infrared
maintain

detection

technology

and

wireless communication among lamppost. This proposed system utilizes

the latest technology for the sources of light as LED Lamps instead of generally
used

street lamps such as High Pressure Sodium Lamps, etc. The LED technology

is preferred as it offers several advantages over other traditional technologies like


energy saving due to high current luminous efficiency, low maintenance cost, high color
rendering index, rapid start up speed, long working life etc. This proposed system
makes use of infrared photoelectric sensor (G12-3C3PA) for vehicle detection.

2.1 BLOCK DIAGRAM

Fig 2.1 Block diagram

2.2 SCHEMATIC DIAGRAM


POWER SUPPLY UNIT

Fig 2.2 Power Supply Unit

SENSOR UNIT

Fig 2.3 Sensor Unit

CONTROLUNIT

Fig 2.4 Control Unit

WORKING
The circuit is quite simple to design as well as to understand the working of it.
The working of the circuit involves the conversion of AC supply to DC supply and this
DC supply is so regulated to the voltage required by the circuit. Then the control circuit
does the required operation as per the commands given to it. The required output can be
observed by the behavior of IR sensors. This is about the external working of the design.
The actual working involves as follows. Firstly a supply of 220vAC is given to the
circuit. This is given in order to use the equipment directly for AC application and the use
of battery is neglected. This voltage is stepped down to 12V AC by using a step down
transformer and is fed to bridge rectifier in order to convert it to DC.As the voltage
required to drive the circuit is only 5v DC, the 12V DC is regulated to 5V Dc by using a
voltage regulator (7805).This 5v Dc is required to run the microcontroller.
In the present deign there are eight IR sensors used for simple demonstration. The
supply is given to IC LM324, which contains in built OP-AMPs (four).The code is
written in such a way that the IC LM324 is used in inverting mode. And each IR sensor is
connected to micro-controller through a potentiometer in order to set the delay of the
lights glow. This can practically applied to street light by just connecting outputs of
microcontroller to transistors with help of the Darlington arrays to drive the IR receiver.
These transistors outputs are then given to the required LEDS. And once the vehicle
crosses a light the present and preceding light gets ON automatically and the first light
gets OFF automatically because of the delay given to it by the potentiometer. The LEDs
are used in the design in order check the order/patter of the street lights connected.

The main blocks of this project are

Regulated power supply (RPS)

Micro controller (AT89S52)

IR sensors

Crystal oscillator

Variable Resistor

IC LM324

LED

BC547

3.1 Regulated power supply (RPS)


Power supply is a supply of electrical power. A device or system that
supplies electrical or other types of energy to an output load or group of loads is called
a power supply unit or PSU. The term is most commonly applied to electrical energy
supplies, less often to mechanical ones, and rarely to others.
A power supply may include a power distribution system as well as primary or
secondary sources of energy such as

Conversion of one form of electrical power to another desired form and voltage,
typically involving

converting AC line

voltage

to

well-regulated

lower-

voltage DC for electronic devices. Low voltage, low power DC power supply units
are commonly integrated with the devices they supply, such as computers and
household electronics.

Batteries.

Chemical fuel cells and other forms of energy storage systems.

Solar power.

Generators or alternators.

Fig 3.1 Block diagram of RPS


The basic circuit diagram of a regulated power supply (DC O/P) with led
connected as load is shown in below figure.

Fig 3.2 Circuit diagram of RPS


The components mainly used in above figure are

230V AC MAINS

TRANSFORMER

BRIDGE RECTIFIER(DIODES)

CAPACITOR

VOLTAGE REGULATOR(IC 7805)

RESISTOR

LED(LIGHT EMITTING DIODE)


The detailed explanation of each and every component mentioned above is as

follows:

3.1.1 Step-down Transformer


A transformer is an electrical device that transfers energy from one circuit to
another purely by magnetic coupling. Relative motion of the parts of the transformer is
not required for transfer of energy. Transformers are often used to convert between high
and low voltages, to change impedance, and to provide electrical isolation between
circuits.
The transformer is one of the simplest of electrical devices. Its basic design,
materials, and principles have changed little over the last one hundred years, yet
transformer designs and materials continue to be improved. The simplicity, reliability,
and economy of conversion of voltages by transformers was the principal factor in the
selection of alternating current power transmission in the "War of Currents" in the late
1880's. In electronic circuitry, new methods of circuit design have replaced some of the
applications of transformers, but electronic technology has also developed new
transformer designs and applications.
Transformers come in a range of sizes from a thumbnail-sized coupling
transformer hidden inside a stage microphone to gig watt units used to interconnect large
portions of national power grids, all operating with the same basic principles and with
many similarities in their parts.
Transformers alone cannot do the following:

Convert DC to AC or vice versa

10

Change the voltage or current of DC

Change the AC supply frequency. However, transformers are components of the systems
that perform all these functions.
A simple transformer consists of two electrical conductors called the primary
winding and the secondary winding. If a time-varying voltage
primary winding of

is applied to the

turns, a current will flow in it producing a magneto motive force

(MMF). Just as an electromotive force (EMF) drives current around an electric circuit, so
MMF drives magnetic flux through a magnetic circuit. The primary MMF produces a
varying magnetic flux.

Fig 3.3 Step down transformer


Transformers are adapted to numerous engineering applications and may be classified in
many ways:

By power level (from fraction of a watt to many megawatts),

By application (power supply, impedance matching, circuit isolation),

By frequency range (power, audio, RF)

By voltage class (a few volts to about 750 kilovolts)

By cooling type (air cooled, oil filled, fan cooled, water cooled, etc.)

By purpose (rectifier, arc furnace, amplifier output, etc.).

By ratio of the number of turns in the coils

11

Step-up

Step-down The secondary has fewer turns than the primary.

The secondary has more turns than the primary.

3.1.2 Bridge Rectifier


A Diode bridge or bridge rectifier is an arrangement of four diodes in a bridge
configuration that provides the same polarity of output voltage for either polarity of input
voltage. When used in its most common application, for conversion of alternating current
input into direct current output, it is known as Bridge rectifier.
The essential feature of Diode Bridge is that the polarity of the output is the same
regardless of the polarity at the input. The diode bridge circuit is also known as the
Graetz circuit after its inventor, physicist Leo Graetz.

Fig 3.4 A typical bridge rectifier circuit


A Bridge rectifier provides full wave rectification from a two wire AC input,
resulting in lower cost and weight as compared to center tapped transformer design.

Fig 3.5 Current flow in the bridge rectifier


For both positive and negative swings of the transformer, there is a forward path through
the diode bridge. Both conduction paths cause current to flow in the same direction

12

through the load resistor, accomplishing full wave rectification. While one set of diodes
is forward biased, the other set is reverse biased and effectively eliminated from the
circuit.

Fig 3.6 Current flow in the bridge rectifier

DB107
Now -a -days Bridge rectifier is available in IC with a number of DB107. In our
project we are using an IC in place of bridge rectifier.

Fig 3.7 DB107

IN4007 Diode
These diodes are used to convert AC into DC these are used as half wave rectifier
or full wave rectifier. Three points must he kept in mind while using any type of diode.
1.

Maximum forward current capacity

2.

Maximum reverse voltage capacity

3.

Maximum forward voltage capacity

13

Fig 3.8 IN4007 Diode


The number and voltage capacity of some of the important diodes available in the
market are as follows:

Diodes of number IN4001, IN4002, IN4003, IN4004, IN4005, IN4006 and


IN4007 have maximum reverse bias voltage capacity of 50V and maximum
forward current capacity of 1 Amp.

Diode of same capacities can be used in place of one another. Besides this diode
of more capacity can be used in place of diode of low capacity but diode of low
capacity cannot be used in place of diode of high capacity for example, in place of
IN4002; IN4001 or IN4007 can be used but IN4001 or IN4002 cannot be used in
place of IN4007.The diode BY125made by company BEL is equivalent of diode
from IN4001 to IN4003. BY 126 is equivalent to diodes IN4004 to 4006 and BY
127 is equivalent to diode IN4007.

3.1.3 Filtration
The process of converting a pulsating direct current to a pure direct current using
filters is called as filtration.

Filters
Electronic filters are electronic circuits, which perform signal-processing
functions, specifically to remove unwanted frequency components from the signal, to
enhance wanted ones.

14

Capacitors
The Capacitor or sometimes referred to as a Condenser is a passive device, and
one which stores energy in the form of an electrostatic field which produces a potential
(static voltage) across its plates. In its basic form a capacitor consists of two parallel
conductive plates that are not connected but are electrically separated either by air or by
an insulating material called the Dielectric. When a voltage is applied to these plates, a
current flows charging up the plates with electrons giving one plate a positive charge and
the other plate an equal and opposite negative charge this flow of electrons to the plates is
known as the Charging Current and continues to flow until the voltage across the plates
(and hence the capacitor) is equal to the applied voltage Vcc. At this point the capacitor is
said to be fully charged and this is illustrated below. The construction of capacitor and an
electrolytic capacitor are shown in figures 3.9 and 3.10 respectively.

Fig 3.9 Construction Of a Capacitor

Fig 3.10 Electrolytic Capaticor


15

3.1.4 LM7805 Voltage Regulator


Voltage regulator ICs is available with fixed ( typically 5, 12 and 15v) or
variable output voltages. The maximum current they can pass also rates them. Negative
voltage regulators are available, mainly for using dual supplies. most regulators include
some

automatic

protection

from

excessive

current(overload

protection)

and

overheating(Thermal protection).
Many of the fixed voltage regulator ICs have three leads and look like power
transistors, such as the 7805 +5v, 1A regulator shown below.

Fig: 3.11 Three terminal voltage regulators

Description
The KA78XX/KA78XXA series of three- terminal positive regulator are
available in the TO-220/D-PAK package and with several fixed output voltages, making
them useful in a wide range of applications. Each type employs internal current limiting,
thermal shut down and safe operating area protection, making it essentially indestructible
.if adequate heat sinking is provided; they can deliver over 1A output current. Although
designed primarily as fixed voltage regulators, these devices can be used with external
components to obtain adjustable voltages and currents.

Features

Output current of 1.5A

16

Output voltage tolerance of 5%

Internal thermal overload protection

Internal short -circuit limited

No external component

Output voltage 5.0V,6V,8V,9V,10V,12V,15V,18V,24V

Offer in plastic TO-252,TO-220 and TO-263

Applications

Post regulator for switching DC/DC converter

Bias supply for analog circuits.

Resistors
A resistor is a two-terminal electronic component that produces a voltage across its
terminals that is proportional to the electric current passing through it in accordance with
Ohm's law:
V = IR

Ohm's law states that the voltage (V) across a resistor is proportional to the current (I)
through it where the constant of proportionality is the resistance (R).
Resistors are elements of electrical networks and electronic circuits and are
ubiquitous in most electronic equipment. Resistors can be made to control the flow of
current, to work as Voltage dividers, to dissipate power and it can shape electrical waves
when used in combination of other components. Basic unit is ohms.

Fig 3.12 Resistor

17

3.2 AT89S52 MICROCONTROLLER


Description
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with
8Kbytes of in-system programmable Flash memory. The device is manufactured using
Atmels high-density memory technology and is compatible with the industry-standard
80C51 instruction set and pin out. The on-chip Flash allows the program memory to be
reprogrammed in-system or by a conventional nonvolatile memory programmer. By
combining a versatile 8-bitCPU with in-system programmable Flash ona monolithic chip,
the Atmel AT89S52 is a powerful microcontroller which provides ahighly-flexible and
cost-effective solution to many embedded control applications The AT89S52 provides
the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines,
Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level
interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In
addition, the AT89S52 is designed with static logic for operation down to zero frequency
and supports two software selectable power saving modes. The Idle Mode stops the CPU,
while allowing the RAM, timer/counters, serial port, and interrupt system to continue
functioning. The Power-down mode saves the RAM contents but freezes the oscillator,
disabling all other chip functions until the next interrupt or hardware reset

Features

Compatible with MCS-51Products

8K Bytes of In-System Programmable (ISP) Flash Memory

Endurance: 10,000 Write/Erase Cycles

4.0V to 5.5V Operating Range

Fully Static Operation: 0 Hz to 33 MHz

Three-level Program Memory Lock

256 x 8-bit Internal RAM

32 Programmable I/O Lines

Three 16-bit Timer/Counters

18

Eight Interrupt Sources

Full Duplex UART Serial Channel

Low-power Idle and Power-down Modes

Interrupt Recovery from Power-down Mode

Watchdog Timer

Dual Data Pointer

Fast Programming Time

Flexible ISP Programming (Byte and Page Mode)

Green (Pb/Halide-free) Packaging Option

Pin Diagram

Fig 3.13 Pin Description of AT89S52

19

BLOCK DIAGRAM

Fig 3.14 Architecture of AT89S52

20

Pin Description
VCC

Supply voltage.

GND

Ground.

Port0
Port 0is an 8-bitopendrain bidirectional I/O port. As an
output port, each pin can sink eight TTL inputs. When1s are
written to port 0 pins, the pins can be used as high-impedance
inputs.
Port0can also be configured to be the multiplexed loworder address/data bus during accesses to external program and
data memory. In this mode, P0 has internal pull-ups. External pullups are required during program verification.

Port1
Port1 is an 8-bit bidirectional I/O port with internal pullups. The Port1 output buffers can sink/source four TTL inputs.
When 1s are written to Port1 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port1 pins
that are externally being pulled low will source current (IIL)
because of the internal pull-ups.
In addition, P1.0 and P1.1 can be configured to be the
timer/counter 2 trigger input (P1.1/T2EX), respectively.
Port1 also receives the low-order address bytes during
Flash programming and verification.

Port2
Port2 is an 8-bit bidirectional I/O port with internal pull21

ups. The Port2 output buffers can sink/source four TTL inputs.
When 1s are written to Port2 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port2 pins
that are externally being pulled low will source current (IIL)
because of the internal pull-ups.
Port2 emits the high-order address byte during fetches from
external program memory and during accesses to external data
memory that uses 16-bit addresses (MOVX@DPTR). In this
application, Port2 uses strong internal pull-ups when emitting 1s.
During accesses to external data memory that use 8-bit addresses
(MOVX@RI), Port2 emits the contents of the P2 Special Function
Register.
Port2 also receives the high-order address bits and some
control signals during Flash programming and verification.

Port3
Port3 is an 8-bit bidirectional I/O port with internal pullups. The Port3 output buffers can sink/source four TTL inputs.
When 1s are written to Port3 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port3 pins
that are externally being pulled low will source current (IIL)
because of the pull-ups.
Port3 receives some control signals for Flash programming
and verification.

Port3 also serves the functions of various special features


of the AT89S52, as shown in the following table.

22

Port Pin

Alternate Functions

P3.0

RXD (serial input port)

P3.1

TXD (serial output port)

P3.2

INT0 (external interrupt0)

P3.3

INT1 (external interrupt1)

P3.4

T0 (timer 0 external input)

P3.5

T1 (timer 1 external input)

P3.6

WR(external data memory write strobe)

P3.7

RD (external data memory read strobe)


Table: 3.1 PORT 3

RST
Reset input. A high on this pin for two machine cycles
while the oscillator is running resets the device. This pin drives
high for 98 oscillator periods after the Watchdog times out. The
DISRTO bit in SFR AUXR (address 8EH) can be used to disable
this feature. In the default state of bit DISRTO, the RESET HIGH
out feature is enabled.
ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching
the low byte of the address during accesses to external memory.
This pin is also the program pulse input (PROG) during Flash
programming. In normal operation, ALE is emitted at a constant
rate of 1/6 the oscillator frequency and may be used for external
timing or clocking purposes. Note, however, that one ALE pulse is
skipped during each access to external data memory. If desired,

ALE operation can be disabled by setting bit 0 of SFR location


8EH. With the bit set, ALE is active only during a MOVX or
MOVC instruction. Otherwise, the pin is weakly pulled high.
23

Setting the ALE-disable bit has no effect if the microcontroller is


in external execution mode.

PSEN
Program Store Enable (PSEN) is the read strobe to external
program memory. When the AT89S52 is executing code from
external program memory, PSEN is activated twice each machine
cycle, except that two PSEN activations are skipped during each
access to external data memory.

EA/VPP
External Access Enable (EA) must be strapped to GND in
order to enable the device to fetch code from external program
memory locations starting at 0000H up to FFFFH. Note, however,
that if lock bit 1 is programmed, EA will be internally latched on
reset. EA should be strapped to VCC for internal program
executions. This pin also receives the 12-volt programming enable
voltage (VPP) during Flash programming.

Xtal1
Input to the inverting oscillator amplifier and input to the
internal clock operating circuit.

Xtal2
Output from the inverting oscillator amplifier.

24

SPECIAL FUNCTION REGISTERS

Table 3.2 AT89S52 SFR map and reset values

AUXR: AUXILIARY REGISTER

Table 3.3 Auxiliary register of AT89S52

25

DUAL DATA POINTER REGISTERS


To facilitate accessing both internal and external data memory, two banks of 16bit Data Pointer Registers are provided: DP0 at SFR address locations 82H-83H and DP1
at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1. The user
should ALWAYS initialize the DPS bit to the appropriate value before accessing the
respective Data Pointer Register.

Table 3.4 Data pointer register

MEMORY ORGANIZATION
MCS-51 devices have a separate address space for Program and Data Memory.
Up to 64K bytes each of external Program and Data Memory can be addressed.

PROGRAM MEMORY
If the EA pin is connected to GND, all program fetches are directed to external
memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses
0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H
through FFFFH are to external memory.

DATA MEMORY
The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes
occupy a parallel address space to the Special Function Registers. This means that the
upper 128 bytes have the same addresses as the SFR space but are physically separate
from SFR space. When an instruction accesses an internal location above address 7FH,
the address mode used in the instruction specifies whether the CPU accesses the upper
26

128 bytes of RAM or the SFR space. Instructions which use direct addressing access the
SFR space.
For example, the following direct addressing instruction accesses the SFR at
location 0A0H (which is P2). MOV 0A0H, #data Instructions that use indirect addressing
access the upper 128 bytes of RAM. For example, the following indirect addressing
instruction, where R0 contains 0A0H, accesses the data byte at address 0A0H, rather than
P2 (whose address is 0A0H). MOV @R0, #data Note that stack operations are examples
of indirect addressing, so the upper 128 bytes of data RAM are available as stack space.

WATCHDOG TIMER (ONE-TIME ENABLED WITH RESET-OUT)


The WDT is intended as a recovery method in situations where the CPU may be
subjected to software upsets. The WDT consists of a 14-bit counter and the Watchdog
Timer Reset (WDTRST) SFR. The WDT is defaulted to disable from exiting reset. To
enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register
(SFR location 0A6H). When the WDT is enabled, it will increment every machine cycle
while the oscillator is running. The WDT timeout period is dependent on the external
clock frequency. There is no way to disable the WDT except through reset (either
hardware reset or WDT overflow reset). When WDT over-flows, it will drive an output
RESET HIGH pulse at the RST pin.

USING THE WDT


To enable the WDT, a user must write 01EH and 0E1H in sequence to the
WDTRST register (SFR location 0A6H). When the WDT is enabled, the user needs to
service it by writing 01EH and 0E1H to WDTRST to avoid a WDT overflow. The 14-bit
counter overflows when it reaches 16383 (3FFFH), and this will reset the device. When
the WDT is enabled, it will increment every machine cycle while the oscillator is
running. This means the user must reset the WDT at least every 16383 machine cycles.
To reset the WDT the user must write 01EH and 0E1H to WDTRST. WDTRST is a
write-only register. The WDT counter cannot be read or written. When WDT overflows,
it will generate an output RESET pulse at the RST pin. The RESET pulse duration is

27

98xTOSC, where TOSC = 1/FOSC. To make the best use of the WDT, it should be
serviced in those sections of code that will periodically be executed within the time
required to prevent a WDT reset.

WDT (DURING POWER-DOWN AND IDLE)


In Power-down mode the oscillator stops, which means the WDT also stops.
While in Power-down mode, the user does not need to service the WDT. There are two
methods of exiting Power-down mode: by a hardware reset or via a level-activated
external interrupt which is enabled prior to entering Power-down mode. When Powerdown is exited with hardware reset, servicing the WDT should occur as it normally does
whenever the AT89S52 is reset. Exiting Power-down with an interrupt is significantly
different. The interrupt is held low long enough for the oscillator to stabilize. When the
interrupt is brought high, the interrupt is serviced. Top revent the WDT from resetting
the device while the interrupt pin is held low, the WDT is not started until the interrupt is
pulled high. It is suggested that the WDT be reset during the interrupt service for the
interrupt used to exit Power-down mode.
To ensure that the WDT does not overflow within a few states of exiting Powerdown, it is best to reset the WDT just before entering Power-down mode.
Before going into the IDLE mode, the WD IDLE bit in SFR AUXR issued to
determine whether the WDT continues to count if enabled. The WDT keeps counting
during IDLE (WD IDLE bit=0) as the default state. To prevent the WDT from resetting
the AT89S52 while in IDLE mode, the user should always setup a timer that will
periodically exit IDLE, service the WDT, and reenter IDLE mode.
With WD IDLE bit enabled, the WDT will stop to count in IDLE mode and
resumes the count upon exit from IDLE.

UART
The UART in the AT89S52 operates the same way as the UART in the
AT89C51andAT89C52.

28

3.3 IR Transmitter and Receiver


IR LED
Here the IR transmitter is nothing but the IR LED. It just looks like a normal LED
but transmits the IR signals. Since the IR rays are out of the visible range we cannot
observe the rays from the transmitter.

These are infrared LEDs; the light output is not visible by our eyes. They can be
used as replacement LEDs for remote controls, night vision for camcorders, invisible
beam sensors, etc.

Fig: 3.15 IR LED


Advantages

Infrared LEDs are ideal light sources for use with night vision goggles,
surveillance cameras, and medical imaging, recognition and calibration systems.

Due to their resistance to ambient-light impediments and electromagnetic


interference (EMI), Infrared LEDs enhance the performance of wireless
computer-to-PDA links, collision avoidance systems, automation equipment,
biomedical instrumentation, and telecommunications equipment.

Solid-state design renders Infrared LEDs impervious to electrical and mechanical


shock, vibration, frequent switching and environmental extremes. With an
average life span of 100,000-plus hours (11 years), Infrared LEDs operate reliably
year-after-year.

29

Photo diode
A photodiode is a type of photo detector capable of converting light into either
current or voltage, depending upon the mode of operation.
Photodiodes are similar to regular semiconductor diodes except that they may be
either exposed (to detect vacuum UV or X-rays) or packaged with a window or optical
fiber connection to allow light to reach the sensitive part of the device. Many diodes
designed for use specifically as a photodiode will also use a PIN junction rather than the
typical PN junction.

Fig: 3.16 Photo diode

Principle of operation
A photodiode is a PN junction or PIN structure. When a photon of sufficient
energy strikes the diode, it excites an electron thereby creating a mobile electron and a
positively charged electron hole. If the absorption occurs in the junction's depletion
region, or one diffusion length away from it, these carriers are swept from the junction by
the built-in field of the depletion region. Thus holes move toward the anode, and
electrons toward the cathode, and a photocurrent is produced.

Photovoltaic mode
When used in zero bias or photovoltaic mode, the flow of photocurrent out of the
device is restricted and a voltage builds up. The diode becomes forward biased and "dark
current" begins to flow across the junction in the direction opposite to the photocurrent.
30

This mode is responsible for the photovoltaic effect, which is the basis for solar cellsin
fact, a solar cell is just an array of large photodiodes.

Photoconductive mode
In this mode the diode is often (but not always) reverse biased. This increases the
width of the depletion layer, which decreases the junction's capacitance resulting in faster
response times. The reverse bias induces only a small amount of current (known as
saturation or back current) along its direction while the photocurrent remains virtually the
same.
Although this mode is faster, the photovoltaic mode tends to exhibit less
electronic noise. (The leakage current of a good PIN diode is so low < 1nA that the
JohnsonNyquist noise of the load resistance in a typical circuit often dominates.)

Other modes of operation


Avalanche photodiodes have a similar structure to regular photodiodes, but they
are operated with much higher reverse bias. This allows each photo-generated carrier to
be multiplied by avalanche breakdown, resulting in internal gain within the photodiode,
which increases the effective responsivity of the device.
Phototransistors also consist of a photodiode with internal gain. A
phototransistor is in essence nothing more than a bipolar transistor that is encased in a
transparent case so that light can reach the base-collector junction. The electrons that are
generated by photons in the base-collector junction are injected into the base, and this
current is amplified by the transistor operation. Note that although phototransistors have a
higher responsivity for light they are unable to detect low levels of light any better than
photodiodes. Phototransistors also have slower response times.

Materials
The material used to make a photodiode is critical to defining its properties,
because only photons with sufficient energy to excite electrons across the material's band
gap will produce significant photocurrents.

31

Materials commonly used to produce photodiodes include:

Material

Wavelength range (nm)

Silicon

1901100

Germanium

4001700

Indium gallium arsenide 8002600

Lead sulfide

<1000-3500

Table 3.5 Material-Wavelength range


Because of their greater band gap, silicon-based photodiodes generate less noise
than germanium-based photodiodes, but germanium photodiodes must be used for
wavelengths longer than approximately 1 m.
Since transistors and ICs are made of semiconductors, and contain P-N junctions,
almost every active component is potentially a photodiode. Many components, especially
those sensitive to small currents, will not work correctly if illuminated, due to the induced
photocurrents. In most components this is not desired, so they are placed in an opaque
housing. Since housings are not completely opaque to X-rays or other high energy
radiation, these can still cause many ICs to malfunction due to induced photo-currents.

Features
Critical performance parameters of a photodiode include:

Responsively
The ratio of generated photocurrent to incident light power, typically expressed in

A/W when used in photoconductive mode. The responsively may also be expressed as a
32

quantum efficiency, or the ratio of the number of photo generated carriers to incident
photons and thus a unit less quantity.

Dark current
The current through the photodiode in the absence of light, when it is operated in

photoconductive mode. The dark current includes photocurrent generated by background


radiation and the saturation current of the semiconductor junction. Dark current must be
accounted for by calibration if a photodiode is used to make an accurate optical power
measurement, and it is also a source of noise when a photodiode is used in an optical
communication system.

Noise-equivalent power
(NEP) The minimum input optical power to generate photocurrent, equal to the

rms noise current in a 1 hertz bandwidth. The related characteristic detectivity (D) is the
inverse of NEP, 1/NEP; and the specific detectivity () is the detectivity normalized to the
area (A) of the photo detector,. The NEP is roughly the minimum detectable input power
of a photodiode.
When a photodiode is used in an optical communication system, these parameters
contribute to the sensitivity of the optical receiver, which is the minimum input power
required for the receiver to achieve a specified bit error ratio.

Applications
P-N photodiodes are used in similar applications to other photo detectors, such as
photoconductors, charge-coupled devices, and photomultiplier tubes.

Fig 3.17 Photodiode schematic symbol

33

Photodiodes are used in consumer electronics devices such as compact disc


players, smoke detectors, and the receivers for remote controls in VCRs and televisions.
In other consumer items such as camera light meters, clock radios (the ones that dim the
display when it's dark) and street lights, photoconductors are often used rather than
photodiodes, although in principle either could be used.
Photodiodes are often used for accurate measurement of light intensity in science
and industry. They generally have a better, more linear response than photoconductors.
They are also widely used in various medical applications, such as detectors for
computed tomography (coupled with scintillators) or instruments to analyze samples
(immunoassay). They are also used in blood gas monitors.
PIN diodes are much faster and more sensitive than ordinary p-n junction diodes,
and hence are often used for optical communications and in lighting regulation-N
photodiodes are not used to measure extremely low light intensities. Instead, if high
sensitivity is needed, avalanche photodiodes, intensified charge-coupled devices or
Photomultiplier tubes are used for applications such as astronomy, spectroscopy, night
vision equipment and laser range finding.

PRINCIPLE
Transmitter and receiver are incorporated in a single housing. The modulated
infrared light of the transmitter strikes the object to be detected and is reflected in a
diffuse way. Part of the reflected light strikes the receiver and starts the switching
operation. The two states i.e. reflection received or no reflection are used to determine
the presence or absence of an object in the sensing range.
This system safely detects all objects that have sufficient reflection. For objects
with a very bad degree of reflection (matt black rough surfaces) the use of diffuse
reflection sensors for short ranges or with background suppression is recommended.

34

3.4 CRYSTAL OSCILLATOR


A crystal oscillator is an electronic circuit that produces electrical oscillations at a
particular designed frequency determined by the physical characteristics of one or more
crystals, generally of quartz, positioned in the circuit feedback loop. A piezoelectric
effect causes a crystal such as quartz to vibrate and resonate at a particular frequency.
The quartz crystal naturally oscillates at a particular frequency, its fundamental frequency
that can be hundreds of megahertz. The crystal oscillator is generally used in various
forms such as a frequency generator, a frequency modulator and a frequency converter.
The crystal oscillator utilizes crystal having excellent piezoelectric characteristics, in
which crystal functions as a stable mechanical vibrator.

Fig 3.18 Crystal oscillator


There are many types of crystal oscillators. One of them is a crystal oscillator
employing an inverting amplifier including a CMOS circuit, and used, for example, as a
reference signal source of a PLL circuit of a mobile phone. Crystal oscillator circuits
using crystal have a number of advantages in actual application since crystals show high
frequency stability and stable temperature characteristic as well as excellent processing
ability. Temperature-compensated crystal oscillators, in which variation in oscillation
frequency that arises from the frequency-temperature characteristic of the quartz-crystal
unit is compensated, find particularly wide use in devices such as wireless phones used in
a mobile environment. A surface mounting crystal oscillator is used mainly as a
frequency reference source particularly for a variety of portable electronic devices such as
portable telephones because of its compact size and light weight.

35

3.5 VARIABLE RESISTOR (POTENTIOMETER)


A potentiometer (colloquially known as a "pot") is a three-terminal resistor
with a sliding contact that forms an adjustable voltage divider. If only two terminals are
used (one side and the wiper), it acts as a variable resistor or Rheostat.
Potentiometers are rarely used to directly control significant power (more than a watt).
Instead they are used to adjust the level of analog signals (e.g. volume controls on audio
equipment), and as control inputs for electronic circuits. For example, a light dimmer
uses a potentiometer to control the switching of a TRIAC and so indirectly control the
brightness of lamps.
Potentiometers are sometimes provided with one or more switches mounted on the same
shaft. For instance, when attached to a volume control, the knob can also function as an
on/off switch at the lowest volume

Fig: 3.19 A typical single turn potentiometer

Applications of potentiometers
Potentiometers are widely used as user controls, and may control a very wide variety
of equipment functions. The widespread use of potentiometers in consumer electronics
has declined in the 1990s, with digital controls now more common, they remain in many
applications, such as volume controls and as position sensors.

Audio control
One of the most common uses for modern low-power potentiometers is as audio
control devices. Both linear pots (also known as "faders") and rotary potentiometers

36

(commonly called knobs) are regularly used to adjust loudness, frequency attenuation and
other characteristics of audio signals.

Television
Potentiometers were formerly used to control picture brightness, contrast, and color
response. A potentiometer was often used to adjust "vertical hold", which affected the
synchronization between the receiver's internal sweep circuit (sometimes a multivibrator)
and the received picture signal.

Transducers
Potentiometers are also very widely used as a part of displacement transducers
because of the simplicity of construction and because they can give a large output signal.

Computation
In analog computers, high precision potentiometers are used to scale intermediate
results by desired constant factors, or to set initial conditions for a calculation.

3.6 ICLM324
A single sided supply op-amp is one where the input and output voltages can be
as low as the negative power supply voltage instead of needing to be at least two volts
above it. The result is that it can operate in many applications with the negative supply
pin on the op-amp being connected to the signal ground, thus eliminating the need for a
separate negative power supply.
The LM324 (released in 1972) was one such op-amp that came in a quad package
and became an industry standard. In addition to packaging multiple op-amps in a single
package, the 1970s also saw the birth of op-amps in hybrid packages. These op-amps
were generally improved versions of existing monolithic op-amps and were without a
doubt the best op-amps available. As the properties of monolithic op-amps improved, the

37

more complex hybrid ICs were quickly relegated to systems that are required to have
extremely long service lives or other specialty systems.

Fig: 3.20 IC LM324

Basic Op Amp Function


1) If (inverting input) > (non-inverting input) output saturates towards Vss.
2) If (inverting input) < (non-inverting input) output saturates towards +Vss.
3) Without feedback maximum saturation occurs with the slightest difference between
inputs.
4) Ideal op-amp has infinite impedance on the inputs, infinite gain, and zero resistance on
output.
5) In real life gain is limited to voltage present at +Vss/-Vss.
6) For practical purposes there is no current flow from the inputs to the outputs. The input
voltage serves only as a reference to control the output.

38

Fig 3.21 Equivalent circuit of an operational amplifier

DESCRIPTION
The LMV321, LMV358, and LMV324/LMV324S are single, dual, and quad lowvoltage (2.7 V to 5.5 V) operational amplifiers with rail-to-rail output swing. The
LMV324S, which is a variation of the standard LMV324, includes a power-saving shut
down feature that reduces supply current to a maximum of 5 A per channel when the
amplifiers are not needed. Channels 1 and 2 together are put in shutdown, as are channels
3 and 4. While in shutdown, the outputs actively are pulled low.
The LMV321, LMV358, LMV324, and LMV324S are the most cost-effective
solutions for applications where low-voltage operation, space saving, and low cost are
needed. These amplifiers were designed specifically for low-voltage (2.7 V to 5 V)
operation, with performance specifications meeting or exceeding the LM358 and LM324
devices that operate from 5 V to 30 V. Additional features of the LMV3xx devices are a
common-mode input voltage range that includes ground, 1-MHz unity-gain bandwidth,
and 1-V/s slew rate.
The LMV321 is available in the ultra-small DCK (SC-70) package, which is
approximately one-half the size of the DBV (SOT-23) package. This package saves space
on printed circuit boards and enables the design of small portable electronic devices. It

39

also allows the designer to place the device closer to the signal source to reduce noise
pickup and increase signal integrity.

3.7 LED
A light-emitting diode (LED) is a semiconductor light source. LEDs are used as
indicator lamps in many devices, and are increasingly used for lighting. Introduced as
a practical electronic component in 1962, early LEDs emitted low-intensity red light,
but modern versions are available across the visible, ultraviolet and infrared
wavelengths, with very high brightness. The internal structure and parts of a led are
shown in figure 3.22

Fig 3.22 Inside a LED

Working
The structure of the LED light is completely different than that of the light bulb.. The
light-emitting semiconductor material is what determines the LED's color. The LED is
based on the semiconductor diode. When a diode is forward biased (switched on),
electrons are able to recombine with holes within the device, releasing energy in the form
of photons. This effect is called electroluminescence and the color of the light
(corresponding to the energy of the photon) is determined by the energy gap of the
40

semiconductor. An LED is usually small in area (less than 1 mm2), and integrated optical
components are used to shape its radiation pattern and assist in reflection.

Fig 3.23 Electrical Symbol & Polarities of LED

3.8 BC547 Transistor


BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of
resistance, is commonly used to amplify current. A small current at its base controls a
larger current at collector & emitter terminals.
BC547 is mainly used for amplification and switching purposes. It has a
maximum current gain of 800. Its equivalent transistors are BC548 and BC549.
The transistor terminals require a fixed DC voltage to operate in the desired region of its
characteristic curves. This is known as the biasing. For amplification applications, the
transistor is biased such that it is partly on for all input conditions. The input signal at
base is amplified and taken at the emitter. BC547 is used in common emitter
configuration for amplifiers. The voltage divider is the commonly used biasing mode. For
switching applications, transistor is biased so that it remains fully on if there is a signal at
its base. In the absence of base signal, it gets completely off.

Fig 3.24 BC547


41

4.1 KEIL UVISION


GETTING STARTED
The Vision IDE is the easiest way for most developers to create embedded
applications using the Keil development tools. To launch Vision, click on the icon on
your desktop or select Keil Vision4 from the Start Menu.

Fig 4.1 Open project keil Vision4


In the Project Menu...
New Project...
Creates a new project.
Open Project...
Opens an existing project.
Vision includes a number of example projects you may use to get familiar with the tools
and capabilities that are available.
One of the hardest parts of starting a new project is selecting the right mix of
compiler, assembler, and linker options for the particular chip you use. Vision provides

42

the Device Database which makes this tedious task easy.

Fig 4.2 device database in keil Vision4


When you create a new project, you select the chip you will use and Vision sets all the
necessary assembler, compiler, and linker options automatically.
For more information about how you can use the device database, refer to the
following entries from the Support Knowledgebase:

STARTUP CODE

Configuring startup code can be one of the most frustrating aspects of embedded
software development.

43

Fig 4.3 Startup code dialog box

The Vision IDE automatically includes the appropriate startup code (based on the
device you select) and provides a known foundation from which to start.

The Configuration Wizard helps you set startup options for your target hardware
using familiar dialog controls.

Fig 4.4 Configuration wizard window

OPTION SETTINGS
Vision lets you set the options for all files in a target, a group, or even a single source
file.

44

Click the Options for Target button on the toolbar to change the project options for
the currently selected target.
In the Project Workspace, you may right-click the target, group, or source file to open the
options dialog specific to that item.

Fig 4.5 Option dialog settings


The Options Dialog offers several Tabs where you specify option settings:

The Device tab allows you to select the device for this target.

The Target tab allows you to specify the memory model and memory parameters.
You may enter the external (or off-chip) memory address ranges under External
Memory. When you start a new project, you typically only need to setup the options
on this tab.

The Output tab allows you to specify the contents of the output files generated by
the assembler, compiler, and linker.

The Listing tab allows you to configure the contents of the listing files.
45

The C/C++, Asm, and Linker tabs allow you to enter tool-specific options and
display the current tool settings.

The Debug tab configures the Vision Debugger.

The Utilities tab configures Flash memory programming for your target system
Vision may or may not prompt you to include the startup code for your selected

Microcontroller. In either case, you must configure the appropriate startup code to match
your target hardware configuration.

TARGETS & GROUPS


Vision projects are composed of one or more targets, one or more file groups, and
source files.
A target is a collection of all file groups and the development tool options. While most
projects require only one target, you may create as many targets as you like. Each target
generates a different target file with different options.

Fig4.6(a)

Fig4.6(b)

Simulator-RealView Target

Simulator - CARM Target

These two targets, Simulator-RealView and Simulator-CARM, create distinct binary


files.

The Simulator-Realview target uses the RealView compilation tools for ARM while the
Simulator-CARM target uses the Keil compilation tools for ARM.
46

Each target has its own tool configuration settings. Files and groups may be included or
excluded as needed for startup or other target-specific source code

Click the Setup Editor Button to manage the targets maintained in your project.

Fig 4.7 project components tab


In the Project Components tab, you may configure the Project Targets, Groups, and Files
in your project.

Each Target has its own option settings and output file name that you may define.
You may create one Target for testing with the simulator and another Target for a
release version of your application that will be programmed into Flash ROM.

Within Targets, you may have one or more file Groups which allow you to
associate source files together. Groups are useful for grouping files into functional
blocks or for identifying engineers in a software team.

Files are simply the source files within a group

SOURCE FILES
The source files in your Vision project display in a Project Workspace.

Each Project can be configured to generate one or more Targets. Each Target has
its own option settings and output file name that you may define. You may create

47

one Target for testing with the simulator and another Target for a release version of
your application that will be programmed into Flash ROM.

Within a Target, you may have one of more file Groups which allow you to
associate source files together. Groups are useful for grouping files into functional
blocks or for identifying engineers in a software team.

The Project Workspace window displays the target (AT91M55800A in this


case)along with all file groups and source files that comprise your project.

Fig 4.8 Files of a project


The Project menu provides access to all dialogs for project management including...

New Project... which creates a new project.

Targets, Groups, Files... which add components to a project. The Local menu in
the Project window allows you to add files to the project.

Open Project... which opens an existing project.

BUILDINGPROJECTS
Vision includes an integrated make facility that compiles, assembles, and links
your program.

Click the Build Target button on the toolbar to compile and

48

assemble the source files in your project and link them together into an absolute,
executable program.
The assembler and compiler automatically generate file dependencies and add them
to the project. File dependency information is used during the make process to build only
those files that have changed or that include other files that have changed.

As Vision compiles and assembles your source files, status information as well
as errors and warnings appear in the Output Window.

Fig 4.9 Compilation of a source files

You may double-click on an error or warning to immediately begin editing the


file with the problem--even while Vision continues compiling your source files
in the background. The line numbers for errors and warnings are synchronized
even after you make changes to the source file(s).

To get more information about a particular error message, select the message and
press F1 for full help text.

If you enable global optimizations, Vision re-compiles your source files to


achieve the most optimal global use of registers

49

PROJECTWORKSPACES
New in Vision4

Fig 4.10 New project in Vision4

Vision4 now supports multi-project workspaces that allow you to work with
multiple projects at the same time.

You create workspaces from the Project Menu. You may include as many project
files as needed to the workspace. You may change the order of projects or add
more at any time.

Click the Manage Workspace button on the toolbar to change the projects
included in the workspace.

Fig 4.11 Manage Workspace components

50

Fig 4.12 Project workspace

When working with a workspace, the Project Workspace window displays the
projects included in the workspace.

Vision4 allows you to work in the active project while giving you the ability to view
files and settings in other projects in the workspace.

You may right-click a different project to make it active.

All familiar controls work on the active project

Fig 4.13 Batch Build

51

Another powerful feature of project workspaces is that you may now build
multiple projects with a single command.

Click the Batch Build button on the toolbar to build the selected projects in
the workspace in a single operation. The Batch Build Dialog allows you control
over what projects and targets are built.

SOURCE CODE

Fig 4.14 Source code


Vision displays the source code as you debug your target program.

Line numbers help you reference different sections of a source file.

Each line of code is marked with code coverage indicators that show execution
status for that line.

Hover the mouse pointer over a variable and Vision displays its value.

Other features, like source outlining and breakpoints, are available from the
context menu.

Lines with no code are marked with a grey checked block.

Unexecuted lines (instructions) are marked with a grey block.


52

Fully-executed lines (instructions) are marked with a green block.

Branches that have been taken are marked with a blue block.

Branches that have been skipped are marked with an orange block.

The next line to execute is marked with a yellow arrow

DISASSEMBLY

Fig 4.15 Disassembly window

Click the Disassembly Window button on the toolbar to toggle display of


this window.

The Disassembly Window shows mixed high-level source code and its associated
assembler code.

Each instruction is marked with code coverage indicators that show execution
status.

Lines with no code are marked with a grey checked block.

Unexecuted lines (instructions) are marked with a grey block.

Fully-executed lines (instructions) are marked with a green block.

Branches that have been taken are marked with a blue block.

Branches that have been skipped are marked with an orange block.

The next line to execute is marked with a yellow arrow

53

RUN/STOP

Fig 4.16 Run/Stop Program

Starting and stopping program execution may be controlled using commands you
enter in the Output Window or using buttons on the toolbar.

Click the Run button on the toolbar to begin executing your target program in
the Vision debugger.

The Run button executes code until a breakpoint is reached.


Click the Stop button on the toolbar to halt program execution.

Fig 4.17 Output Window

In the Output Window, type g,label to execute program code and stop when label
is reached.

You may also type G to run and Ctrl-C to start.

54

5.1 FLOWCHART

Fig 5.1 Flow chart

55

5.2 RESULT

Fig 5.2 Indication of LED on detecting a movement

56

6.1 APPLICATIONS AND ADVANTAGES


The major applications of the project include

Streets

Tunnels

Main roads

The advantages of the project include

Low cost

Low Power consumption

Easy to design and program

Highly reliable

6.2 FUTURE SCOPE

Pole damage detection with the addition of a suitable sensor.

If the system has traffic speed sensor then this could be used to manage traffic.

With the added intelligence in the lamp, you can add further features to increase
HID lamp life, such as softer start-up and protection against re-igniting an already
hot HID lamp, since this shortens the lamp life

57

CONCLUSION
The

project

STREET

LIGHT

THAT

GLOWS

ON

VEHICLE

MOVEMENT has been successfully designed and tested.


It has been developed by integrating features of all the hard ware components
used. Presence of every module has been reasoned out and placed carefully thus
contributing to the best working of the unit.
Secondly, using highly advanced ICs and with the help of growing technology,
the project has been successfully implemented. We were extremely satisfied by our
project since maximum amount of power is saved and the cost of designing is also less.
Finally we conclude that STREET LIGHT THAT GLOWS ON VEHICLE
MOVEMENT is an emerging field and there is huge scope for development.

58

BIBILIOGRAPHY
8051MICROCONTROLLERKENNETH J.AYALA,PENRAN INTERNATIONAL.
ELECTRONIC COMPONENTS- D.V. PRASAD.
LINEAR INTEGRATED CIRCUITS ROY CHOWDARY
[1] Alzubaidi, S. Soori, P.K., "Study on energy efficient street lighting system
design," Power Engineering and Optimization Conference (PEDCO) Melaka,
Malaysia, 2012 IEEE International , vol., no., pp.291,295, 6-7 June 2012, doi:
10.1109/PEOCO.2012.6230877
[2] Denardin, G.W. Barriquello, C.H.; Campos, A.; Pinto, R.A.;Dalla Costa, M.A.; do
Prado, R.N.; , "Control network for modern street lighting systems," Industrial
Electronics (ISIE), 2011 IEEE International Symposium on , vol., no., pp.1282-1289,
27-30 June 2011 doi:10.1109/ISIE.2011.5984343
[3] Chunguo Jing; LiangchaoRen; DeyingGu; , "Geographical routing for WSN of
street lighting monitoring and control system," Computer Design and Applications
(ICCDA), 2010 International Conference on , vol.3, no., pp.V3-235-V3-238, 25-27
June 2010 doi: 10.1109/ICCDA.2010.5540771
[4] Long, X.; Liao, R.; Zhou, J.; , "Development of street lighting system-based novel
high-brightness LED modules," Optoelectronics, IET , vol.3, no.1, pp.40-46,
February 2009 doi: 10.1049/ietopt:20070076
[5] Xingming Long; Jing Zhou; , "An intelligent driver for Light Emitting Diode
Street Lighting," Automation Congress, 2008. WAC 2008. World , vol., no., pp.1-5,
Sept. 28 2008-Oct. 2 2008

59

You might also like