Professional Documents
Culture Documents
MICROCONTROLLER
BACHELOR OF TECHNOLOGY
(Electronics and Communication Engineering)
To
DR. APJ ABDUL KALAM TECHNICAL UNIVERSITY
LUCKNOW-160014
SUBMITTED BY
KRITY KUMARI
ROLL NO. 1233331031
May, 2016
DECLARATION
I ,Krity Kumari hereby declare that the work which is being presented in this report titled
“Density based Traffic Signal System Using Microcontroller” by me, in partial fulfillment of
the requirements for the award of Bachelor of Technology (B.Tech) Degree in “Electronics and
Communication Engineering” at Department of Electronics and Communication Engineering,
Raj Kumar Goel Institute of Technology for Women, is an authentic record of my own work
carried out under supervision of Mr Naveen Dubey and Lab coordinator Praveen Kumar.
ii
RAJ KUMAR GOEL INSTITUTE OF TECHNOLOGY FOR WOMEN
Ghaziabad-201013 (UP)
Affiliated to
CERTIFICATE
This is to certify that the report titled “Density based traffic signal system using
microcontroller” submitted by krity kumari in partial fulfillment of the requirements for the
award of Bachelor of Technology (B.Tech) Degree in “Electronics and Communication
Engineering” at Department of Electronics and Communication Engineering, Raj Kumar Goel
Institute of Technology for Women, is an authentic record of work carried out by her under the
supervision of Mr. Naveen Dubey. The project has reached the standards of full filling the
requirement to award the degree.
(Project Guide)
Mr. Kunal Lala
(Assistant Professor)
(Project Coordinator)
iii
ACKNOWLEDGEMENT
The satisfaction that accompanies that the successful completion of any task would be
incomplete without the mention of people whose ceaseless cooperation made it possible, whose
constant guidance and encouragement crown all efforts with success.
We are grateful to Mr. Naveen dubey, Ms. Reshu Gupta (HOD EC) and all the faculty members
of EC Department for their guidance, inspiration and constructive suggestions that helped us in
the preparation of this report. We are very thankful to our Lab Instructors Mr. Praveen Kumar,
Mr. Pyush Tyagi, Mr. Sanjay Sharma, Mr. Manoj Kumar and Mr. Vijay of EC Department for
their consistence help to complete this task on time.
We also thank our colleagues who have helped in successful completion of the project report.
iv
ABSTRACT
Nowadays, controlling the traffic becomes major issue because of rapid increase in automobiles
and also because of large time delays between traffic lights. So, in order to rectify this problem,
we will go for density based traffic lights system. This article explains you how to control the
traffic based on density.
In this system, we will use IR sensors to measure the traffic density. We have to arrange one IR
sensor for each road; these sensors always sense the traffic on that particular road. All these
sensors are interfaced to the microcontroller. Based on these sensors, controller detects the traffic
and controls the traffic system.
v
CONTENTS
Declaration ii
Certificate iii
Acknowledgment iv
Abstract v
Contents vi
Chapter 1: INTRODUCTION 1
1.1 Introduction 1
2.3 Objective 3
3.2Components required 4
3.2.1 Atmega32 4
3.2.1.1 Features 5
vi
3.3 IR sensor 8
3.4 Resistance 10
3.5 LED 10
Conclusion 20
References 22
vii
Figure Caption Page No.
viii
Density based traffic signal system using 2016
Microcontroller
CHAPTER 1
INTRODUCTION
A steady increase in metro-city population, the number of automobiles and cars increases rapidly
and metro traffic is growing crowded which leads to the traffic jam problem. Nowadays,
controlling the traffic becomes major issue because of rapid increase in automobiles and also
because of large time delays between traffic lights. So, in order to rectify this problem, we will go
for density based traffic lights system. This article explains you how to control the traffic based
on density. In this system, we will use IR sensors to measure the traffic density. We have to
arrange one IR sensor for each road; these sensors always sense the traffic on that particular road.
All these sensors are interfaced to the microcontroller. Based on these sensors, controller detects
the traffic and controls the traffic system.
The main heart of this traffic system is microcontroller. IR sensors are connected to the PORT C
(PC0, PC2, PC4, and PC6) of the microcontroller and traffic lights are connected to PORT A and
PORT B. If there is traffic on road then that particular sensor output becomes logic 0 otherwise
logic 1. By receiving these IR sensor outputs, we have to write the program to control the traffic
system. If you receive logic 0 from any of these sensors, we have to give the green signal to that
particular path and give red signal to all other paths. Here continuously we have to monitor the IR
sensors to check for the traffic. We have to place these IR pair in such a way that when we place
an obstacle in front of this IR pair, IR receiver should be able to receive the IR rays. When we
give the power, the transmitted IR rays hit the object and reflect back to the IR receiver. Instead
of traffic lights, you can use LEDs (RED, GREEN, YELLOW). In normal traffic system, you
have to glow the LEDs on time basis. If the traffic density is high on any particular path, then
glows green LED of that particular path and glows the red LEDs for remaining paths.
CHAPTER 2
LITERATURE REVIEW
[1] K.Vidhya, A.Bazila Banu use the Density measurement by using open tool as software for
image processing by just displaying the various conversion of image in the screen and finally
surrounding the box on the vehicle in the given image, the number of vehicle is calculated. They
can calculate the density of the vehicle by using mat lab tool by comparing the four side of the
image which is given as a input. they can simulate the result of the four given input image but this
cannot be used in real time applications as it is very slow and the software is not free of cost like
open to overcome this disadvantage of mat lab, open software is used which is very easy to install
and is open source software and can be used in real time application in a quick manner. In this
paper they have shown the density measurement in the signal by using open in the System..
[2] G.Kavya, B.Saranya: Density Based Intelligent Traffic Signal System Using PIC
Microcontroller, the optimization of traffic light controller in a City using IR sensors and
microcontroller. By using this system configuration tried to reduce the possibilities of traffic
jams, caused by traffic lights, to an extent and successfully gets the results. No. of passing vehicle
in the fixed time slot on the road decide the density range of traffics and on the basis of vehicle
count microcontroller decide the traffic light delays for next recording interval. The recorded data
can be downloaded to the computer through communication between microcontroller and the
computer.
[3] Sachin Jaiswal, Tushar Agarwal ,Akanksha Singh and Lakshita: The project is a
replica of a four way lane crossing of real time scenario. In the first part, concentrated on
problems faced by Ambulances, RFID concept is used to make the Ambulance’s lane Green and
thus providing a stoppage free way for the Ambulance. In the second part, concentrated on
problems faced by Priority vehicles, IR transmitter and receiver are used to make the vehicles’
lane Green and thus preventing traffic congestion. In the third part, concentrated on Traffic
density control, IR transmitter and receiver are used to provide dynamic traffic control and thus
The high volume of vehicles, the inadequate infrastructure and the irrational distribution of the
development are main reasons for increasing traffic jam. The major cause leading to traffic
congestion is the high number of vehicle which was caused by the population and the
development of economy. Traffic congestion is a condition on road networks that occurs as use
increases, and is characterized by slower speeds, longer trip times, and increased vehicular
queuing. The most common example is the physical use of roads by vehicles. When traffic
demand is great enough that the interaction between vehicles slows the speed of the traffic
stream, these results in some congestion .As demand approaches the capacity of a road (or of the
intersections along the road), extreme traffic congestion sets in. When vehicles are fully stopped
for periods of time, this is colloquially known as a traffic jam or traffic snarl-up. Traffic
congestion can lead to drivers becoming frustrated and engaging in road rage. In order to avoid
the congestion in the traffic. In traffic environments, Traffic Sign Recognition (TSR) is used to
regulate traffic signs, warn the driver, and command or prohibit certain actions. A fast real-time
and robust automatic traffic sign detection and recognition can support and disburden the driver,
and thus, significantly increase driving safety and comfort. Generally, traffic signs provide the
driver various information for safe and efficient navigation Automatic recognition of traffic signs
is, therefore, important for automated intelligent driving vehicle or driver assistance systems.
2.3 OBJECTIVE
During our literature survey we come across many journal papers in which traffic is control with
the help of microcontroller. In this manuscript, I am controlling traffic signal using
microcontroller . It is density based traffic signal system. Here I am utilizing the concept of IR
sensor and control the density of traffic. In this project with the help of command we control the
microcontro
CHAPTER 3
HARDWARE DESCRIPTION
The Atmel® ATmega32A 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
ATmega32A achieves throughputs close to 1MIPS per MHz this empowers system designed to
optimize the device for power consumption versus processing speed.
GND: Ground.
Port A (PA7:PA0): Port A serves as the analog inputs to the A/D Converter. Port A also serves
as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal
pull-up resistors (selected for each bit). The Port A output buffers have symmetrical drive
characteristics with both high sink and source capability. When pins PA0 to PA7 are used as
inputs and are externally pulled low, they will source current if the internal pull-up resistors are
activated. The Port A pins are tristated when a reset condition becomes active, even if the clock is
not running.
Port B (PB7:PB0): Port B is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port B output buffers have symmetrical drive characteristics with both
high sink and source capability. As inputs, Port B pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port B pins are tristated when a reset condition
Port C (PC7:PC0): Port C is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port C output buffers have symmetrical drive characteristics with both
high sink and source capability. As inputs, Port C pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition
becomes active, even if the clock is not running. If the JTAG interface is enabled, the pull-up
resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset occurs.
The TD0 pin is tristated unless TAP states that shift out data are entered. Port C also serves the
functions of the JTAG interface and other special features of the ATmega32A as listed in
Alternate Functions of Port C.
Port D (PD7:PD0): Port D is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port D output buffers have symmetrical drive characteristics with both
high sink and source capability. As inputs, Port D pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port D pins are tristated when a reset condition
becomes active, even if the clock is not running. Port D also serves the functions of various
special features of the ATmega32A as listed in Alternate Functions of Port D.
RESET: Reset input. A low level on this pin for longer than the minimum pulse length will
generate a reset, even if the clock is not running. The minimum pulse length is given in System
and Reset Characteristics. Shorter pulses are not guaranteed to generate a reset. Related Links
System and Reset Characteristics on page 367
XTAL1 Input to the inverting Oscillator amplifier and input to the internal clock operating
circuit.
AVCC AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externally
connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to
VCC through a low-pass filter.
AREF AREF is the analog reference pin for the A/D Converter
3.3: IR Sensor
Pin 1 VCC
Pin 2 Ground (GND)
Pin 3 Output
2-12cm range
Can be used to differentiate between black and white (Can be used for line sensing) .
Works on 5V input.
LM358 IC (Integrated Circuit) that acts as a comparator/ ADC (Analog to Digital Converter) IC
which makes it digital sensor.
The electrical resistance of an electrical conductor is the opposition to the passage of an electric
current through that conductor. The inverse quantity is electrical conductance, the ease with
which an electric current passes. Electrical resistance shares some conceptual parallels with the
notion of mechanical friction. The SI unit of electrical resistance is the ohm (Ω), while
electrical conductance is measured in siemens (S).
An object of uniform cross section has a resistance proportional to its resistivity and length and
inversely proportional to its cross-sectional area. All materials show some resistance, except for
superconductors, which have a resistance of zero.
3.5 LED
A light-emitting diode (LED) is a two-lead semiconductor HYPERLINK light source. It is a pn-
junction HYPERLIN diode, which emits light when activated. When a suitable voltage is applied
to the leads, electrons are able to recombine with electron holes within the device, releasing
energy in the form of photons.
This effect is called electroluminescence, and the color of the light (corresponding to the energy
CHAPTER 4
SOFTWARE DESIGN AND HARDWARE RESULT
4.1 INSTALLING TOOLS FOR C PROGRAMMING
To work with the Atmel AVR microcontroller using the C programming language, two
tools are required: AVR Studio and AVR.
1. AVR Studio is an integrated development environment that includes an editor, the
assembler, HEX file downloader and a microcontroller emulator.
2. ICC AVR is for a ICC-based compiler for AVR. It appears in AVR Studio as a plug-
in. ICC AVR also includes a program called Programmer’s Notepad that can be used
to edit and compile C programs, independently of AVR Studio. Installing these tools
is easy, just download and run the setup files, and accept the default installation
options. Remember to install AVR Studio first before ICC-AVR.
3. It supports inline assembly and can interface with assembly modules.
4. It supports all AT90S and ATMega devices and AT94K FPSLIC.
5. Modern IDE with code folding, workspace and project management, one click access
to function definitions, etc.
4. In the ‘Select debug platform and device’ dialog that appears choose ‘AVR
Simulator’ as the debug platform and ‘ATMEGA32’ as the device.
Click button Finish.
Note: If you want to use other AVR chips such as ATMAGE8515, select it at this step. In this
tutorial, we will use ATMEGA32 for both software simulation and hardware testing.
5. A project file will be created and ICC AVR displays an empty file led.c. Enter the
C code.
5. While debugging the C program, you can change the contents of a register. For
example, to change Port A Input Pins register (PINA), click on the value column
of PINA and enter a new value This change takes effect immediately.
Subsequently, the contents of PORTB will be 0x04 after running the two C
instruction.
6. To monitor a C variable, select the variable name in the code window and click
menu.
7. Debug | Quick Watch. The variable will be added to a watch window.
th
Development of the methods used in modern printed circuit boards started early in the 20
century. In 1903, a German inventor, Albert Hanson, described flat foil conductors laminated
to an insulating board, in multiple layers. Thomas Edison experimented with chemical
methods of plating conductors onto linen paper in 1904 Arthur Berry in 1913 patented a print-
and-etch method in Britain, and in the United States Max Schoop obtained a patent to flame-
spray metal onto a board through a patterned mask. Charles Durcase in 1927 patented a
method of electroplating circuit patterns.
1. Boards should be clean, washing up liquid, cream cleaners etc the board should be
scoured clean, and rinsed thoroughly, water should form into droplets and roll off the
board as a sign of cleanliness.
2. Thoroughly dry the board, wipe with clean drying cloth, warm air (hair dryer) and
warm in an oven if possible.
3. Draw your design onto the board, holding the board by the edges when working.
Allow the ink of the design to completely dry. Thickness of ink should not be a
problem if allowed to dry fully.
4. With the types of board provided with the kits the solution of ferric chloride (PCB
etchant) should be suitable to be used as supplied.
5. Temperature of the etchant should be around room temperature, in the 21°C to 24°C
CONCLUSION
In this project, I have implemented density based traffic signal system using microcontroller. The
hardware equipment is tested and result is obtained. This project is cost effective. Implementation of
this project in present day will effectively solve the traffic congestion which is a severe problem in
many modern cities all over the world .Consider a scenario of highly congested area where many
vehicles such as personal transport, public transport and emergency vehicles (Ambulance, Fire brigade,
VIP cars and other rescue vehicles) have to wait for long for the change of traffic signals at intersection
points. This leads to the wastage of precious time especially in case of rescue vehicles for emergency
conditions It is possible to propose dynamic time-based coordination schemes where the green signal
time of the traffic lights is assigned based on the present conditions of traffic. This is achieved by using
IR sensors across the road to monitor the length of vehicles blocking the road traffic. The signals from
the IR receivers are fed to the microcontroller to follow the program with the time as desired. With a
slight modification this project can be implemented in a nearby area.
FUTUTRE SCOPE
As the system takes care of few of the drawbacks of the existing system, there is scope for further
improvement and expansion of this work. The system can be expanded with smart traffic light control
and congestion avoidance system during emergencies emergency cars such as fire engines and
ambulances and have priority over other traffic. This system gives highest priority to emergency
vehicles to pass them. A development of an intelligent traffic signal control (ITSC) system needed
because present traffic light controllers are based on old microcontroller such as AT89C51 which has
very less internal memory and no in-built ADC. These systems have limitation because they will use
the predefined program that does not have the flexibility of modification on real time application.
The approach discussed in above is novel and has achieved the target to control traffic signal system
satisfying user needs and requirements.
In this project in future i can add module for sensing whose range is more than IR module. I will
modify my coding for controlling the traffic signal according to density.
REFERENCES
1. Zhang Yuye & Yan Weisheng, (2009) “Research of Traffic Signal Light Intelligent Control
System Based On Microcontroller”, First International Workshop on Education Technology
and Computer Science,pp301- 303. Y.Zhao and Z.Ye, “A Low Cost GSM/GPRS Based
Wireless Home Security System”, IEEE Transactions on Consumer Electronics, Vol. 54, No.
2, pp.200-215, (2008).
2. Manoj Kanta Mainali & Shingo Mabu (2010) “Evolutionary Approach for the Traffic Volume
Estimation of Road Sections”, pp100- 105, IEEE.
3. Shilpa S. Chavan, Dr. R. S. Deshpande & J. G. Rana (2009) “Design of Intelligent Traffic
Light Controller Using Embedded System” Second International Conference on Emerging
Trends in Engineering and Technology, pp1086- 1091.
4. Xu Li, Wei Shu, Minglu Li, Hong-Yu Huang, Pei-En Luo, and Min-You Wu, “Performance
Evaluation of Vehicle-Based Mobile Sensor Networks for Traffic Monitoring” IEEE 2009 .
5. Manoj KantaMainali& Shingo Mabu (2010) “Evolutionary Approach for the Traffic Volume
Estimation of Road Sections”, pp100- 105, IEEE.
6. Ahmed S. Salama, Bahaa K. Saleh, Mohamad M. Eassa “Intelligent Cross Road Traffic
Management System”, (ICRTMS), 2010 2nd International Conference on Computer
Technology and Development (ICCTD 2010).