Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

CHAPTER 01:

1.1 INTRODUCTION:
The normal function of traffic lights requires more than sight control coordination to ensure
that traffic and pedestrians moves as smoothly, and safety as possible.

Traffic lights also known as traffic lamps, traffic signals, stoplight, stop and go lights robots,
are signaling devices positioned at pedestrian crossings, road intersections, other locations so
control and competing flows of traffic. Traffic lights have installed in most cities around the
world to control the flow of traffic. It assigns the right of way to road users by the use of
lights in standard colors (Red, Yellow, and Green) using universal color code (and a precise
sequence, for blind). Traffic lights are used at busy intersections to more evenly apportion
delay to the various users. The increasing amount of traffic in the cities has a large impact on
the congestion and the time it takes to reach a certain destination.

A traffic light plays a very important role to control the vehicles on the busy roads. Nowadays
there are occurring many accidents because of the lack of properly maintained traffic signals.
Besides, it creates a huge traffic jam. For example in most populated cities, the flow of
vehicles in most of the crossways is not properly maintained. As a result, the populated cities
are badly affected by traffic jam. The traffic light controller can be used to solve the traffic
problem.

To solve this congestion, we have to build new facilities and infrastructure. The only
disadvantage of making new roads on facilities in that makes the surroundings more
congested. So, for that reason we need to change the system rather than making new
infrastructure twice. The main goal of this is to improve safety, minimizing travel time and
increasing the capacity of infrastructure. Such improvements are beneficial to health,
economy and the environment. Measurably improve traffic flow, reduce environmental
pollution caused by traffic most importantly increases road safety. Control down to four
phases traffic system with the traffic flow optimization strategies are the main role of this
project.

1.2 BLOCK DIAGRAM:

DEPT OF EEE,SCE 1|Page


TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

POWER SUPPLY

RED LED

ARDUINO
MICROCONTROLLER

(ATMEGA 328P) YELLOW


LED

GREEN LED

Fig 1.2.1: Block diagram of Traffic light controller by ARDUINO Microcontroller

BLOCK DIAGRAM DESCRIPTION:-

 POWER SUPPLY: ARDUINO boards can operate satisfactorily on the power that is
available from the USB port. It provides 5v Dc voltage and can be sourced from the port
from a PC, wall socket adapter or portable power bank. In this 5v power supply is given
as the input to AURDUINO Microcontroller (ATmega328p).
 ARDUINO MICROCONTROLLER: ARDUINO boards are able to read inputs like light
on a sensor , a finger on a button , or a message-and turn it into an output – like activating
a motor , publishing something online, turning on LED etc. Here ARDUINO
microcontroller is receiving the input from power supply of 5v and in turn provides the
output by turning on the LEDs.
 LED(Light Emitting Diode):- The LEDs are small individual electronic lights created
using applied voltage to a semiconductor chip and reflector inside a small colored lens or
outer casing. These LEDs will be glowing in a particular sequence to form an actual
traffic light controller system.

DEPT OF EEE,SCE 2|Page


TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

 LEDs are increasingly common in street lights, parking garage lighting, walkway and
outdoor area lighting, refrigerated case lighting, modular lighting, and task lighting, etc.

1.3 OBJECTIVES:

 To design and implement an automatic traffic control system.


 To develop a suitable algorithm to implement the design.
 To stimulate the automatic traffic control.

CHAPTER 02:

2.1 LITERATURE REVIEW:

On 10th December 1868, the first traffic light was installed outside the British house of
parliament in London, by the railway engineer J.P.Knight.

They resembled railway signals of the time, with semaphore arms and red and Green gas
lamps for night use. The gas lantern was turned with lever at its base so that the appropriate
light faced Traffic unfortunately, it exploited on 2nd January 1869, injuring the police men
who was operating it.

The modern electric traffic light is an American invention. As early as 1912 in salt lake city,
Utah, policeman Lester wire invented the first red-green light electric traffic light. On 5
August 1914, the American traffic signal company installed a traffic signal system on the
corner of East 105th street and Euclid avenue in Cleveland, Ohio. It has red and green colors
and buzzer, based on the design by James Hooge allowed police and fire station to control
the signals in case of emergency. The first four way three color traffic light was created by
police officer William ports in Detroit, Michigan in 1920. In 1923, Garret Morgan patented a
traffic signal Device. Ashville, Ohio claims to be the location of the oldest working traffic
light in the United States, used at an intersection of public roads at 1982 when it was moved
to a local museum. The first interconnected traffic signal system was installed in Salt Lake
city in 1917 with six connected Intersection controlled simultaneously from a manual switch.

