Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
338 views

Arduino Based Traffic Light Control System

This document describes an Arduino-based traffic light control system. It discusses the background and objectives of the project, which are to control traffic movement and reduce accidents. The methodology involves researching literature, selecting hardware components like LEDs and the Arduino microcontroller, and developing the software. The significance is to understand microcontroller principles and traffic light rules. The system is intended to help manage traffic congestion in cities.

Uploaded by

Soresa Jemal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
338 views

Arduino Based Traffic Light Control System

This document describes an Arduino-based traffic light control system. It discusses the background and objectives of the project, which are to control traffic movement and reduce accidents. The methodology involves researching literature, selecting hardware components like LEDs and the Arduino microcontroller, and developing the software. The significance is to understand microcontroller principles and traffic light rules. The system is intended to help manage traffic congestion in cities.

Uploaded by

Soresa Jemal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Arduino Based Traffic Light Control System 2008 E.

CHAPTER ONE
INTRODUCTION
1.1Background
A traffic light is a collection of two or more colored lights found at some
junctions and pedestrian crossings which indicates whether it is safe and/or legal
to continue across the path of other road users. Traffic light which is one of the vital
public facilities plays an important role to the road user. It helps to control from accidents
and gridlocks. This research exposes the operation of traffic light such as understanding
the flow of the traffic system and the problem itself. Traffic signal light will use to
control the movement of vehicles and passengers, so that the traffic can flow smoothly
and safely. It will improve the road safety and reduce overcrowding by providing the
signal orderly through the junction. Traffic control lights will provide for traffic control
on streets and highways, especially at junctions.
The traffic signals will cyclically display through a suitable timing and control
mechanism. A traffic light has three colors which are red, yellow and green. Every color
carries a certain sign. The red light means the road user has to stop driving and not
crossing or pursuing the ride while the yellow light show that the road user has to ready
to stop their ride. However if the user is too close to the line that is not safe for a stop
they have to continue the ride. The green light shows the road user can continue their
journey only with the absence of any obstacle. Driving through a red light without
justification may be a citation able traffic offense.
Traffic congestion is a severe problem in many modern cities around the world. Traffic
congestion has been causing many critical problems and challenges in the major and most
populated cities. To travel to different places within the city is becoming more difficult
for the travelers in traffic. Due to these congestion problems, people lose time, miss
opportunities, and get frustrated. Traffic congestion directly impacts the companies. Due
to traffic congestions there is a loss in productivity from workers, trade opportunities are
lost, delivery gets delayed, and thereby the costs goes on increasing. To solve these
congestion problems, we have to build new facilities & infrastructure but at the same
time make it smart.

WSU Electrical and Computer Engineering


Page 1
Arduino Based Traffic Light Control System 2008 E.C

The only disadvantage of making new roads on facilities is that it makes the
surroundings more congested. So for that reason we need to change the system rather
than making new infrastructure twice.
Therefore many countries are working to manage their existing transportation systems to
improve mobility, safety and traffic flows in order to reduce the demand of vehicle use.
The project uses simple Electronic components such as LED as TRAFFIC LIGHT
indicator and a MICROCONTROLLER for auto change of signal after a pre-specified
time interval. Microcontroller Arduino Uno R3 is the brain of the project which initiates
the traffic signal at a junction. The LED’s are automatically on and off by making the
corresponding port pin of the micro controller high. A seven segment display also
connected to display the timing of each signal. At a particular instant only one green light
holds and other lights hold at red. During transition from green to red, the present group
yellow led and succeeding group yellow led glows and then succeeding group led
changes to green. This process continues as a cycle.
1.2 Objective of the project
1.2.1. General Objective

 The main aim of this project is to monitor and control traffic movement and to reduce
traffic injure.

1.2.2. Specific Objective


The main objective of the study includes:
 To Provide for orderly movement of traffic
 To Interrupt heavy traffic to allow pedestrians to pass
 To reduce traffic accident
 To investigate the practicality of the theoretical knowledge about these components
to be used.
 To investigate the extent to which the design and construction of the control unit can
be useful to mankind.
 To investigate the immediate usefulness of the control system as complimentary to
traffic,wardens.

WSU Electrical and Computer Engineering


Page 2
Arduino Based Traffic Light Control System 2008 E.C

1.3 Scope of the study


The scope of this project covers on the design and programming of a crossroad traffic
light system and simulate a model of four way junction of a traffic light system using
arduino uno micro controller.
The larger application of this project work is found in most of our mega cities like Addis
Ababa, Bahir Dar, and Hawassa, to control and manage heavy traffic congestion.
1.4. Statement of Problem
The monitoring and control of city traffic light is becoming a major problem in our
countries. The increasing number of vehicles and the lower phase of highways
developments have led to traffic congestion problem especially in major cities such as
Addis Ababa, Bahir Dar, and Hawassa,. Travel time, environment quality, life quality,
and road safety are all adversely affected as a result of traffic congestions. In addition,
delays due to traffic congestions also indirectly affect productivity, efficiency, and energy
losses.
There are many factors that lead to traffic congestion such as the density of vehicles on
the roads, human habits, social behavior, and traffic light system. One major factor is due
to the traffic lights system that controls the traffic at junction. Traffic policeman are
deployed at traffic intersection everyday in order to overcome these congestion during
peak hour, thus one of the roots of the problem is due to ineffective traffic lights
controllers. With effective control the intersection, it is believed that the overall capacity
and performance of urban traffic network could be resolve.
1.5 Methodology
This report is structured to follow the history and origin of traffic light system all through
the design and implementation phase. Methodology includes the following concepts as
they relate to a particular discipline or field of inquiry:
 A collection of theories, concepts or ideas
 Relative study of different approaches
 Analysis of the individual methods

WSU Electrical and Computer Engineering


Page 3
Arduino Based Traffic Light Control System 2008 E.C

1.5.1 System Development of Methodology


For this project work we follow the following methodology

Searching and studying of related literature

Studying and selecting of the required


materials

Determine the specification


of the selecting material Software
Hardware
Component
component

Developing simulation

Testing and implementing of the


system

Figure 1.1: Methodology of the project

WSU Electrical and Computer Engineering


Page 4
Arduino Based Traffic Light Control System 2008 E.C

1.5.2 System Development Tools


In this project we use some of component are shown below
 LED
 LCD
 Arduino Uno R3 microcontroller (The brain of the system).
 Power supply
 OR gate
 NOT gate
 NOR gate
 Proteus
 Arduino IDE
1.5.3 Hard ware development component
 LED
 LCD
 Arduino Uno R3 microcontroller (The brain of the system).
 Power supply
 OR gate
 NOT gate
 NOR gate
1.5.4 Software development component
 Proteus
 Arduino IDE

WSU Electrical and Computer Engineering


Page 5
Arduino Based Traffic Light Control System 2008 E.C

1.6 Significant of Study


