You are on page 1of 46

A traffic light, traffic signal, or stop

light is a signaling device positioned at a


road intersection, pedestrian

crossing, or

other location in order to indicate when it


is safe to drive, ride, or walk using a
universal color code. In Malaysia, the
traffic lights for vehicles commonly have
three main lights, a red light that means
stop, a green light that mean go and yellow
that means ready to stop.
However for the pedestrians, there have
only two lights, a red light and a green light
that mean go and stop respectively. The
traffic lights have given many benefits to all
road users. Besides reducing the number
of accidents, it made the traffic flow
smoothly and possibly could save people
time.

The worlds first traffic light came into


being before the automobile was in use, and
traffic consisted only of pedestrians,

buggies, and wagons. we are coming late to


colleges inspite of leaving home too early.

First of all why we choose this project is for


betterment of people travelling across the
cities..

Now how we approached this project is


having a better answer of why we are coming
late to colleges inspite of leaving home too
early.

Observing traffic in nearby areas we have


decided to have
a make better functioning
traffic control and regulation system.

By using this system traffic can be cleared


without irregularities and time delays even
though there is no traffic on the other side can
be avoided.

All these sensors are interfaced to the


microcontroller .

Density Based Traffic Signal System


Circuit Principle:
The main heart of this traffic system is
microcontroller. IR sensors are connected to the
PORT C (PC0, PC1, PC2, and PC3) of the
microcontroller and traffic lights are connected to
PORT B and PORT D. If there is a traffic on road
then that particular sensor output becomes logic 0
otherwise logic 1. By receiving these IR sensor
outputs, we have to write the program to control the
traffic system.
If you receive logic 0 from any of these sensors, we
have to give the green signal to that particular path
and give red signal to all other paths. Here
continuously we have to monitor the IR sensors to
check for the traffic.

LIST OF THE COMPONENTS:


NAME OF COMPONENT

SPECIFICATION

QUANTITY

PRICE

MICRO CANTROLLER

ATmega8 controller

180

PCB BOARD

DSIGNED PCB

200

SENSOR

IR (INFRARED)
SENSORS

416

LEDS

YELLOW

20

LEDS

GREEN

20

LEDS

RED

20

635

POWER SUPPLY

12V DC POWER
SUPPLY

SERIAL CABLE

----------------------------

-------------------------

60

CONECTING WIRE

----------------------------

-------------------------

60

DETAILING & DISCRIPTION OF


COMPONENTS:

MICROCANTROLLER ATMEGA8:

Features:


High-performance, Low-power AtmelAVR
8-bit Microcontroller

Advanced RISC Architecture

130 Powerful Instructions Most Single-clock


Cycle Execution

32 8 General Purpose Working Registers


Fully Static Operation
Up to 16MIPS Throughput at 16MHz
On-chip 2-cycle Multiplier
High Endurance Non-volatile Memory segments
8Kbytes of In-System Self-programmable
Flash program memory
512Bytes EEPROM
1Kbyte Internal SRAM
Write/Erase Cycles: 10,000 Flash/100,000
EEPROM
Data retention: 20 years at 85C/100 years
at 25C(1)
Optional Boot Code Section with
Independent Lock Bits

In-System Programming by On-chip Boot


Program

True Read-While-Write Operation


Programming Lock for Software Security
Peripheral Features

Two 8-bit Timer/Counters with Separate


Prescaler, one Compare Mode
One 16-bit Timer/Counter with Separate
Prescaler, Compare Mode, and
CaptureMode
Real Time Counter with Separate Oscillator
Three PWM Channels
8-channel ADC in TQFP and QFN/MLF
package
Eight Channels 10-bit Accuracy
6-channel ADC in PDIP package
Six Channels 10-bit Accuracy
Byte-oriented Two-wire Serial Interface
Programmable Serial USART
Master/Slave SPI Serial Interface
Programmable Watchdog Timer with
Separate On-chip Oscillator
On-chip Analog Comparator

Special Microcontroller Features


Power-on Reset and Programmable Brownout Detection
Internal Calibrated RC Oscillator
External and Internal Interrupt Sources
Five Sleep Modes: Idle, ADC Noise
Reduction, Power-save, Power-down,
andStandby

I/O and Packages