DEPT OF EEE,SCE 3|Page


TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

Automatic control of interconnected traffic lights was introduced March 1922 in hosting
Texas.

The first automatic experimental traffic lights in England were deployed in Wolver Hamton
in 1927. From the past decades, management of traffic has been one of the biggest issues of
modernization. Researchers have followed a long way to overcome the traffic crises. Right
from the very beginning of " Manual Traffic Control " in which man power was required to
control the traffic. Depending on countries and states the traffic polices are allotted to
different areas to control traffic. They men carry sign board; sign light and whistle to control
the traffic. They are instructed to wear uniforms in order to be easily identified by the drivers

K.Vidhya Proposed a traffic signal system which changes the signal timings
automatically by sensing traffic at the junctions.

In major cities, the traffic signal timing allotted is fixed. The research mainly Aim to control
the traffic signal by capturing the image and then converting them into gray scale image and
then threshold image. The contour image helps to count the number of vehicles present in the
junction. The output screen shows the number of vehicle present at the junction and the green
signal will glow based on traffic density. They analyzed the image sequence and then
estimate traffic congestion and finally predict the traffic light timings.

Ms Promila Sinhmar proposed a Intelligent traffic and density control using IR sensors
and microcontroller which optimize traffic light controller using Microcontroller.

The Microcontroller used in this research is ATMEGA328P. When a vehicle is passed on a


road between IR transmitter & IR receiver, the IR system get automatically activated and
counts the number of vehicle present and store in its memory. Based on the vehicle count the
microcontroller takes decision for traffic signals timings

DEPT OF EEE,SCE 4|Page


TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

CHAPTER 03:

COMPONENTS DESCRIPTION

3.1 BREAD BOARD:

A thin plastic board used to hold electronic components (transistors, resistors, chips, etc.) that
are wired together. Used to develop prototypes of electronic circuits, breadboards can be
reused for future jobs. They can be used to create one-of-a-kind systems but rarely become
commercial products.
The breadboard contains spring clip contacts typically arranged in matrices with certain
blocks of clips already wired together. The components and jump wires (assorted wire
lengths with pins at both ends) are plugged into the clips to create the circuit patterns. The
boards also typically include metal strips along the side that are used for common power rails
and signal buses

fig 3.1.1: Breadboard

3.2 JUMPERS:

A jump wire (also known as jumper, jumper wire, DuPont wire) is an electrical wire, or group
of them in a cable, with a connector or pin at each end (or sometimes without them – simply
"tinned"), which is normally used to interconnect the components of a breadboard or other
prototype or test circuit, internally or with other equipment or components, without soldering.

DEPT OF EEE,SCE 5|Page


TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

Individual jump wires are fitted by inserting their "end connectors" into the slots provided in
a breadboard, the header connector of a circuit board, or a piece of test equipment.

Fig 3.2.1: jumpers

3.3 LEDs(Light Emitting Diodes):

The LED is a PN junction diode which emits light when an electric current passes through it
in the forward direction. In the LED, the recombination of charge carrier takes place. The
electron from the N-side and hole from P-side are combined and give the energy in the form
of heat and light.

The LED is made up of semiconductor material which is colourless, and the light is radiated
through the junction of the diode. LED lighting products produce light upto 90 percent more
efficiently than incandescent light bulbs.

When a electrical current passes through a microchip, which illuminates the tiny light sources
we call LEDs and result is visible light.

Fig 3.3.1: LED Bulbs

DEPT OF EEE,SCE 6|Page


TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

3.4 ARDUINO UNO BOARD:

The Arduino Uno is an open-source microcontroller board based on the Microchip


ATmega328P microcontroller (MCU) and developed by Arduino.cc and initially released in
2010.The microcontroller board is equipped with sets of digital and analog input/output (I/O)
pins that may be interfaced to various expansion boards (shields) and other circuits. The
board has 14 digital I/O pins (six capable of PWM output), 6 analog I/O pins, and is
programmable with the Arduino IDE (Integrated Development Environment), via a type B
USB cable. It can be powered by a USB cable or a barrel connector that accepts voltages
between 7 and 20 volts, such as a rectangular 9-volt battery. It has the same microcontroller
as the Arduino Nano board, and the same headers as the Leonardo board.

Fig 3.4.1: arduino uno

DEPT OF EEE,SCE 7|Page


TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

CHAPTER 04:
HARDWARE IMPLIMENTATION:

4.1 CIRCUIT DIAGRAM:

Fig 4.1:Circuit diagram of ARDUINO microcontroller

 The circuit design of ARDUINO based traffic light controller system is very simple,
in order to display signals in seconds. We have to connect pin 2 from digital pin is
given as an input to the anode of the red led, pin 3 to the anode of the yellow led, and
pin 4 to the anode of the green led on the bread board, and the ground pin from digital
pin is given to the cathode of the red, yellow, green led’s which acts as an output. The
power supply is inbuilt in ARDUINO UNO acts as an input which accepts the
voltage between 7 to 20 volts. The output can be obtained using a software.

DEPT OF EEE,SCE 8|Page


TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

4.2 HARDWARE IMPLEMENTATION

1. ARDUINO UNO R3
The ARDUINO Uno R3 is a microcontroller board in a view of a changeable, double inline-
bundle (DIP) AT Mega 328 AVR microcontroller. It has 20 progressive info/yield pins (of
which 6 can be used as PWM and 6 can be used as simple source of info). Projects can be put
on to it from the simple to-utilize PC programme. The Arduino has a wide ranging help
network which makes it easy method to start working with integrated gadgets. This is the
third update of the Uno (R3), which has numerous changes:

a) The USB controller chip changed from ATMega 8U2 (8K streak) to ATMega
16U2(16K blaze).This does not build the blaze or RAM accessible to draws.
b) Three new sticks were included, which are all copies of past pins. The I2C
pins(A4,A5) have been likewise been brought out in favour of the board close AREF
there is an IOREF stick beside the reset stick, which is a copy of the 5V stick.
c) The reset catch is currently by the USB connector, making it more open when a shield
is utilised, figure 4.2.1 shows an ARDUINO

Fig 4.2.1:ARDUINO UNO board

DEPT OF EEE,SCE 9|Page


TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

4.3 PIN CONFIGURATION:

Fig 4.3.1:pin configuration

4.3.1 Pin Descriptions


 VCC Digital supply voltage.
 GND Ground.
 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 of

DEPT OF EEE,SCE 10 | P a g e
TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

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.

The various special features of port B are elaborated “Alternate Functions of Port B”

 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.

 PC6/RESET

If the RSTDISBL fuse is programmed, PC6 is used as an input pin. 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. The minimum
pulse length . Shorter pulses are not guaranteed to generate a reset.

The various special features of port C are elaborated “Alternate Functions of Port C”.

 Port D (PD7:0)

Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The port D output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, port D pins that are externally pulled low will source current if
the pull-up resistors are activated. The port D pins are tri-stated when a reset condition
becomes active, even if the clock is not running. The various special features of port D are
elaborated “Alternate Functions of Port D”

 ANALOG VCC

DEPT OF EEE,SCE 11 | P a g e
TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

 AVCC is the supply voltage pin for the A/D converter, PC3:0, and ADC7:6. It should
be externally connected to VCC, even if the ADC is not used. If the ADC is used, it
should be connected to VCC through a low-pass filter. Note that PC6.4 use digital
supply voltage, VCC.
 ANALOG REF

AREF is the reference pin for the A/D converter.

 ADC7:6 (TQFP and QFN/MLF Package Only)

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.

SOFTWARE IMPLIMENTATION
Upload the code to Arduino UNO and Power on the system.

PROGRAM

int red = 2;

int green = 3;

int yellow = 4;

void setup( )

// put setup code here, to run once:

Serial.begin(9600);

pinMode(red,OUTPUT);

pinMode(green,OUTPUT);

pinMode(yellow,OUTPUT);

void loop( )

DEPT OF EEE,SCE 12 | P a g e
TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

// put main code here, to run repeatedly:

digitalWrite(red,1);

delay(3000);

digitalWrite(red,0);

digitalWrite(yellow, 1);

delay(1000);

digitalWrite(yellow, 0);

digitalWrite(green,1); //1

delay(3000);

digitalWrite(green,0);

delay(500);

digitalWrite(green,1); //2

delay(500);

digitalWrite(green,0);

delay(500);

digitalWrite(green,1); //3

delay(500);

digitalWrite(green,0);

4.4 OVERVIEW:

The Atmel® ATmega328P is a low-power CMOS 8-bit microcontroller based on the AVR®
enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the
ATmega328P achieves throughputs approaching 1MIPS per MHz
allowing the system designer to optimize power consumption versus processing speed.

DEPT OF EEE,SCE 13 | P a g e
TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

4.5 WORKING:

