# density based traffic light control program

can you guys help me with the program for density based traffic control system. 8) 8) 8)

yes we could but we need your help toooo

Yes.

do {
write specifications
design hardware
write software
test stuff
} until (it_works);

Rob

ash901226:
yes we could but we need your help toooo

any help u need that i can do

of course !

What will you input? What is your code so far?
Paste it here.
Also the logic you want your program to follow. The acquire data method you are using.

so far i have not started coding.
Just finished the algorithm.

This is what i have in mind

I have 2 pins as output ( to select the side of traffic)
I have 2 pins as input from sensors ( 1st one for low and 2nd one for high traffic density)
I have to connect 4*(one red , one green,one yellow LED)s (About the LEDs i havent desided how.
But this is how i think it will work.

The idea i have is to connect 2 LEDs parallel with opposite polarity to these pins and also from these pins take inputs of an AND gate and connect the 3rd LED across the AND gate output and ground.

for the first 2 LEDs output 01 or 10 to the pins and if i give 11 as output the 3rd will light up

for the led how about you try to find the tri colour LED, there are 3 type of Tri colour LED,

1. 3 pin middle pin common anode, the other 2 red and green
2. 3 pin middle pin common cathode, the other 2 red and green
3. 2 pin when one pin high and the other Low, red light up, if vice versa green light up, if the switching happen fast enough yellowish or orange colour led will light up.

@ash

I require variable delay for red and green (30seconds to 1 minute)
for the yellow i need a delay of 3 seconds.

If I were you, I would divide the problem into four main parts:

Design the control algorithm, and test it out with paper and pencil to make sure you understand how it works in real-world scenarios.

Identify the hardware you need to interface with, and decide how you will physically connect that to the Arduino (which pins you will use, what circuits you will attach to those pins, and how you will access those within Arduino.

Write a sketch containing simple low level functions to interface to all those inputs and outputs and confirm that you can make the lamps go on and off and get valid sensor input.

The hard part - implement your control algorithm on top of those simple low-level functions, and get it working in the same scenarios that you used for your pencil-and-paper testing.

i did this problem 4 times already. one in VB, one in PLC, one in simulation and one in Arduino.
from my experience, its better to make a step diagram and a timing diagram. then after you have finish doing then go to the construction of the hardware, after that just go and continue with your programming stage.

i did a 4 intersection traffic light with pedestrian light that only could be activate with button with every lane. the whole detail is here somewhere (my house). it also simulate a sensor underneath the first car and the third car in every lane. it also follow a certain rule, here for instant the traffic light will light up in an anticlockwise manner. and also b4 the light turn yellow, the green light will blink 10 time. the yellow light will light up for 5 seconds and then the red. during the first 5 seconds all the rad light will light up .

there is so much more i can do with the project but eventually i did not work with a traffic department.

@ash
can u suggest any extra ideas to my project???

what i did was a 4 junction intersection. it is assume that each intersection would have its own traffic light. at every lane there are 2 capasitive sensor. one under the first car and one under the 3rd or 5th car. that way you can assume 2 thing, if the first sensor trigger then it means that there is a car in that lane so sooner or later the traffic light should go green. if it doesnt then, that lane should remain red and let the other lane go first. thus reducing the congestion. ok for the 3rd/5th car sensor it show how many car are waiting on that lane, so if in the event of all the 1st sensor tigger, then the one that have the 3rd/5th sensor should go first. if in the event that all the third sensor trigger then, it will follow the anticlockwise rotation.

I want a program for control of traffic lights based on counting no. of vehicles crossed an ir sensor in a preset time