With the era of smart technologies, everything is getting smarter and smart transport system is one of the fields which is going to put a huge impact on our lives.
Orignally published at: https://highvoltages.co/tutorial/arduino-tutorial/traffic-signal-using-arduino-and-ultrasonic-sensor/
Arduino being one of the easiest microcontrollers to use, easy to program, easily available in local markets is popular among the students and hobbyists.
Knowing all that, I put my knowledge to make this Density-based traffic signal using Arduino with all the components that are easily available.
This project is a prototype of density based controlling of traffic lights which will check the densities on both ways and will decide which light should be on.
Lets get started.
we will be using two ultrasonic sensors for two ways and 6 LEDs, 3 for each side.
Ultrasonic Sensor 1:
Ultrasonic Sensor 2:
LEDs:
You can find the code by clicking here .
Upload code and you are good to go .
Check video if you find any trouble.