The model works on the principle of changing of traffic signals based on the density through
an assigned section of the road. Traffic lights are used to control the vehicular traffic. That’s
why traffic lights are used to avoid the traffic lights are used to avoid the traffic jams and
accidents. There are three lights in the traffic signal, having different message for the drivers.
Red light instruct the driver to stop, green light instruct the driver GO through the intersection
whereas the yellow light alerts the drivers. In this project we are going to obtain the output by
uploading the program in the ARDUINO software. And connections are done in the code by
connecting the anode of the Red, Yellow and Green LEDs with the digital pins 2, 3, and 4
respectively. And cathode of the Red, Yellow and Green LEDs are directly connected to the
ground. Code for this traffic light controller is simple and easy to understand. The LEDs will
be glowing in a particular sequence to form actual traffic light controller system. In the void
setup of the code, we have defined the pins for the LEDs as outputs from 2 to 10. In the void
loop section, we have defined the functions to turn ON and OFF into the sequence.
ARDUINO is a inbuilt IR sensors , sensors consists of IR transmitter and IR receiver just as
the name suggest, IR transmitter transmits the IR rays and the receiver is responsible to
receive the rays. The whole system is controlled by the Microcontroller, which is ARDUINO.
Since LEDs are powered by ARDUINO, when ARUINO stimulates then LEDs start blinking.

DEPT OF EEE,SCE 14 | P a g e
TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

CHAPTER 05

RESULT AND DISCUSSION


5.1 RESULT:
Traffic control system is mainly designed to reduce traffic problem, that is in general the one
side of the roads at a signal point are controlled using the traffic signal system. Traffic signal
system shows the signals in seconds. When an intersection is jammed, they will adjust timing
to let traffic flow better. Traffic only moves from north to south and vice versa at the same
time, and at this time traffic from the east and west is stopped. In this case the controller
considers the combination of north and south as that of one side and who’s of the east and
west combined as another side.

Fig 5.1.1:Project output

5.2 DISCUSSION:
Based on the analysis of the traffic control system, the following assumptions became
necessary in order to develop a feasible system.

Traffic only moves from north to south and vice versa at the same time , and at this time
traffic from the east and west is stopped. In this case the controller considers the combination
of north and south as that of one side and who’s of the east and west combined as another
side.

DEPT OF EEE,SCE 15 | P a g e
TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

CHAPTER 06

CONCLUSION AND FUTURE SCOPE OF WORK

6.1 CONCLUSION:
In this project we have implemented an ARDUINO based Traffic Light Control system. The
hardware equipment is tested using an software program and result is obtained. This project
is cost effective. Implementation of this project is cost effective. Implementation of this
project in present day will effectively solve the traffic congestion which is a severe problem
in many modern cities all over the world. This proposed system will be able to build a
developed country with less traffic jams and it will also help the emergency vehicle to reach
in time to the destination.

6.2 FUTURE SCOPE OF WORK:


As the systems take care of few drawbacks of the existing system, there is scope for further
improvement and expansion of this work. The system that can be expanded with smart traffic
light control and congestion avoidance system during emergencies, emergency cars such as
fire engines and ambulance and have priority over the traffic. This system gives highest
priority to emergency vehicle to pass them. This can save their time expansion for reaching
the proposed destination and can prevent the loss of human life up the great extent.

DEPT OF EEE,SCE 16 | P a g e
TRAFFIC LIGHT CONTROLLER USING 8051 MICROCONTROLLER 2022-2023

REFERENCES:

 J. H. P. P. A Amit Bhat , Kaushik Roy, “Design and implementation of a intelligent


traffic control system, “UKSIM-AMSS International Conference on Model and
simulation.
 C. B. P. K.P. S. C. Chandrashekar M, Saikrishna C, “Traffic control using digital
image processing.
 B.B. K Vidhya, “Density based traffic signal system, “International Journal of
Innovative Research in science, Engineering and Technology.
 Z .A Promila Sinhmar, “Intelligent traffic light and density control using IR sensors
and microcontrollers, “International Journal of Advanced Technology and
Engineering Research.
 A.M.S Khalil M. Yousef, Jamal N.AL-Karaki, “Intelligent traffic light flow control
system using wireless sensors networks, “Jounal of Information science and
Engineering.
 T. K.A.D. Jhadhav , Bhor Madhuri, “Intelligent traffic light control system, “4th IRF
International Conference , ISBN: 978-93-82702-66-5.

DEPT OF EEE,SCE 17 | P a g e

You might also like