23 Programmable I/O Lines
28-lead PDIP, 32-lead TQFP, and 32-pad
QFN/MLF
Operating Voltages
2.7V - 5.5V (ATmega8L)
4.5V - 5.5V (ATmega8)
Speed Grades
0 - 8MHz (ATmega8L)
0 - 16MHz (ATmega8)
Power Consumption at 4Mhz, 3V, 25C
Active: 3.6mA
Idle Mode: 1.0mA
Power-down Mode: 0.5A

PIN DIAGRAM OF ATMEGA8:

The Atmel AVR ATmega8 is a low-power CMOS


8-bit microcontroller based on the AVR RISC
architecture. By executing powerful instructions in a
single clock cycle, the ATmega8 achieves
throughputs approaching 1MIPS per MHz, allowing
the system designer to optimize power consumption
o versus processing speed.

Pin Descriptions:

VCC Digital supply voltage.


GND Ground.
Port B (PB7..PB0)
XTAL1/XTAL2/TOSC1/TOSC2
Port B is an 8-bit bi-directional I/O port with internal
pull-up resistors (selected for each bit). ThePort B output
buffers have symmetrical drive characteristics with both
high sink and sourcecapability. As inputs, Port B pins
that are externally pulled low will source current if the
pull-upresistors are activated. The Port B pins are tristated 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
Oscillatoramplifier and input to the internal clock
operating circuit.Depending on the clock selection fuse
settings, PB7 can be used as output from the
invertingOscillator amplifier.If the Internal Calibrated
RC Oscillator is used as chip clock source, PB7..6 is
used as TOSC2..1input for the Asynchronous
Timer/Counter2 if the AS2 bit in ASSR is set.
The various special features of Port B are elaborated in
Alternate Functions of Port B System Clock and
Clock Options .
Port C (PC5..PC0)
Port C is an 7-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). ThePort C output buffers have
symmetrical drive characteristics with both high sink and
sourcecapability. 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.
PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O
pin. Note that the electrical characteristicsof PC6 differ from
those of the other pins of Port C.If the RSTDISBL Fuse is
unprogrammed, PC6 is used as a Reset input. A low level on
this pinfor longer than the minimum pulse length will generate
a Reset, even if the clock is not running.. Shorter pulses are not
guaranteed to generate a Reset.The various special features of
Port C are elaborated on
Port D (PD7..PD0)
Port D is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). ThePort D output buffers have
symmetrical drive characteristics with both high sink and
sourcecapability. As inputs, Port D pins that are externally
pulled low will source current if the pull-upresistors are
activated. The Port D pins are tri-stated when a reset condition
becomes active,even if the clock is not running.Port D also
serves the functions of various special features of the ATmega8
as listed on
RESET
Reset input. A low level on this pin for longer than the
minimum pulse length will generate areset, even if the clock is
not running.
AVCC
AVCC is the supply voltage pin for the A/D Converter, Port C
(3..0), and ADC (7..6). It should beexternally connected to
VCC, even if the ADC is not used. If the ADC is used, it
should be connectedto VCC through lowpass filter. Note that
Port C (5..4) use digital supply voltage, VCC.
AREF

AREF is the analog reference pin for the A/D Converter.


ADC7..6 (TQFP andQFN/MLF PackageOnly)
In the TQFP and QFN/MLF package, ADC7..6 serve as
analog inputs to the A/D converter.These pins are
powered from the analog supply and serve as 10-bit
ADC channels.
BLOCK DIAGRAM OD ATMEGA8:

The AtmelAVR 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 independentregisters to be accessed in one single

instruction executed in one clock cycle. Theresulting


