You are on page 1of 10

Ministry of Higher Education and Scientific Research

University of Basrah
College of Engineering
Department of Electrical Engineering

MCU Application Traffic light system

Student Name : Mohammed Ismail Ahmed


Section and Roll No. : control – 29
Type of study : Evening study
Experiment 6
MCU Application Traffic light system

Traffic Light Control System using Microcontroller


Traffic lights were first invented in the year 1868 at London’s House of
Commons where traffic light signals were placed at intersections of
George and Bridge Street. Later the traffic lights were developed in the
year 1914 by an American Traffic Signal Company, which fixed green
and red lights at corners of the 105th street and Euclid Avenue in
Cleveland, Ohio. During this period traffic lights were controlled either
by timing or by switching manually.

Traffic lights are also named as stoplights, road traffic lamps, traffic
signals, stop-and-go lights which are signaling devices placed at road
crossings, everyday pedestrian crossings and other locations to control
competing flows of traffic. Traffic lights have been fixed allover the
world in many cities. Traffic light control assigns a right way to the road
users by using lights in normal colors (red – amber/yellow –
green).Traffic light control system uses a worldwide color code (a
specific color order to enable color recognition for those who are color
blind).

In China, there were unsuccessful efforts to change the importance of


“red” to “go” during the Cultural Revolution. Typically traffic lights
consist of three types of colored lights such as red, orange and green. In a
typical cycle, turning on of a green light allows traffic to continue in the
way indicated. Similarly, lighting of the amber/orange light for a short
time of transition represents a signal to prepare to stop, and the
Illumination of the red signal disallows any traffic from going on.

Need for Traffic Light System :

Roads without any supervision or guidance can lead to traffic conflicts


and accidents. Traffic signals are required for an orderly flow of traffic. A
traffic signal is used as an instructing device that indicates the road user
to act as per the displayed sign.
Traffic lights allow everyone to cross the intersection point one by one,
reducing conflicts between vehicles entering intersection points from
different directions. It provides road safety, also helps to solve traffic in
simple manners.

There are different colours in traffic lights. Each light has a meaning, and
these lights tell drivers what to do.

Circuit Connection (LED with Arduino) :

This is the circuit diagram for the traffic light controller by using Arduino.

 Connect LEDs on the breadboard as Red, Yellow, Green, respectively.


 Connect the negative terminal of the LED and connect the 220 Ohm
resistor in series.
 Connect these negative terminals to the ground.
 Connect the positive terminal of the LEDs to the pins 2 to 10,
respectively.
 Power the breadboard by using 5V and GND on the Arduino.

Advantages

 The traffic light controller in this system can be implemented


practically, and it could be expanded further by you.
 This traffic light controller includes a crosswalk signalling system.
 External memory can be interface with the central controller so that
the timings are not fixed during its programming but instead can be
programmed during operation.

Limitations

 The project is not suitable for actual implementation but just a


demonstration of the process behind the system.
 The project can either operated manually or by using pre-
programming operations. It cannot handle in both ways.
 In the real-time traffic controller systems, the operator has the right
to change the timings and the intensity of the traffic light in each
lane.
Final Words

 Thank you for being with me till the end of this project. I hope you
have understood all the concepts about traffic light control and its
importance. If you like this project, try to implement it and let me
know your comments section's experiences.

Projects
Project 1:

Design MCU system to control 3-ways traffic light system?


Hint: the design should include the following steps:

1- Studying the basic of the project.

2- Finding the state diagram of the system.

3- Drowning the circuit of the project.

4- writing the flow chart or algorithm of the system.

5- Writing the program.


void setup() {

// configure the output pins

pinMode(2,OUTPUT);

pinMode(3,OUTPUT);

pinMode(4,OUTPUT);

pinMode(5,OUTPUT);

pinMode(6,OUTPUT);

pinMode(7,OUTPUT);

pinMode(8,OUTPUT);

pinMode(9,OUTPUT);

pinMode(10,OUTPUT);

void loop()

digitalWrite(2,1); //enables the 1st set of signals

digitalWrite(7,1);

digitalWrite(10,1);

digitalWrite(4,0);

digitalWrite(3,0);

digitalWrite(6,0);

digitalWrite(8,0);

digitalWrite(9,0);

digitalWrite(5,0);

delay(5000);

digitalWrite(3,1); //enables the yellow lights

digitalWrite(6,1);

digitalWrite(2,0);
digitalWrite(7,0);

delay(1000);

digitalWrite(4,1); //enables the 2nd set of signals

digitalWrite(5,1);

digitalWrite(10,1);

digitalWrite(2,0);

digitalWrite(3,0);

digitalWrite(6,0);

digitalWrite(8,0);

digitalWrite(9,0);

digitalWrite(7,0);

delay(5000);

digitalWrite(9,1); //enables the yellow lights

digitalWrite(6,1);

digitalWrite(10,0);

digitalWrite(5,0);

digitalWrite(4,0);

delay(1000);

digitalWrite(8,1); //enables the 3rd set of signals

digitalWrite(4,1);

digitalWrite(7,1);

digitalWrite(2,0);

digitalWrite(3,0);

digitalWrite(5,0);

digitalWrite(6,0);

digitalWrite(9,0);

digitalWrite(10,0);
delay(5000);

digitalWrite(9,1); //enables the yellow lights

digitalWrite(3,1);

digitalWrite(7,0);

digitalWrite(8,0);

digitalWrite(4,0);

delay(1000);

Project 2:
Design MCU system to control 3-ways traffic light system, the
system has input which acts as an emergency signal where when
this signal is high the controller should stop all ways?
void setup() {

// configure the output pins

pinMode(2,OUTPUT);

pinMode(3,OUTPUT);

pinMode(4,OUTPUT);

pinMode(5,OUTPUT);

pinMode(6,OUTPUT);

pinMode(7,OUTPUT);

pinMode(8,OUTPUT);

pinMode(9,OUTPUT);

pinMode(10,OUTPUT);

void loop()

digitalWrite(2,1); //enables the 1st set of signals

digitalWrite(7,1);

digitalWrite(10,1);

digitalWrite(4,0);

digitalWrite(3,0);

digitalWrite(6,0);

digitalWrite(8,0);

digitalWrite(9,0);

digitalWrite(5,0);

delay(5000);

digitalWrite(3,1); //enables the yellow lights

digitalWrite(6,1);

digitalWrite(2,0);
digitalWrite(7,0);

delay(1000);

digitalWrite(4,1); //enables the 2nd set of signals

digitalWrite(5,1);

digitalWrite(10,1);

digitalWrite(2,0);

digitalWrite(3,0);

digitalWrite(6,0);

digitalWrite(8,0);

digitalWrite(9,0);

digitalWrite(7,0);

delay(5000);

digitalWrite(9,1); //enables the yellow lights

digitalWrite(6,1);

digitalWrite(10,0);

digitalWrite(5,0);

digitalWrite(4,0);

delay(1000);

digitalWrite(8,1); //enables the 3rd set of signals

digitalWrite(4,1);

digitalWrite(7,1);

digitalWrite(2,0);

digitalWrite(3,0);

digitalWrite(5,0);

digitalWrite(6,0);

digitalWrite(9,0);

digitalWrite(10,0);
delay(5000);

digitalWrite(9,1); //enables the yellow lights

digitalWrite(3,1);

digitalWrite(7,0);

digitalWrite(8,0);

digitalWrite(4,0);

delay(1000);

You might also like