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.
Outline
Toggle- Density Based Traffic Signal System Circuit Principle:
- Density Based Traffic Signal System Circuit Diagram:
Density Based Traffic Signal System Circuit Principle:
The main heart of this traffic system is microcontroller. IR sensors are connected to the PORT C (PC0, PC1, PC2, and PC3) of the microcontroller and traffic lights are connected to PORT B and PORT D. If there is a 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.
Also Read the Post – How IR Sensor Based Car Parking Guard Works?
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.
Density Based Traffic Signal System Circuit Diagram:
Circuit Components:
- ATmega8 controller
- PCB board
- IR sensors -4
- LED’s-12(4-red,4-green,4-yellow)
- 12v Battery or adaptor
- Serial cable
- Connecting wires
Density Based Traffic Light Control System Circuit Design:
This circuit consists of 4 IR sensors, atmega8 microcontroller, 4 traffic lights.
IR transmitter looks like an LED. This IR transmitter always emits IR rays from it. The operating voltage of this IR transmitter is 2 to 3v. These IR (infra red) rays are invisible to the human eye. But we can view these IR rays through camera.
IR receiver receives IR rays that are transmitted by IR transmitter. Normally IR receiver has high resistance in order of mega ohms, when it is receiving IR rays the resistance is very low. The operating voltage of IR receiver also 2 to 3V.
[Also Read: How To Make an Adjustable Timer ]
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.
In normal traffic system, we allow the traffic for a time delay of 1 minute for each path.
The above figure shows the IR sensor circuit. Here 330 ohm resistor is used to drop the voltage otherwise IR transmitter may get damaged. To vary the obstacle sensing distance, we have used a potentiometer. We have taken the ouput from transistor collector. This sensor gives the digital output.
Density based Traffic Signal System Circuit Simulation Video:
DOWNLOAD PROJECT CODE
How to Operate Density based Traffic Signal System Circuit?
- Connect 12V battery or adaptor to the development board.
- Switch on the supply.
- Burn the program to the ATmega8 microcontroller by keeping the programming switch sw2 in program mode.
- Connect four IR sensors to PORT C.
- Connect LEDs to PORT B and PORT D.
- Arrange all this LED’s same as like traffic lights.
- Arrange one IR sensor for each road.
- Now you can see the normal traffic system based on time basis.
- Now if you place any obstacle in front of any IR sensor, then the system allows the traffic of that particular path by glowing GREEN light.
- Finally, turn off the board power supply.
Density based Traffic Signal System Project Output Video:
Limitations of this Circuit:
- IR sensors sometimes may absorb normal light also. As a result, traffic system works in improper way.
- IR sensors work only for fewer distances.
- We have to arrange IR sensors in accurate manner otherwise they may not detect the traffic density.
115 Responses
What will be the range of IR sensors.
Here, the range of IR sensors is 10cm and it is a prototype circuit. In real time, we use different sensors for traffic signal system.
i want to do this project so now i need internal circuit so please provide me madam
Sir,
please told me the IC program language
It is a prototype circuit so we use IR sensors which range is 10cm.But in real time which sensor is used.what is the program and how I got the program of microcontroller on density base traffic control.
In real time applications you can use IR detectors, which has a range of about 100m
Is this project completely based on Electronic components?
can i know the block diagram of this system?
does this ckt diagram works if i want use two IR sensors at each path of traffic light system and if not works them what modifications needed to do so .
if u know that kind circiut then send it to me please .
good
Thank you so much for your comment, we love your support, keep following us at facebook.com/electronicshub.org.
If we want to connect 8051 in this circuit … it is possible or not ?
if it is possible then what changes should be done in circuit diagram ?
Send me abstract n cost for the following project:
Density Based Traffic Signal System using Microcontroller
We are not selling any projects, we love to educate students through this blog.
Thank you.
Dear sir, what will happen if the traffic is high from all the ends, i mean if IR sensor detect traffic from the four side or more then one side at the same time.
Thanks
‘I want to make it for semester final project and i want to make it as same as it is.
in this project we can use micro controller 8051 or not ? if the answer is yes then what could be circuit diagram ?
Im going to do project on title “Density based traffic light control”
My questions are as follows
1. What type of sensor can be used for density based traffic signal control project?
2.If the density on all roads are same means what will happen?
3.If there is a political procession and thousands of people gathered in a road means how IR sensor differentiate vehicle from people? Also in case of above situation will IR sensor detect that crowd as density ?
4. please send me program of microcontroller for this project..
please if anyone knows answer for those questions, please do reply…
I want to complete this project within a weak..So please help me..
Thankyou.
what is advantages or disadv and application………….
I would like to get your guys’ code. I have been making the same thing for my class’s final project using an arduino board with an atmega controller but I can’t get the case and break statements right. It would be helpful if I could have a look at your code to debug mine.
Much appreciated.
plz send me code of this project
I am doing same project using ARM Processor that is FRDMKL25z , I want to know about coding in that.
i need coding for my final semester project n i will make it as same as it is plz i need coding …
i have to make it as final project plz give me coding..
Hey sidra, we have already provided code in the article, if you are unable to find download form here.
how can i produce hex file of thiz coding
i need to knw that how can i produce hex file.. plz help or email me the hex file plzzzz…
plz email me hex file plz
use keil uvision to convert
But in kiel the Atmega8 is not present
So what to do….??
Can any1 tell me what to do…..
Need help
Sir for this c programming code which compiler we have to use is turbo c is gud for it
how can i prodece hex file?
plz give me the full video i m nt able to do it by myself …
i want to this project
Hi, I am a student and I would like to know the programming done for this.
I am going to implement the exact project as you did….. So pls help me with the exact code and circuit diagram of this project….. Reply me quickly.
Code is already provided in the article.Please go through it.
i had checked it it contains errors
I need the source code for my final project in college.
My project is a smart traffic light system for emergency and VIP vehicle. the traffic light system will communicate with the vehicle to detect the position and movement. When the vehicle at the exact certain position the traffic light will turn green immediately.
please send me the source code, i really need it.
we are going to implement similar kind of project with some modification and we need this project code to view some examples code. we are trying to implement priority based system to this project.
I’m 3rd E&TC student .I try to make mini project on traffic signal ie why i want to code
I want the codes and proper circuit diagram for my college project for my internals, so please help me by providing them.
Can u tell me the exact microcontroller name..
N plz provide the code too.
Mail me
We are going to implemente this project …so kindly send the code….
we are going to implement this project. so please send the code for us as early as possible.
our mini project group want to make the same project,,
and yes we are very interested to make it
so please give us the code……………………..
I want to make similar project …plzzz send the codes and ckt diagram
hy I need to do this same project in my final year so plz provide me a code
Yes I want to do the same project on this topic
Sir my question is that if particular road contains any ambulance how come we will allow based on density
sir, please send me code for density based traffic signal system using microcontroller
i am very interest to do this project so kindly give the code and circuit diagram for this project
We have included both in the article.Please go through it once
pls tell us the program used in microcontoller used in this circuit
Code is uploaded please install keil software to open these files
Yes, i need to do the same project in this my final year. I am really interested. Thank you
which software did u use to execute this code… and how did u dumped it into atmega8 ic?
Youc can use Avr studio IDE for writing the code..and for burning the code into microcontroller ,you can use PROGISP
Thanks for sharing a good project..I am doing this project as any innovative embedded system design as mini project…..But i want to use fuzzy logic and different sensors…..So please help me out..and send me the code also once i will go through that…
Thanking you..
Read the article completely.Code is Uploaded in the article
can we go for some other sensor rather than IR
yess you can any other sensor.
I want to do this project in first year I can do it this project
can i get the code for this project
If one side high traffic is there then how will communicate all sensors each other ????Have u developed SPI protocol??and In this why we need external interrupts???
Please go through the code for all the details..
but which loader used in this experiment ??? can we use 8051 loader used in this experiment????
1. we want your project code to study about this project.
2. yes, we want to change and make it different.
3. we want to add emergency way for ambulance.
hi.. we are making our mini project on density based traffic light control with little modifications. we are going to use different sensor like microwave sensor. we want your project code to study about this project.
Please dowload code from the article itself
what are the components used to make this ciruit…
how can we find which side has the high density and compare with the other sides at traffic junction.
can we use raspberry pi for density based traffic controller interfacing with IOT.
give the reply for this questions
In the circuit diagram,analog IR sensors are used.But in project output video digital sensors are used..So please suggest me to use either analog or digital.And if I use analog sensors,shall i feel any difficulty while implementing this porject?
In the circuit diagram,analog sensors are used..But in project output video digital sensors are used.Plz suggest me to use which type of sensors for it
on which software have u compiled the code?
1) What is the ampere reading of the 12V battery used in this project?
2) what board have you used for the MC?
while compiling the code using KEIL software, what extension is to be given to the file, so as to add files to the source group and build target? .C and .ASM extensions are generating various syntax errors.
Do let me know at the earliest.
How IR sensor measure density is high on one side?
when there is traffic on two or more sides how will the signals react?
Can we add the condition that if there is a traffic at only one side then only open the signal for long time,
and when we have traffic at one side and we open the signal for long time what happen when other side also getting traffic? can we abbreviate the delay of signal in this case?
Please reply ASAP
Thnks in advance!
how is it possible to have a yellow signal for such a long time. and when you kept your hands near sensor it shows red but when it will be turning to green again??? how this can be applied on practical base….Should have to put the car near the sensor.
What will be the extra components required?
For the example the resistors connected to the LEDs as shown in the output video.
And what will be their value?
Hello, I downloaded the code which is provided and used it. Burnt the hex file onto the Atmega8 mc, but the system is not working as shown in the video. Infact it’s not behaving as a traffic control system at all. Can u pls verify the code and let me know regarding the same ASAP. Also if there are any resistors or as such to be added in the circuit which are not shown in the circuit diagram
Sir can you please provide project report of this project
every thing is ready but when ir detect the signal then no change in traffic light??
IR detect the signal but lights are not change..why??
i am doing the same project as my final year project..i would like to know the components used to make this circuit work..because ours is not..
i am making the same project as my final year project..so i would like to know the components used to make this project work…
Need all the header files to make this project using AT89S52 microcontroller.
Administrator…what happens when the traffic on all four sides is high?..how it will detect them?..could u plzz clear up my doubt ..plz…tqq
What if there is traffic on two roads how will the signal react?
can we count the number of vehicles exactly using IR sensor
Hi. I am doing this project, i needed your on connections of this circuit. please help
the picture does not show properly like how the power supply is connected and as the microcontroller is being used how does it work. the one in video seems like Arduino is being used so it is very simple.
Please tell me more about microcontroller..please provied complete detail about the microcontroller ..and full name of microcontroller used in this project…ATmega 8 please full name after 8 ..which we use in this project.
What is software development tool used for atmega8 coding ?
is given project code is direct hex code or we have to generate it ?
and how to generate ?
sir what value resistor is to be taken for the led
I done this project with 8051 there are some disadvantages if both sides the emergency vehicles come means what will happen?
hi i want to make project of density based traffic lights system, can u tell me plz which things are required in what ranges also its code.
Instead of ATmega8 can we use pic microcontroller..
yess you can..
Will the code remain same ..???
F_cpu redefined error is showing
i connect all the leds as same and the sensors and also input the program but the leds are not ON after giving the power supply. what is the problem ???????
what will be the resistor for each LED????
what will be the exact voltage for this???
How IR sensor will sense the traffic please explain me coding of sensing
LOVE this article (and your others!). It’s actually a great and helpful piece of information. Very nice description regarding traffic signal system using microcontroller. I got clear idea regarding this topic
Sir , please tell me how the IR sensors detect the traffic means to say the on what basis either number of vehicles or any other process. And what is the name of IR sensor which you have used
i Want to do this project using Atmega 16 .. Can anyone provide me the code ???
I want do this project using 8051 microcontroller,so then crystal oscillator should be connected to which pin of the microcontroller.If possible can i have circuit diagram
Crystal Oscillator (usually, 11.0592MHz) must be connected at pins 18 and 19 of 8051.
Sir, please let me know Is there any difference between wireless technology based traffic signal control and density based traffic control system
What will be the range of resistors for each led?
Will i have to write a seperate code for normal functioning of the traffic lights or the code provided from your side is upto mark?
I am getting undefined identifier at PORTD which is after else statement. How to rectify this error? Please answer
I want code for this project.anybody help me
Can I get the code for the prototyping Model? I liked the idea, I’m wanting to take this up as my project topic.
I want to buy that kit so can u send me details of the kit like cost and equipment