Traffic light is the common use in our journey. Traffic light is very important to reduce
accidents on the period of travel. It is necessary to introduce the construction of traffic
lights using arduino microcontroller. The main Significant of this project is to understand
the basic principle operation of arduino microcontroller, and to know the rule and
regulation of traffic light.
The usage of arduino microcontroller in this project gives an experience on how to
automate the traffic light control system.
1.7 Organization of the project
This final thesis is composed of five chapters
Chapter 1; introduces overall background information of the system. This includes
Background, problem statement, Significant of Study, objective, its scope and
methodology of the project.
Chapter 2; focuses revision of related literatures to this system.
Chapter 3;system design and detail analysis of the system components.
Chapter 4; investigates the observed results and discussions.
Chapter 5; summarizes the conclusion and recommendation for future work.

WSU Electrical and Computer Engineering


Page 6
Arduino Based Traffic Light Control System 2008 E.C

CHAPTER TWO

LITERATURE REVIEW

2.1 Introduction
On 10 December 1868, the first non-electric, gas lit, traffic lights were installed outside
the British Houses of Parliament in London to control the traffic in Bridge Street, Great
George Street and Parliament Street. They were promoted by the railway engineer J. P.
Knight and constructed by the railway signal engineers of Saxby& Farmer. The design
combined three semaphore arms with red and green gas lamps for night-time use, on a
pillar, operated by a police constable. The gas lantern was manually turned by a traffic
police officer, with a lever at its base so that the appropriate light faced traffic.
Although it was said to be successful at controlling traffic, its operational life was brief. It
exploded on 2 January 1869, as a result of a leak in one of the gas lines underneath the
pavement, injuring or killing the policeman who was operating it. With doubts about its
safety, the concept was abandoned until electric signals became available.
The first electric traffic light was developed in 1912 by Lester Wire, an American
policeman of Salt Lake City, Utah, who also used red-green lights. 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 had two colors, red and
green, and a buzzer, based on the design of James Hoge, to provide a warning for color
changes. The design by James Hoge allowed police and fire stations to control the signals
in case of emergency [5].
The first four-way, three-color traffic light was created by police officer William Potts in
Detroit, Michigan in 1920. Ashville, Ohio claims to be the home of the oldest working
traffic light in the United States, used at an intersection of public roads from 1932 to
1982 when it was moved to a local museum [13].

WSU Electrical and Computer Engineering


Page 7
Arduino Based Traffic Light Control System 2008 E.C

The first interconnected traffic signal system was installed in Salt Lake City in 1917, with
six connected intersections controlled simultaneously from a manual switch. The modern
traffic light was invented in America. New York had installed a three color systemin1918
which was operated manually from a tower in the middle of the street. In 1923 Garrett
Morgan patented an electric traffic light system using a pole with a cross section on
which the words STOP and GO were illuminated. In 1926, first automatic signals were
installed in London; they depended on a timer to activate them.
Countdown timers on traffic lights were introduced in the 1990s. Timers are useful for
pedestrians, to plan if there is enough time to attempt to cross the intersection before the
end of the walk phase, and for drivers, to know amount of time before the light turns
green. In the United States, timers for vehicle traffic are prohibited, and pedestrian timers
are now required on new or upgraded signals on wider roadways.
Traffic light, also known as a traffic signal, stop light, stop-and-go lights, robot or
semaphore, 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 (and a precise sequence, for those that are colors blind). The first four-way
traffic signal tower in the world was located at the Woodward and Michigan Avenue
intersection in October, 1920. The tower was manually operated and had 12 lamps, three
in each direction. In December, 1920, signals were added along Woodward Avenue at
Grand River, State, Fort and Congress, but all were controlled from the manual tower at
Woodward and Michigan [4],[5],[13].

WSU Electrical and Computer Engineering


Page 8
Arduino Based Traffic Light Control System 2008 E.C

Figure 2.1: the first signal tower with automatic lights, at Michigan and Woodward.
The tremendously increased number of vehicles on our roads and the overwhelming army
of pedestrians on road sideways call for great concern. The numerous avoidable accidents
at junctions be it T-junction, 4-way junction is acknowledged not only by Government
but also by the people themselves. The services of our traffic wardens as well as that of
the policemen no longer contain adequately the situation more so when they cannot carry
out a twenty-four hour duty. This situation calls for remedy or assistance of some sort,
not only to save lives but also to ensure orderliness in our everyday life. Electronic
devices, which can do services, round the clock, throughout dry or rainy seasons, winter
or summer are called into play this indispensable role. Attempt will be made to design,
and construct a three-way traffic light controller system. Traffic lights, also known as
traffic signals, traffic lamps, signal lights, and robots, are signaling devices positioned at
road intersections, pedestrian crossings and other locations to control competing flows of
traffic. Traffic lights alternate the right of way accorded to road users by displaying lights
of a standard color (red, amber/yellow, and green) following a universal color code [3 ].

WSU Electrical and Computer Engineering


Page 9
Arduino Based Traffic Light Control System 2008 E.C

2.2 The Basics of Traffic light


Traffic Lights - Various combinations of traffic lights are placed at intersections to
control traffic. The most basic traffic light consists of three bulbs with different
colored lenses, which from top to bottom are red, yellow and green. Each of these
devices is a traffic signal. All traffic signals have specific colors and its own meaning.
Red means stop. Yellow means caution: be ready to stop and to go. Green means go:
proceed if the way is clear and safe.
Traffic lights alternate the right of way accorded to road users by displaying lights of a
standard color (red, yellow, and green) following a universal color code. In the typical
sequence of color phases: the green light allows traffic to proceed in the direction
denoted, if it is safe to do so the yellow light provides warning that the signal will be
changing from green to red (and from red to green in certain countries, such as England.
Actions required by drivers vary, with some jurisdictions requiring drivers to stop if it is
safe to do so, and others allowing drivers to go through the intersection if safe to do so. A
flashing yellow indication is a warning signal the red signal prohibits any traffic from
proceeding a flashing red indication is treated as a stop sign.
Traffic signals will go into a flashing mode if the controller detects a problem, such as a
program that tries to display green lights to conflicting traffic. The signal may display
flashing yellow to the main road and flashing red to the side road, or flashing red in all
directions. Flashing operation can also be used during times of day when traffic is light,
such as late at night.

2.3 Traffic Accident


Traffic accident is the result of multiplicity of factors and it is often the interaction of
more than one variable that leads to the occurrence of accident. Accidents occur as a
result of the interaction of many different factors among which are road and traffic
characteristics.

WSU Electrical and Computer Engineering


Page 10
Arduino Based Traffic Light Control System 2008 E.C

Most investigations have revealed that 70% to 80% of all traffic accidents are due to
human error. The term human error however is often controversial for. It doesn’t
satisfactory describe that large number of injuries and deaths that occurs on the road as
the result of driving errors while abilities to do so are impaired by alcohol or drugs, lack
of experience, lack at distribution of attention etc. Car accidents are accidental collisions
between two or more car. It damages one or more autos, people, or structures. Car
accidents also called traffic accidents, auto accidents, road accidents, and motor vehicle
accidents. It causes thousands of deaths and hundreds of thousands of disabilities each
year.
2.3.1 Types of Car Accidents
1). A rear impact, or a rear-end collision
It involves an automobile hitting the car or truck in front of it. The most common way a
rear-end collision occurs is when the car in front makes a sudden stop, perhaps due to
traffic, and the car behind is unable to stop in time .

2). Side Impact


A side collision or broadside collision involves one or more vehicles’ sides being
impacted. The most common form of a side collision is the broadside collision, or a T-
bone collision. This type of car accident involves a vehicle’s front running into the side
of another car.

