Density Traffic Signal System using Microcontroller |Best Electronics Project

atmega traffic signal system

Traffic control becomes a major issue nowadays, because of the increment of automobile vehicles & because of large delay time between the traffic lights. So, to overcome this problem, we have a project, a density traffic signal system using microcontrollers. Read the full article and understand how to control the traffic lights based on density using microcontrollers.

Also Read: Best Electronics Project Tutorials

Density Traffic Signal System Principle:

The density based traffic light system use IR sensors to measure the traffic density. We have placed one IR sensor for each of the roads, these IR sensors will always sense the traffic on that road. All these IR sensors are interfaced to the microcontroller board. Based on these sensors, the microcontroller detects the traffic and controls it.

The main and important part of this traffic system is the microcontroller. The IR sensors are connected to the C PORT (PC0, PC1, PC2, & PC3) of the microcontroller and the PORT B & D connects with the traffic lights. The sensor output becomes logic 0 If there is traffic on road, otherwise logic 1. We have to write the program code to control the traffic signal system based on density by the output of these IR sensors.

Also Visit: Latest Jobs, Interships & Off-Campus drives

If the microcontroller receives logic 0 from any of the IR sensors, then we give the green light signal to that road and gives red traffic signal to all other roads. We have to continuously monitor the outputs of IR sensors to check for the traffic.

Density Traffic Signal System Circuit Diagram:

density traffic signal system  ]circuit diagram
Density based traffic signal system circuit diagram

Components Required for Traffic Signal System:

  • ATmega8 microcontroller
  • PCB board
  • 4 IR sensors
  • LED bulbs – 12(4-red,4-green,4-yellow)

Also Visit: Latest Jobs, Interships & Off-Campus drives

  • 12v Battery
  • Serial cable
  • Connecting wires

Also Read: Wireless AC light Dimmer Using Arduino: Hand Gesture based

ComponentsQuantityBuy from Amazon
Atmega8 controller1Buy Now
PCB board1Buy Now
IR Sensor4Buy Now
LED Bulb12Buy Now
12V Battery1Buy Now
Connecting Wires1Buy Now

Density Traffic Signal System Circuit Design:

This Arduino based traffic light system circuit consists of atmega8 microcontroller, 4 IR sensors, and 4 traffic lights.

The IR transmitter emits infrared rays and it looks like an LED. It needs an operating voltage of 2 to 3 volts. These infrared rays are invisible to the human eyes. But we can view the rays through a camera.

The IR receiver receives the infrared rays transmitted by IR transmitter. Generally the receiver has high resistance (mega ohms), but when it is receiving the infrared rays, the resistance is very low. The IR receiver also need a operating voltage of 2 to 3 Volts.

Also Read: Social Distancing Cap Using Arduino

To receive the infrared rays we have to place the pair of IR in a way such that when there’s an obstacle in front of IR, it receives the rays. When the power supply is given to sensors, the transmitted rays hits the object and then reflect back to receiver.

We used LEDs of red, yellow & green colors instead of traffic lights. In a normal traffic system, the lights glow on a timely basis. If the density of traffic density is high on any road, then the green LED glows on that particular path, and for remaining paths the red LED glows. In a normal traffic system, there is a time delay of 1 minute for each path.

Operation of Density based Traffic Signal System Circuit:

  • First Connect a 12V battery power supply or power adaptor to the development board.
  • Now, Switch on the supply.
  • Burn the program code to the ATmega8 controller and keep the programming switch sw2 in program mode.
  • Connect all four IR sensors to PORT C.
  • Connect the color LEDs to PORT B & PORT D.
  • Arrange all these LED lights as traffic lights.
  • keep one IR sensor for each of the roads.
  • Now, this is a normal time-based traffic system.
  • Now if you keep the object in front of any IR sensor, then this traffic signal system glows Greenlight and allows the traffic of that road.
Program code of Density Traffic Signal System: Click Here

For more electronics projects visit our website regularly, and don’t forget to join our social media groups for latest updates of jobs, internships & projects.


Please enter your comment!
Please enter your name here