Hello, total newbie here! Does anyone know of an already existing traffic light set-up that uses inductive proximity sensors? We need it for our research, and we are in need of both a breadboard set-up and a program.
Basically, the lights will change depending on which lane has more cars. Two sensors will be placed beneath each lane–the first one located at the start of the lane, and the second one at a much farther distance. This simulates the amount of cars lined up per lane.
Lane 1 will have its first sensor read–if it does not read a car, it will ask the other lane’s first sensor to read a car. If a car is detected, the traffic lights will switch accordingly to let that car pass immediately.
However, if in Lane 1, the first sensor reads a car, it will ask the second sensor of that same lane if it reads a car. If there is a car, the program will let it past. If there is no car, the program will read Lane 2 for any cars.
If Lane 2 is filled to its second sensor, it will let that lane pass first. If there are no cars detected in Lane 2, it will let the first lane pass. If no cars are detected for both lanes, then the program will loop until the sensor reads a car.
Attached is the flowchart to this project.
EDIT: we’re high school seniors by the way, and this is for our research project