architecture is more code efficient while achieving throughputs
up to ten times fasterthan conventional CISC
microcontrollers.The ATmega8 provides the following
features: 8 Kbytes of In-System Programmable Flash
withRead-While-Write capabilities, 512 bytes of EEPROM, 1
Kbyte of SRAM, 23 general purposeI/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 Two wireSerial
Interface, a 6-channel ADC (eight channels in TQFP and
QFN/MLF packages) with10-bit accuracy, a programmable
Watchdog Timer with Internal Oscillator, an SPI serial port,and
five software selectable power saving modes. The Idle mode
stops the CPU while allowingthe SRAM,Timer/Counters, SPI
port, and interrupt system to continue functioning. The Power
downmode saves the register contents but freezes the
Oscillator, disabling all other chip functionsuntil the next
Interrupt or Hardware Reset. In Power-save mode, the
asynchronous timercontinues 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 asynchronoustimer and ADC, to
minimize switching noise during ADC conversions. In
Standby mode, thecrystal/resonator Oscillator is running while
the rest of the device is sleeping. This allows veryfast start-up
combined with low-power consumption.The device is
manufactured using Atmels high density non-volatile memory
technology. TheFlash Program memory can be reprogrammed
In-System through an SPI serial interface, by aconventional
non-volatile memory programmer, or by an On-chip boot
program running on theAVR core. The boot program can use
any interface to download the application program in the

Application Flash memory. Software in the Boot Flash Section


will continue to run while theApplication Flash Section is
updated, providing true Read-While-Write operation. By
combiningan 8-bit RISC CPU with In-System SelfProgrammable Flash on a monolithic chip, the AtmelATmega8
is a powerful microcontroller that provides a highly-flexible
and cost-effective solutionto many embedded control
applications.
The ATmega8 is supported with a full suite of program and
system development tools, includingC compilers, macro
assemblers, program simulators, and evaluation kits.

IR SENSOR:

The IR Sensor-Single is a general purpose proximity sensor. Here


we use it for collision detection. The module consist of a IR
emitter and IR receiver pair. The high precision IR receiver always
detects a IR signal.

The module consists of 358 comparator IC. The output of sensoris


high whenever it IR frequency and low otherwise. The onboardLED indicator helps user to check status of the sensor
without usingany additional hardware.
The power consumption of this module is low. It gives a digital
output.

Principles of Operation:
We have already discussed how a light sensor works. IR Sensors
work by using a specific light sensor to detect a select light
wavelength in the Infra-Red (IR) spectrum. By using an LED
which produces light at the same wavelength as what the sensor is
looking for, you can look at the intensity of the received light.
When an object is close to the sensor, the light from the LED
bounces off the object and into the light sensor. This results in a
large jump in the intensity, which we already know can be
detected using a threshold.

Depiction of the operation of an IR


Sensor:

Detecting Brightness:
o Since the sensor works by
looking for reflected light,
it is possible to have a
sensor that can return the
value of the reflected light.
This type of sensor can
then be used to measure
how "bright" the object is.

This is useful for tasks like


line tracking.

12 V POWER SUPPLY:

Regulated Power supply circuit:


The Power Supply is a Primary requirement for the project
work. The required DC power supply for the base unit as well
as for the recharging unit is derived from the mains line. For
this purpose step down transformer 0-9 is used. From this
transformer we getting 6V power supply. In this +6V output is
a regulated output and it is designed using 7805 positive
voltage regulator. This IC will regulate it to 5v dc output. This
is a 3 Pin voltage regulator, can deliver current up to 800
milliamps. Rectification is a process of rendering an
alternating current or voltage into a unidirectional one. The
component used for rectification is called Rectifier. A
rectifier permits current to flow only during positive half
cycles of the applied AC voltage. Thus, pulsating DC is
obtained to obtain smooth DC power additional filter circuits
required. A diode can be used as rectifier. There are various
types of diodes. However, semiconductor diodes are very
popularly used as rectifiers. A semiconductor diode is a solidstate device consisting of two elements is being an electron
emitter or cathode, the other an electron collector or anode.
Since electrons in a semiconductor diode can flow in one
direction only-form emitter to collector-the diode provides the
unilateral conduction necessary for rectification. The rectified
Output is filtered for smoothening the DC, for this purpose
capacitor is used in the filter circuit. The filter capacitors are
usually connected in parallel with the rectifier output and the
load. The AC can pass through a capacitor but DC cannot, the
ripples are thus limited and the output becomes smoothed.

When the voltage across the capacitor plates tends to rise, it stores
up energy back into voltage and current. Thus, the fluctuation in the
output voltage is reduced considerable

Step Down Transformer

A step down transformer will


step down the voltage from the
ac mains to the required voltage
level. The primary winding of the
step down transformers are
greater than the secondary so the
leakage current to the secondary
is low as compared to primary.
The turns ratio of the transformer is so adjusted such as to obtain
the required voltage value. The output of the transformer is given
as an input to the rectifier circuit.