3). Head-on Collision


A head-on collision is when one vehicle front hits another vehicle front or a stationary
object. This is not only common in cars, but also trains on a one-track lane. With cars,
this happens when one vehicle enters a lane on the opposite side of the street. This is
most common at night when drivers fall asleep, but happens any time because of
interferences or drunk driving.

WSU Electrical and Computer Engineering


Page 11
Arduino Based Traffic Light Control System 2008 E.C

4). Rollover
A rollover is when a vehicle turns over on its side or roof. This type of car accident is
usually caused by a car trying to turn too fast while driving at high speeds or the roll-over
vehicle has a problem with the center of gravity (such as the Ford Explorer rollover
lawsuits in the past few years.

5). Runoff
A runoff collision is when a car runs off of the road and usually only involves one car.
This happens frequently; when the driver is not paying attention or when swerving is
involved in order to avoid hitting another vehicle or animal in the road.
2.3.2. Causes of accidents
Human factors
Human factors in vehicle collisions include all factors related to drivers and other road
users that may contribute to a collision. Examples include driver behavior, visual and
auditory acuity, decision-making ability, and reaction speed.

Motor vehicle speed


Crash is increased both for vehicles traveling slower than the average speed, and for
those traveling above the average speed. The risk of being injured increases exponentially
with speeds much faster than the median speed.

Driver impairment
Driver impairment describes factors that prevent the driver from driving at their normal
level of skill. Common impairments include:
a) Alcohol
b) Driving under the influence
c) Relative risk of an accident based on blood alcohol levels.
d) Physical impairment:-Poor eyesight and/or physical impairment, with many
jurisdictions setting simple sight tests and/or requiring appropriate vehicle
modifications before being allowed to drive.

WSU Electrical and Computer Engineering


Page 12
Arduino Based Traffic Light Control System 2008 E.C

e) Sleep deprivation
 Fatigue
 Drug use
 Distraction
Research suggests that the driver's attention is affected by distracting sounds such as
conversations and operating a mobile phone while driving.
 Road design
 Vehicle design and maintenance
Maintenance: a well-designed and well-maintained vehicle, with good brakes, tires and
well-adjusted suspension will be more controllable in an emergency and thus be better
equipped to avoid collisions.

Junction Type
There are majority of capacity problems occur at the road junction. Due to the various
conflicting demands it is not surprising that two third of traffic accidents occur at road
junction. There are many varying junction types, in detail, but they can be broken in to
five basic types.
1. Un– controlled non – priority junctions
2. Priority junctions
3. Roundabout
4. Traffic signal
5. Grade separation.
Vehicle speeds are affected by many factors including speed limit, horizontal and vertical
alignment, visibility, and highway cross sections, spacing of junctions, accesses,
pedestrian crossings and maintenance standards.
The four ways junction is simulated by using Proteus software. This traffic light model is
simulated to understand how this traffic light control system is running.
This traffic light model has a complete set of traffic light signal which are red, yellow
and green. The four ways junction is developed to display the simulation and the
development of the new traffic light control system.

WSU Electrical and Computer Engineering


Page 13
Arduino Based Traffic Light Control System 2008 E.C

Every traffic lane and traffic light signals have been labeled with alphabet A, B, C and D
to separate each lane and traffic light. Each traffic light lane has their set of traffic light
signal “Red, Yellow, and Green”. This traffic light signal operates similar like common
traffic light signal. It changes from red to yellow and then green and after that back to red
signal.

2.4. Advantages of a good Traffic Control System


A properly ordered traffic control system can provide for orderly movement of traffic,
Increase capacity at intersection, Reduce frequency and severity of certain kind of
clashes, Provide continuous movement of traffic at a desired speed, Interrupt heavy
traffic to allow pedestrians to pass, effectively perform traffic management. But using a
generalized traffic control system fails to detect high priority situations or emergency
conditions. Hence the need for a Traffic Control System arises which would work on
certain conditions and be able to take decisions automatically.
The traffic light system will also save the motorists’ time and reduce their frustration
while waiting for the lights to change since it helps in reducing congestion at the traffic
intersections.

WSU Electrical and Computer Engineering


Page 14
Arduino Based Traffic Light Control System 2008 E.C

Fig2.2. Four ways Road

WSU Electrical and Computer Engineering


Page 15
Arduino Based Traffic Light Control System 2008 E.C

CHAPTER THREE
SYSTEM DESIGN AND DESCRIPTION
3.1 Traffic Light Control System
Traffic Control Systems are used at a point where there are more than two paths for
passage of vehicles or wherever passage is to be given to pedestrians to cross a road. It is
also used wherever two paths cross each other thus creating a four-way lane. These
systems are also put in place at points where there are by-lanes attached to the main road.
The main aim of a traffic control system is to control the flow of vehicles through a lane
and prevent accidents or road blockage. These systems are also used at points wherever a
vehicle needs to be stopped for any purpose.
3.1.1 Functional block diagram of Traffic Light control system

Fig3.1:-Functional block diagram of Traffic Light control system

WSU Electrical and Computer Engineering


Page 16
Arduino Based Traffic Light Control System 2008 E.C

3.2. Components of MC Based Traffic Light Controller


The components are as follows:
 LED
 LCD
 Arduino Uno R3 microcontroller (The brain of the system).
 Power supply
 OR gate
 NOT gate
 NOR gate
3.3. Hardware Description
This project uses Arduino Uno to controls the LED. The Arduino Board is programmed
using the Arduino IDE software. All components are used in this project described as
follow.
3.3.1. Arduino Uno R3 Microcontroller
The microcontroller IC which we used is Arduino Uno. The Arduino Uno is a
microcontroller board based on the ATmega328. It has 20 digital input/output pins of
which 6 can be used as PWM outputs and 6 can be used as analog inputs, a 16 MHz
resonator, a USB connection, a power jack, an in-circuit system programming (ICSP)
header, and a reset button. It contains everything needed to support the microcontroller;
simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter
or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega16U2 programmed as a USB-to-serial
converter. This auxiliary microcontroller has its own USB boot loader, which allows
advanced users to reprogram it.
Therefore in order to achieve this task the Arduino mega microcontroller based on
ATmega328 was chosen because of its suitability for this project such as speed, power
consumption, and universal synchronous asynchronous receiver transmitter (USART)
functionality, in built ADC, and amount of RAM and ROM on the chip.

WSU Electrical and Computer Engineering


Page 17
Arduino Based Traffic Light Control System 2008 E.C

A microcontroller (sometimes abbreviated μC, uC or MCU) is a small computer on a


single integrated circuit containing a processor core, memory, and programmable
input/output peripherals.
Microcontrollers are designed for embedded applications, in contrast to the
microprocessors used in personal computers or other general purpose applications.
Microcontrollers are used in automatically controlled products and devices, such as
automobile engine control systems, implantable medical devices, remote controls, office
machines, appliances, power tools, toys and other embedded systems.
By reducing the size and cost compared to a design that uses a separate microprocessor,
memory, and input/output devices, microcontrollers make it economical to digitally
control even more devices and processes. Mixed signal microcontrollers are common,
integrating analog components needed to control non-digital electronic systems. Arduino
is an open-source physical computing platform based on a simple microcontroller board,
and a development environment for writing software for the board. Arduino can be used
to develop interactive objects, taking inputs from a variety of switches or sensors, and
controlling a variety of lights, motors, and other physical outputs. The boards can be
assembled by hand or purchased preassembled; the open-source IDE can be downloaded
for free.
The Arduino programming language is an implementation of Wiring, a similar physical
computing platform, which is based on the Processing multimedia programming
environment.

