Arduino Based Traffic Light Control System
Arduino Based Traffic Light Control System
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.
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.
Developing simulation
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].
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].
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 ].
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 .
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.
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.
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.
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.
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
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.
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.
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.
For convenience, we tap the output of the adapter and hence the input to the regulator at
6Vdc.
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.
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.
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.
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.
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
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.
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.
X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
Table3.2 Truth table of OR-gate
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.
Initialize
Time0 as Timer
Load
Delay Value
In Timer
Is the delay
Yes completed? No
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.
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.
Step 4: The road for the vehicles moved from north to west, north to south, south to east
and south to north.
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.
CHAPTER FIVE
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
APPEDIX
ARDUINO CODE
#include <LiquidCrystal.h>
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 SW=3;
int EWY=9;
int NSY=10;
int dd=5000;
void setup()
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);
lcd.setCursor(0,1);
lcd.print("******ROAD******");
void loop()
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);
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);
// 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);
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);
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);
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);
delay(dd);
//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);
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);
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);