Diode:
Diodes provide uncontrolled rectification of power and are used
in applications such as
electroplating, anodizing,
battery charging, welding,
power supplies (dc and ac),
and variable frequency drives.
They are also used in feedback
and the freewheeling functions
of converters and snubbers.
Shows the diode symbol and its volt-ampere characteristics. In
the

The typical forward conduction


drop is 1.0 V. This drop will
cause conduction loss, and the
device must be cooled by the
appropriate heat sink to limit the
junction temperature. In the
reverse-biased condition, a small
leakage current flows due to
minority carriers, which
gradually increase with voltage.
If the reverse voltage exceeds a
threshold value, called the
breakdown voltage, the device
goes through avalanche
breakdown, which is when
reverse current becomes large
and the diode is destroyed by heating due to large power
dissipation in the junction.

Voltage regulator:

The LM 78XXX series of the three terminal regulations is


available with several fixed output
voltages making them useful in a wide
range of applications. One of these is
local on card regulation. The voltages
available allow these regulators to be
used in logic

solid state electronic equipment.


Although designed primarily as
fixed voltage regulators, these
devices can be used with external
components to obtain adjustable
voltages and currents systems,
instrumentation .
The LM78XX series is available
in aluminum to 3 packages which will allow over 1.5A load
current if adequate heat sinking is provided. Current limiting is
included to limit the peak output current to a safe value. The
LM 78XX is available in the metal 3 leads to 5 and the plastic
to 92. For this type, with adequate heat sinking. The regulator
can deliver 100mA output current. The advantage of this type
of regulator is, it is easy to use and minimize the number of
external components.

The positive voltage regulator has different


features like

Output current up to 1.5A


No external components
Internal thermal overload protection
High power dissipation capability
Internal short-circuit current limiting
Output transistor safe area compensation

Nominal Output
Voltage
5V
6V
8V
8.5V
10V
12V
15V
18V
24V

Regulator IC'S
A 7805C
A7806C
A7808C
A7885C
A7810C
A7812C
A7815C
A7818C
A7824C

SERIAL CABLE:
This cable is one type of female cable is used i circuit
for connecting a pcb with the ir sensor circuit.

CONECTING WIRE:
This type of wire is a simple wire for connecting
circuit.

DESIGNING OF CIRCUIT DIAGRAM:

This circuit consists of 4


microcontroller, 4 traffic lights.

IR

sensors,

atmega8

IR transmitter looks like an LED. This IR transmitter


always emits IR rays from it. The operating voltage of this
IR transmitter is 2 to 3v. These IR (infra red) rays are
invisible to the human eye. But we can view these IR rays
through camera.
IR receiver receives IR rays that are transmitted by IR
transmitter. Normally IR receiver has high resistance in
order of mega ohms, when it is receiving IR rays the
resistance is very low. The operating voltage of IR receiver
also 2 to 3V.
We have to place these IR pair in such a way that when we
place an obstacle in front of this IR pair, IR receiver should

be able to receive the IR rays. When we give the power, the


transmitted IR rays hit the object and reflect back to the IR
receiver.
Instead of traffic lights, you can use LEDs (RED, GREEN,

YELLOW). In normal traffic system, you have to glow the


LEDs on time basis. If the traffic density is high on any
particular path, then glows green LED of that particular
path and glows the red LEDs for remaining paths. In
normal traffic system, we allow the traffic for a time delay of 1
minute for each path.

CIRCUIT DIAGRAM:

Power circuit:
EXPLANATION OF CIRCUIT DIAGRAM:
CONECTION OF CIRCUIT DIAGRAM:
Connect 12V battery or adaptor to the development
board.
Switch on the supply.
Burn the program to the ATmega8 microcontroller by
keeping the programming switch sw2 in program
mode.
Connect four IR sensors to PORT C.
Connect Traffic lights to PORT B and PORT D.

WORKING OF CIRCUIT DIAGRAM:


FIRST OF ALL SWITCHE ON THE POWER
SUPLLY.
NOW THE CIRCUIT IS ON AND ITS STARTED
WORKING
AT THIS MOVEMENT CIRCUIT IS WORKING
ON NORMAL POSITION WITH REGULAR TIME
DELAY.
WHEN THE IR IR SENSOR DETECT HIGH
DENSITY OF TRAFIC IT CREAT A LOGIC 1 FOR
THAT ATMEGHA8 FOR CORRESPONDING PIN.
LOGIC 1 IS GIVEN TO THE AATMEGA8 AT
PORT C
WE ARE ALREADY CODED THE ATMEGA8
WHEN LOGIC IS HIGH OR 1 MICRO
CANTROLLER SET A 07 SEC.TIMMING DELAY
FOR THE HIGH DENSITY ROAD

AS PER ABOVE STEP OTHER IR SENSOR


WORKS.
AS PER ABOVE STEP CIRCUIT WORKS.
Finally, turn off the board power supply.

ADVANTAGES&DISADVANT
AGE

ADVANTAGES:
LESS AIR POLUTION
LESS NOICE POLUTON
SAVING OF TIME
SAVING OF FUEL

DISADVANTAGES:
1. IR sensors sometimes may absorb normal light also. As a
result, traffic system works in improper way.
2. IR sensors work only for fewer distances.
3. We have to arrange IR sensors in accurate manner
otherwise they may not detect the traffic density.

APPLICATION:

This project is mainly used to control the traffic


in metropolitan cities.

FUTURE PLANING

FUTURE PLANING
In future this system can be used to inform people
about different places traffic condition.
Data transfer between the microcontroller and
computer can also be done through telephone
network, data call activated SIM.
This technique allows the operator to gather the
recorded data from a far end to his home computer
without going there.
Traffic lights can be increased to N number and
traffic light control can be done for whole city by
sitting on a single place.

Distribution of work :
Monil

For Project Report Typing, Editing,


Circuit design.

Sagar

For Project Report Collect information,


Photos, videos, searches, paragraphs, etc...
From Internet & another books like.
1. Transportation & traffic theory in the
21st century.
2. Research on traffic corridor control
3. Work zone traffic control

Bhadresh
&
Bhavin :

For Project Report Survey on

Traffic control circuit, Equipments, etc...


We survey from many places like,
Lal Darwaja local market, etc... &
Online products websites like.
Amazon, Flipkart, Snap deal, E-bay,
Shop clues, etc..

Reference from books for project:


1. Transportation & traffic theory in the 21st century
Traffic control is an outdoors occupation, night or day for long hours
in all weathers, and is considered a dangerous occupation due to the high
risk of being struck by passing vehicles. Safety equipment is vitally
important. Fatigue is a big issue, as tired TC's may forget to watch their
traffic, or may inadvertently turn their "Stop bats" to the "Slow" position.
Many drivers are annoyed by the disruption to their route, and some are
sufficiently antisocial as to aim at traffic controllers. Other drivers simply
don't pay enough attention to the road, often from using their mobile (cell-)
phones, or because they are tired from a night shift at work. Not a few are
exceeding the posted speed limit.

2. Research on traffic corridor control


The OECD Group "International Corridor Experiment" (ICE-Project)
was created to examine the strategies available for traffic corridor control
and to outline potential international co-orindated research that could be
performed on a corridor facility of a member country on the basis of the
needs of another member country. The Group's objective was to bring

together and exploit the expertise on traffic control available in participating


OECD countries in order to make the most rapid and efficient impact on the
very complex subject of traffic corridor control. The experience of
developments such as ramp control systems in the United States, coordinated signal control in Europe, and motorist warning systems in Japan
provided the basis for the Group's work. The following five types of
corridors, both in urban and in rural areas (intra-city and inter-city), were
considered within the framework of the programme: 1. Motorway and
motorway; 2. Motorway and co-ordinated area traffic control system; 3.
Motorway and street network (unco-ordinated control); 4. Motorway and
suburban road network (including controlled arterials); 5. Motorway and
rural roads. The report contains six chapters, a list of key references and
eight annexes.

3. Work zone traffic control


The purpose of work zone traffic control is to provide a safe work
area for workers within the roadway, while facilitating the safe and orderly
flow of all road users (motorists, bicyclists and pedestrians including
persons with disabilities in accordance with the Americans with Disabilities
Act of 1990) through the work zone.

You might also like