WSU Electrical and Computer Engineering


Page 18
Arduino Based Traffic Light Control System 2008 E.C

Fig3.2 Arduino uno micro controller


Pin Configuration
The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically .External (non-USB) power can come
either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by
plugging a 2.1mm center-positive plug into the board’s power jack. Leads from a battery
can be inserted in the Ground and Vin pin headers of the power connector. The board can
operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the
5V pin may supply less than five volts and the board may be unstable.
If using more than 12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.
The power pins are as follows:
VIN: The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source).

WSU Electrical and Computer Engineering


Page 19
Arduino Based Traffic Light Control System 2008 E.C

5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V),
or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses
the regulator, and can damage your board.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50
mA.
GND: Ground pins.
IOREF: This pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin voltage
and select the appropriate power source or enable voltage translators on the outputs for
working with the 5V or 3.3V.
AREF: Reference voltage for the analog inputs. Used with analog Reference ().
Reset: Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.
Memory
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM.
Input and Output
Each of the 14 digital pins on the Uno can be used as an input or output, using pin
Mode(),digital Write( ), and digital Read( ) functions. They operate at 5 volts. Each pin
can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50kohms. In addition, some pins have specialized
functions.
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the ATmega8U2 USB-to- TTL
Serial chip .
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value. See the attach Interrupt ()
function for details.

WSU Electrical and Computer Engineering


Page 20
Arduino Based Traffic Light Control System 2008 E.C

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write ()
function.
SPI:10 (SS), 11 (MOSI),12 (MISO),13 (SCK). These pins support SPI communication
using the SPI library.
LED: 13. There is a built- in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and the
analog Reference() function. Additionally, some pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.
3.3.2 At mega 328p Micro Controller
The 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 1 MIPS per MHz allowing the
system designed to optimize power consumption versus processing speed The
ATmega328P provides the following features: 4K/8K bytes of In-System Programmable
Flash with Read-While-Write capabilities, 23 general purpose I/O lines, 32 general
purpose working registers, three flexible Timer/Counters with compare modes, internal
and external interrupts, a serial programmable USART, a byte-oriented 2-wire Serial
Interface, an SPI serial port, a 6-channel 10-bit ADC and five software selectable power
saving modes. The Idle mode stops the CPU while allowing the SRAM, Timer/Counters,
USART, 2-wire Serial Interface, SPI port, and interrupt system to continue functioning.
The Power-down mode saves the register contents but freezes the Oscillator, disabling all
other chip functions until the next interrupt or hardware reset. In Power-save mode, the
asynchronous timer continues to run, allowing the user to maintain a timer base while the
rest of the device is sleeping.

WSU Electrical and Computer Engineering


Page 21
Arduino Based Traffic Light Control System 2008 E.C

The ADC Noise Reduction mode stops the CPU and all I/O modules except
asynchronous timer and ADC, to minimize switching noise during ADC conversions. In
Standby mode, the crystal/resonator Oscillator is running while the rest of the device is
sleeping. This allows very fast start-up combined with low power consumption. The
AVR core combines a rich instruction set with 32 general purpose working registers. All
the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two
independent registers to be accessed in one single instruction executed in one clock cycle.

Fig3.3: At mega 328p Micro Controller

WSU Electrical and Computer Engineering


Page 22
Arduino Based Traffic Light Control System 2008 E.C

3.3.3. Power Supply


Power supply is a reference to a source 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.
Here in our application we need a 5v DC power supply for all electronics involved in the
project. This requires step down transformer, rectifier, voltage regulator, and filter circuit
for generation of 5v DC power.
Almost all electronics circuit required DC power supply. DC power supply is the circuit
which converts the AC wave form of power lines to direct voltage of constant amplitude
.an ideal regulated power supply is designed to provide a pre-determined Dc voltage
which is independent of the current drown from the source. These circuits are special
class of feedback amplifiers.
All the benefits of TCs’ are thus obtained: excellent performance small size, ease of use,
low cost, and high reliability .unregulated power supply has many disadvantages due to
which it is not sufficient for many application.
 Poor regulation
 Dc output voltage varies with the AC input
 DC output voltage variation varies with temperature because of semiconductor use
to overcome the above disadvantages.
A 5V-dc power requirement will be used as input supply to the system. The choice of
using a transformer is due to the low voltage requirement of the system. A transformer of
240/12V in conjunction with a regulator will be able to provide the needed input 5Vdc.
This means that the RMS value of the transformer secondary is Vrms = 12Vac. The
whole section of the project is powered from a 5V dc power source. To achieve this 5-
volt output, a variable output adapter is used.
The adapter takes in 240Vac and gives out from its variable tapped output V dc, 4.5Vdc,
9Vdc, 12Vdc; the output to the required 5Vdc, the output of the adapter is passed through
the regulator that makes sure that at any point in time, the output it gives is 5V.

WSU Electrical and Computer Engineering


Page 23
Arduino Based Traffic Light Control System 2008 E.C

For convenience, we tap the output of the adapter and hence the input to the regulator at
6Vdc.

Fig3.4. Regulated Power Supply


3.3.3.1 Bridge Rectifier
A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave
rectification. This is a widely used configuration, both with individual diodes wired as
shown and with single component bridges where the diode bridge is wired internally.

Fig3.5.The bridge rectifier

WSU Electrical and Computer Engineering


Page 24
Arduino Based Traffic Light Control System 2008 E.C

3.3.3.2 Voltage Regulator


A voltage regulator is designed to automatically maintain a constant voltage level. A
voltage regulator may be a simple "feed-forward" design or may include negative
feedback control loops. It may use an electromechanical mechanism, or electronic
components.
Depending on the design, it may be used to regulate one or more AC or DC voltages.
Electronic voltage regulators are found in devices such as computer power supplies
where they stabilize the DC voltages used by the processor and other elements. In
automobile alternators and central power station generator plants, voltage regulators
control the output of the plant. In an electric power distribution system, voltage regulators
may be installed at a substation or along distribution lines so that all customers receive
steady voltage independent of how much power is drawn from the line.
Important Parameters
Load regulation: This is the change in output voltage for a given change in load current
(for example: "typically 15 mV, maximum 100 mV for load currents between 5 mA and
1.4 A, at some specified temperature and input voltage").
line regulation or input regulation: This is the degree to which output voltage changes
with input (supply) voltage changes - as a ratio of output to input change (for example
"typically 13 mV/V"), or the output voltage change over the entire specified input voltage
range (for example "plus or minus 2% for input voltages between 90 V and 260 V, 50-60
Hz").
Temperature coefficient: The temperature coefficient of the output voltage is the
change with temperature (perhaps averaged over a given temperature range).
Initial accuracy: The initial accuracy of a voltage regulator (or simply "the voltage
accuracy") reflects the error in output voltage for a fixed regulator without taking into
account temperature or aging effects on output accuracy.
Dropout voltage: This is the minimum difference between input voltage and output
voltage for which the regulator can still supply the specified current.
A low drop-out (LDO) regulator is designed to work well even with an input supply only
a volt or so above the output voltage.

WSU Electrical and Computer Engineering


Page 25
Arduino Based Traffic Light Control System 2008 E.C

The input-output differential at which the voltage regulator will no longer maintain
regulation is the dropout voltage. Further reduction in input voltage will result in reduced
output voltage. This value is dependent on load current and junction temperature.
Absolute maximum ratings: are defined for regulator components, specifying the
maximum input voltage, maximum power dissipation at a given temperature, etc.
Quiescent current: The quiescent current in a regulator circuit is the current drawn
internally, not available to the load, normally measured as the input current while no load
is connected (and hence a source of inefficiency; some linear regulators are, surprisingly,
more efficient at very low current loads than switch-mode designs because of this).
Transient response: is the reaction of a regulator when a (sudden) change of the load
current (called the load transient) or input voltage (called the line transient) occurs.
Some regulators will tend to oscillate or have a slow response time which in some cases
might lead to undesired results. This value is different from the regulation parameters, as
that is the stable situation definition. The transient response shows the behavior of the
regulator on a change. This data is usually provided in the technical documentation of a
regulator and is also dependent on output capacitance.
Mirror-image insertion protection: This means that a regulator is designed for use
when a voltage, usually not higher than the maximum input voltage of the regulator, is
applied to its output pin while its input terminal is at a low voltage, volt-free or grounded.
Some regulators can continuously withstand this situation; others might only manage it
for a limited time such as 60 seconds, as usually specified in the datasheet. This situation
can occur when a three terminal regulator is incorrectly mounted for example on a PCB,
with the output terminal connected to the unregulated DC input and the input connected
to the load. Mirror-image insertion protection is also important when a regulator circuit is
used in battery charging circuits, when external power fails or is not turned on and the
output terminal remains at battery voltage.

WSU Electrical and Computer Engineering


Page 26
Arduino Based Traffic Light Control System 2008 E.C

3.3.3.2.1Electronic Voltage Regulators


A simple voltage regulator can be made from a resistor in series with a diode (or series of
diodes). Due to the logarithmic shape of diode V-I curves, the voltage across the diode
changes only slightly due to changes in current drawn or changes in the input. When
precise voltage control and efficiency are not important, this design may work fine.
Feedback voltage regulators operate by comparing the actual output voltage to some
fixed reference voltage.
Any difference is amplified and used to control the regulation element in such a way as
to reduce the voltage error. This forms a negative feedback control loop; increasing the
open-loop gain tends to increase regulation accuracy but reduce stability (avoidance of
oscillation, or ringing during step changes). There will also be a trade-off between
stability and the speed of the response to changes.
If the output voltage is too low (perhaps due to input voltage reducing or load current
increasing), the regulation element is commanded, up to a point, to produce a higher
output voltage–by dropping less of the input voltage (for linear series regulators and
buck-switching regulators), or to draw input current for longer periods (boost-type
switching regulators); if the output voltage is too high, the regulation element will
normally be commanded to produce a lower voltage. However, many regulators have
over-current protection; so that they will entirely stop sourcing current (or limit the
current in some way) if the output current is too high, and some regulators may also shut
down if the input voltage is outside a given range.
3.3.3.3 Step down transformer
A transformer is a device which step-up or step down the electrical quantities according
to the need. It adjusts the Ac level so that the appropriate DC amplitude is achieved. Its
load handling capacity must be sufficient to supply the load and account for the losses in
the rectifier, filter and regulator. The turn’s ratio is determined by the output level
required relative to the Ac input amplitude. What is a step down transformer: is one
whose secondary voltage is less than its primary voltage. It is designed to reduce the
voltage from the primary winding to the secondary winding.

WSU Electrical and Computer Engineering


Page 27
Arduino Based Traffic Light Control System 2008 E.C

This kind of transformer “steps down” the voltage applied to it. As a step-down unit, the
transformer converts high-voltage, low-current power into low-voltage, high-current
power.
The larger-gauge wire used in the secondary winding is necessary due to the increase in
current. The primary winding, which doesn’t have to conduct as much current, may be
made of smaller-gauge wire.

Fig3.6: Transformer
3.3.4. Light indicator stage (led)
Short for Light-Emitting Diode, LED is a special semiconductor that illuminates when an
Electrical charge passes through it. LEDs are commonly green or red; however can be an
assortment of other colors. Below are just a few examples of how an LED could be used
with a computer. LED falls within the family of P-N junction devices. The light emitting
diode (LED) is a diode that will give off visible light when it is energized. In any forward
biased P-N junction there is, with in the structure and primarily close to the junction, a
recombination of hole and electrons. This recombination requires that the energy
possessed by the unbound free electron be transferred to another state. The process of
giving off light by applying an electrical source is Called electroluminescence.

WSU Electrical and Computer Engineering


Page 28
Arduino Based Traffic Light Control System 2008 E.C

LED is a component used for indication. All the functions being carried out are displayed
by led the LED is diode which glows when the current is being flown through it in
forward bias condition. The LEDs are available in the round shell and also in the flat
shells. The positive leg is longer than negative leg.

Fig3.7: Detailed diagram of LED


This stage of the system consist light emitting diodes (LEDs) that display when executing
the operation. Each phase consists of three patterns of LEDs.

WSU Electrical and Computer Engineering


Page 29
Arduino Based Traffic Light Control System 2008 E.C

Those are:-
 The green light allows traffic to proceed in the direction denoted, if it is safe to do
so
 The yellow/amber light denoting prepare to stop short of the intersection, if it is safe
to do so
 The red signal prohibits any traffic from proceeding
3.3.5. Liquid crystal displays (LCD)
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide
range of applications. In this project we use the 16x2 LCD display; it’s a very basic
module and is very commonly used in various devices and circuits. These modules are
preferred over seven segments and other multi segment LEDs.
LCDs are economical; easily programmable; have no limitation of displaying special &
even custom characters (unlike in seven segments), animations and so on. A 16x2 LCD
means it can display 16 characters per line and there are 2 such lines. In this LCD each
character is displayed in 5x7 pixel matrix.
This LCD has two registers, namely, Command and Data. The command register stores
the command instructions given to the LCD.
A command is an instruction given to LCD to do a predefined task like initializing it,
clearing its screen, setting the cursor position, controlling display etc.
A liquid crystal display (LCD) is a thin, flat panel used for electronically displaying
information such as text, images and moving pictures. Its uses include monitor for
computers, televisions, instrument panels gaming device etc. using polarization of light to
display objects. A typical liquid crystal producing degree shift in the polarization of the
light passing through when there is no electric field present. When a voltage is applied,
an electric field is produced in the liquid, affecting the orientation of the molecules. This
causes the polarization shift to be reduced. Liquid crystal material emits no light of their
own. For illumination of light-backlight and reflective method used.
Reflective: it uses external light reflected by reflector behind the display. Example:
watch, calculator, this is achieved by combining a reflector with rear polarizer.

WSU Electrical and Computer Engineering


Page 30
Arduino Based Traffic Light Control System 2008 E.C

Backlight: light source is from a back light, and viewed from the front. Example:
computer display built in fluorescent tubes above, besides and sometimes behind the
LCD.
3.3.5.1 LCD Commands and instruction set
Only the instruction register (IR) and the data register (DR) of the LCD can be controlled
by the MCU. Before starting the internal operation of the LCD, control information is
temporarily stored into these registers to allow interfacing with various MCUs, which
operate at different speeds, or various peripheral control devices. The internal operation
of the LCD is determined by signals sent from the MCU.
These signals, which include register selection signal (RS), read/write signal (R/W), and
the data bus (DB0 to DB7), make up the LCD instructions
There are four categories of instructions that:
 Designate LCD functions, such as display format, data length, etc.
 Set internal RAM addresses
 Perform data transfer with internal RAM
 Perform miscellaneous function

Fig3.8 LCD

WSU Electrical and Computer Engineering


Page 31
Arduino Based Traffic Light Control System 2008 E.C

3.3.5.2 LCD PIN Description:


The LCD Pin description is illustrates in the table below

Table 3.1 LCD pin description

3.3.5.3 Interfacing LCD to arduino uno


LCD modules form a very important part in many arduino based embedded system
designs. So the knowledge on interfacing LCD to arduino is very essential in designing
embedded systems.

WSU Electrical and Computer Engineering


Page 32
Arduino Based Traffic Light Control System 2008 E.C

 RS pin of the LCD module is connected to digital pin 12 of the arduino.


 R/W pin of the LCD is grounded.
 Enable pin of the LCD module is connected to digital pin 11 of the arduino.
 Digital lines DB4, DB5, DB6 and DB7 are interfaced to digital pins 5, 4, 3 and 2 of
the Arduino.
In this project, the LCD module and arduino are interfaced in the 4-bit mode. That means
only four of the digital input lines (DB4 to DB7 of the LCD are used).
This method is very simple, requires less connections and you can almost utilize the full
potential of the LCD module.
Digital lines DB4, DB5, DB6 and DB7 are interfaced to digital pins 5, 4, 3 and 2 of the
Arduino. The 10K potentiometer is used for adjusting the contrast of the display. 560
ohm resistor R1 limits the current through the back light LED. The arduino can be
powered through the external power jack provided on the board. +5V required in some
other parts of the circuit can be tapped from the 5V source on the arduino board. The
arduino can be also powered from the PC through the USB port.

Figure3.9. Interfacing LCD with arduino

3.3.6 OR gate
A logic gate is an idealized or physical device implementing a Boolean function, that is, it
performs a logical operation on one or more logic inputs and produces a single logic output.

WSU Electrical and Computer Engineering


Page 33
Arduino Based Traffic Light Control System 2008 E.C

Depending on the context, the term may refer to an ideal logic gate, one that has for instance zero
rise time and unlimited fan-out, or it may refer to a non-ideal physical device.
Logic gates are primarily implemented electronically using diodes or transistors, but can also be
constructed using electromagnetic relays (relay logic), fluidic logic, pneumatic logic, optics,
molecules, or even mechanical elements.
With amplification, logic gates can be cascaded in the same way that Boolean functions can be
composed, allowing the construction of a physical model of all of Boolean logic, and therefore,
all of the algorithms and mathematics that can be described with Boolean logic.
The OR gate is an electronic circuit that gives a true output (1) if one or more of its inputs are
true. A plus (+) is used to show the OR operation.
The OR gate is sort of the reverse of the AND gate. The OR function, like its verbal counterpart,
allows the output to be true (logic 1) if any one or more of its inputs are true. Verbally, we might
say, "If it is raining OR if I turn on the sprinkler, the lawn will be wet." Note that the lawn will
still be wet if the sprinkler is on and it is also raining. This is correctly reflected by the basic OR
function. In symbols, the OR function is designated with a plus sign (+). In logical diagrams, the
symbol below designates the OR gate.

Fig3.10: symbol of OR gate

X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
Table3.2 Truth table of OR-gate

WSU Electrical and Computer Engineering


Page 34
Arduino Based Traffic Light Control System 2008 E.C

3.3.7 NOT gate


The NOT gate is an electronic circuit that produces an inverted version of the input at
its output.
• It is also known as an inverter.
• If the input variable is A, the inverted output is known as NOT A.

Fig3.11: Symbol of NOT gate


A X
0 1
1 0
Table3.3: Truth table of NOT gate
3.3.8 NOR gate
• This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate.
• The outputs of all NOR gates are false if any of the inputs are true.
• The symbol is an OR gate with a small circle on the output.

Fig3.12 symbol of NOR gate


A B X
0 0 1
0 1 0
1 0 0
1 1 0
Table3.4 Truth table of NOR gate

WSU Electrical and Computer Engineering


Page 35
Arduino Based Traffic Light Control System 2008 E.C

3.4 Arduino software


Software programs, called sketches (Arduino program code), are created on a computer
using the Arduino integrated development environment (IDE). The IDE enables us to
write and edit code and convert this code into instructions that Arduino hardware
understands. The IDE also transfers those instructions to the Arduino board (a process
called uploading). To develop a code for our project we choose Arduino program code
based on the following practical consideration
 Simple, clear programming environment - The Arduino programming environment is
easy-to-use and flexible.
 Open source and extensible software.
 We can add AVR-C code directly into our Arduino programs.
 Cross-platform
3.4.1. Software development
Software development is the computer programming by creating a coding to run a system.
For this traffic light project, a coding about on how to interrupt the traffic sequences was
created. In other words, to make the traffic sequences hold for a long period for a certain
situation. This coding then would upload into microcontroller, Arduino.
3.4.2 Arduino programming software
Arduino programming software is an open-source Arduino environment makes it easy to
write code and upload it to the input/output board. Arduino can sense the environment by
receiving input from a variety of sensors and can affect its surrounding by controlling lights,
motors, and other actuators. For this project, the coding of the traffic light system was coded
by using Arduino programming software. About 60% of this project was using Arduino
software to coding the system running according to the objectives targeted.

WSU Electrical and Computer Engineering


Page 36
Arduino Based Traffic Light Control System 2008 E.C

Figure 3.13: Arduino Programming Software


3.4.3 Software configuration
Programming software of this line follower is known as ARDUINO-IDE .This is open
source programming platform. The open-source ARDUINO environment makes it easy
to write code and upload it to the i/o board. Here we use ARDUINO-1.6.7 platform. To
configure software we have to use ARDUINO IDE named arduino.exe

Figure 3.14: Programming platform for ARDUINO

WSU Electrical and Computer Engineering


Page 37
Arduino Based Traffic Light Control System 2008 E.C

The system is implemented on Arduino platform using the Arduino Uno Board. The
whole system is implemented using the C-code language written on the arduino platform.
The software written on the platform can be uploaded to the microcontroller (i.e. the
arduino board) using Arduino IDE software.
The Arduino integrated development environment (IDE) is a cross-platform written in
Java, whereas the programs are written in C or C++, which is shown in figure 14. The
platform comes with a software library along with the code editor with features such as
syntax high lighting, brace matching and automatic indentation. The whole program is
written in the platform in the C language code which can be uploaded to the board by a
simple upload button. Basically, the project is the integration of the software (C language
code) used to interface and implement the sensors.
3.5 Arduino build process
The Arduino environment performs some small transformations to make sure that the code is
correct C or C++ (two common programming languages). It then gets passed to a compiler
which turns the human readable code into machine readable instructions (or object files).
Then, our code gets combined, the standard Arduino libraries that provide basic functions
like digital Write () or Serial .print(). The result is a single Intel hex file, which contains the
specific bytes that need to be written to the program memory of the chip on the Arduino
board. This file is then uploaded to the board: transmitted over the USB or serial connection
via the boot loader already on the chip or with external programming hardware. Sketches are
compiled.
3.6 Technological advancements
With technologies in developed countries continuing to advance, there is now an
increasing move to develop and implement smart traffic lights on the roads. These are
basically more intelligent systems that try to communicate with cars to alert drivers of
impeding light changes and reduce motorists' waiting time considerably.
Trials are currently being conducted for the implementation of these advanced traffic
lights but there are still many hurdles to widespread use that need to be addressed; one of
which is the fact that not a lot of cars yet have the required systems to communicate
intelligently with these lights.

WSU Electrical and Computer Engineering


Page 38
Arduino Based Traffic Light Control System 2008 E.C

3.7. Control and Co-ordination


The normal function of traffic lights requires sophisticated control and coordination to
ensure that traffic moves as smoothly and safely as possible and that pedestrians are
protected when they cross the roads.

Fig3.16. over all circuit diagrams

WSU Electrical and Computer Engineering


Page 39
Arduino Based Traffic Light Control System 2008 E.C

4.8 Process Flow Chart


Start

Initialize
Time0 as Timer

Move next signaling


Data onto the port
Pins & start the timer

Load
Delay Value
In Timer

Start Update the


LED display
For every minute

Is the delay
Yes completed? No

Fig3.17. Process Flow chart representation

WSU Electrical and Computer Engineering


Page 40
Arduino Based Traffic Light Control System 2008 E.C

CHAPTER FOUR
SYSTEM DESIGN RESULT
4.1. System Implementation
Microcontroller Arduino Uno R3 is the brain of the project which initiates the traffic
signal at a Junction. The LED’s are automatically on and off by making the
corresponding port pin of the Microcontroller high. So the sequence of the lights
determines the way in which the vehicles and the pedestrians go through the road.
And also there is a consideration in which yellow light glow faster for pedestrians since
the speed of vehicles is greater than the speed of passengers. Generally, the system starts
using switch then it passes through the following steps in order to entertain the flow of
vehicles as well as pedestrians.
4.2 Result
Step 1: The road for the vehicles moved from east to north, east to west, west to south
and west to east.

Fig4.1 step one traffic light result

WSU Electrical and Computer Engineering


Page 41
Arduino Based Traffic Light Control System 2008 E.C

Step 2: The road for the vehicles moved from east to south and the passengers cross the
road east to west, west to east, south to north and north to south.

Fig 4.2 step two traffic light result


Step 3: The road for the vehicles moved from west to north and the passengers cross the
road east to west, west to east, south to north and north to south.

Fig 4.3 step three traffic light result

WSU Electrical and Computer Engineering


Page 42
Arduino Based Traffic Light Control System 2008 E.C

Step 4: The road for the vehicles moved from north to west, north to south, south to east
and south to north.

Fig 4.4 step four traffic light result


Step 5: The road for the vehicles moved from north to east and the passengers cross the
road east to west, west to east, south to north and north to south.

Fig 4.5 step five traffic light result

WSU Electrical and Computer Engineering


Page 43
Arduino Based Traffic Light Control System 2008 E.C

Step 6: The road for the vehicles moved from south to west and the passengers cross the
road east to west, west to east, south to north and north to south. the step continues like a
cycle.

Fig 4.6 step six traffic light result

WSU Electrical and Computer Engineering


Page 44
Arduino Based Traffic Light Control System 2008 E.C

CHAPTER FIVE

CONCLUSION AND RECOMMENDATION


5.1. Conclusion
This paper has been successfully presented a functional and low cost microcontroller-
based traffic light system for road intersection control. The traffic light system is
designed using Arduino microcontroller, power section, LCD, Gates and light emitting
diode (LED). The developed traffic light control system is tested by constructing a
prototype .The functionality of the prototype shows that the developed system can be
used for a real life traffic control at road intersection. Also, developed system can be
employed as a training kit in learning traffic light control system. Traffic management on
the road has become a several problem to day’s societies. Efficient traffic management
techniques are needed to reduce waiting and travelling time, save fuel and money. From
the design and construction of a traffic light controller, carried out in the course of this
project, it is obvious that such a system which is used to reduce the human stress of
standing under favorable or unfavorable weather conditions and controlling the
movement of vehicles at T-junctions as well as passengers, can be developed by
indigenous human resources.
5.2. Recommendation
The importation of foreign made traffic control systems should be discouraged since the
dependence on miss practice is detrimental to our economic growth. Engineering and
technology students in our universities of technology should be encouraged by giving
some special allowances to undertake experimental research work. our various
governments in alliance with institute of technology and manufacturers should establish
special centers for the design and manufacture technological infrastructures such as this.
Further studies should be carried out in the area of microprocessor-based traffic control
system. This will add a lot of functionality and flexibility to the system such as:- because
of the nature of our power supply system, it is necessary to carry out further research on
solar-powered traffic control system.

WSU Electrical and Computer Engineering


Page 45
Arduino Based Traffic Light Control System 2008 E.C

References
[ 1]. www.arduino.cc
[2]. http://www.ijettjournal.org
[3]. http://www.allaboutcircuits.com/vol_4/chpt_5/2.html
[4]. www.traffic light control system
[5]. ^ Jump up to:a b c Sobey, Ed (2010). The Way Kitchens Work: The Science Behind
the Microwave, Teflon Pan, Garbage Disposal, and More. USA: Chicago Review Press.
pp. 161–164.
[6].Brain W.Evans, “arduino programming Note Book”, First Edition August 2007,
[7].http:/www.arduino.cc/e n /booklet/homepage
[8].Massimo Banzi,Hernando barragan,David Cuartielles, Tom Igoe, Daniel
Jolliffee,Todd Kuart,David Mellis , “Arduino Reference”, http:/www.arduino.cc
[9].Micro Electronics from General Instrument Corporation
[10].http://www.microchip.com/downloads/en/devicedoc
[11].Greenfield, J. (2000). Digital Design using Integrated Circuits.
[12].Rohit, M. (2008): Principles of Electronics.
[13].en.wikipedia.org/wiki/Traffic light 1. en.wikipedia.org/wiki/Traffic light

WSU Electrical and Computer Engineering


Page 46
Arduino Based Traffic Light Control System 2008 E.C

APPEDIX

ARDUINO CODE

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//Initialization of the pins

int EW=0;

int EN=1;

int ES=13;

int WN=6;

int WS=7;

int WE=8;

int NS=2;

int NE=12;

int NW=11;

int SN=5;

int S2E =4;

int SW=3;

int EWY=9;

int NSY=10;

int dd=5000;

WSU Electrical and Computer Engineering


Page 47
Arduino Based Traffic Light Control System 2008 E.C

void setup()

//Assigning the pin direction

lcd.begin(16,2);

pinMode(EWY,OUTPUT);

pinMode(NSY,OUTPUT);

pinMode(EW,OUTPUT);

pinMode(EN,OUTPUT);

pinMode(ES,OUTPUT);

pinMode(WN,OUTPUT);

pinMode(WS,OUTPUT);

pinMode(WE,OUTPUT);

pinMode(NS,OUTPUT);

pinMode(NE,OUTPUT);

pinMode(NW,OUTPUT);

pinMode(SN,OUTPUT);

pinMode(S2E,OUTPUT);

pinMode(SW,OUTPUT);

lcd.setCursor(0,0);

WSU Electrical and Computer Engineering


Page 48
Arduino Based Traffic Light Control System 2008 E.C

lcd.print(" WELCOME TO THIS ");

lcd.setCursor(0,1);

lcd.print("******ROAD******");

void loop()

// First state out of the ten states

Digital Write(ES,LOW);

Digital Write(EW,HIGH);

Digital Write(EN,HIGH);

Digital Write(WN,LOW);

Digital Write(WE,HIGH);

Digital Write(WS,HIGH);

Digital Write(SW,LOW);

Digital Write(SN,LOW);

Digital Write(S2E,LOW);

Digital Write(NE,LOW);

Digital Write(NS,LOW);

Digital Write(NW,LOW);

Digital Write(EWY,LOW);

WSU Electrical and Computer Engineering


Page 49
Arduino Based Traffic Light Control System 2008 E.C

Digital Write(NSY,LOW);

delay(dd);

//Second state

Digital Write(ES,LOW);

Digital Write(EW,LOW);

Digital Write(EN,LOW);

Digital Write(WN,LOW);

Digital Write(WE,LOW);

Digital Write(WS,LOW);

Digital Write(SW,LOW);

Digital Write(SN,LOW);

Digital Write(S2E,LOW);

Digital Write(NE,LOW);

Digital Write(NS,LOW);

Digital Write(NW,LOW);

Digital Write(EWY,HIGH);

Digital Write(NSY,LOW);

delay(2500);

WSU Electrical and Computer Engineering


Page 50
Arduino Based Traffic Light Control System 2008 E.C

// Third state

Digital Write(ES,HIGH);

Digital Write(EW,LOW);

Digital Write(EN,LOW);

Digital Write(WN,LOW);

Digital Write(WE,LOW);

Digital Write(WS,LOW);

Digital Write(SW,LOW);

Digital Write(SN,LOW);

Digital Write(S2E,LOW);

Digital Write(NE,LOW);

Digital Write(NS,LOW);

Digital Write(NW,LOW);

Digital Write(EWY,LOW);

Digital Write(NSY,LOW);

delay(dd);

//Fourth state

Digital Write(ES,LOW);

Digital Write(EW,LOW);

Digital Write(EN,LOW);

WSU Electrical and Computer Engineering


Page 51
Arduino Based Traffic Light Control System 2008 E.C

Digital Write(WN,HIGH);

Digital Write(WE,LOW);

Digital Write(WS,LOW);

Digital Write(SW,LOW);

Digital Write(SN,LOW);

Digital Write(S2E,LOW);

Digital Write(NE,LOW);

Digital Write(NS,LOW);

Digital Write(NW,LOW);

Digital Write(EWY,LOW);

Digital Write(NSY,LOW);

delay(dd);

//Fifth state

Digital Write(ES,LOW);

Digital Write(EW,LOW);

Digital Write(EN,LOW);

Digital Write(WN,LOW);

Digital Write(WE,LOW);

Digital Write(WS,LOW);

Digital Write(SW,LOW);

WSU Electrical and Computer Engineering


Page 52
Arduino Based Traffic Light Control System 2008 E.C

Digital Write(SN,LOW);

Digital Write(S2E,LOW);

Digital Write(NE,LOW);

Digital Write(NS,LOW);

Digital Write(NW,LOW);

Digital Write(EWY,LOW);

Digital Write(NSY,HIGH);

delay(2500);

//Sixth state

Digital Write(ES,LOW);

Digital Write(EW,LOW);

Digital Write(EN,LOW);

Digital Write(WN,LOW);

Digital Write(WE,LOW);

Digital Write(WS,LOW);

Digital Write(SW,LOW);

Digital Write(SN,HIGH);

Digital Write(S2E,HIGH);

Digital Write(NE,LOW);

Digital Write(NS,HIGH);

WSU Electrical and Computer Engineering


Page 53
Arduino Based Traffic Light Control System 2008 E.C

Digital Write(NW,HIGH);

digital Write(EWY,LOW);

digital Write(NSY,LOW);

delay(dd);

//Seventh state

Digital Write(ES,LOW);

Digital Write(EW,LOW);

Digital Write(EN,LOW);

Digital Write(WN,LOW);

Digital Write(WE,LOW);

Digital Write(WS,LOW);

Digital Write(SW,LOW);

Digital Write(SN,LOW);

Digital Write(S2E,LOW);

Digital Write(NE,LOW);

Digital Write(NS,LOW);

Digital Write(NW,LOW);

Digital Write(EWY,LOW);

Digital Write(NSY, HIGH);

delay(dd);

WSU Electrical and Computer Engineering


Page 54
Arduino Based Traffic Light Control System 2008 E.C

//Eighth state

Digital Write(ES,LOW);

Digital Write(EW,LOW);

Digital Write(EN,LOW);

Digital Write(WN,LOW);

Digital Write(WE,LOW);

Digital Write(WS,LOW);

Digital Write(SW,LOW);

Digital Write(SN,LOW);

Digital Write(S2E,LOW);

Digital Write(NE,HIGH);

Digital Write(NS,LOW);

Digital Write(NW,LOW);

Digital Write(EWY,LOW);

Digital Write(NSY,LOW);

delay(dd);

//Ninth state

Digital Write(ES,LOW);

Digital Write(EW,LOW);

Digital Write(EN,LOW);

WSU Electrical and Computer Engineering


Page 55
Arduino Based Traffic Light Control System 2008 E.C

Digital Write(WN,LOW);

Digital Write(WE,LOW);

Digital Write(WS,LOW);

Digital Write(SW,HIGH);

Digital Write(SN,LOW);

Digital Write(S2E,LOW);

Digital Write(NE,LOW);

Digital Write(NS,LOW);

Digital Write(NW,LOW);

Digital Write(EWY,LOW);

Digital Write(NSY,LOW);

delay(dd);

//Tenth State

Digital Write(ES,LOW);

Digital Write(EW,LOW);

Digital Write(EN,LOW);

Digital Write(WN,LOW);

Digital Write(WE,LOW);

Digital Write(WS,LOW);

Digital Write(SW,LOW);

WSU Electrical and Computer Engineering


Page 56
Arduino Based Traffic Light Control System 2008 E.C

Digital Write(SN,LOW);

Digital Write(S2E,LOW);

Digital Write(NE,LOW);

Digital Write(NS,LOW);

Digital Write(NW,LOW);

Digital Write(EWY,HIGH);

Digital Write(NSY,LOW);

delay(2500);

WSU Electrical and Computer Engineering


Page 57

You might also like