traffic control

hello, im doing project on traffic control using ir sensor and arduino. but im facing problem that my project is not working properly.there’s som problem with ground pin whenever i removed and re attached ground pin the loop start and after complication of loop it ends.
I grounded all the ir sensor and led’s negative terminal by common ground same for +5v power supply.
i have attached my source code in attachment. please help me on this.

test_1.ino (10.9 KB)

You should post a schematic of the circuit.

yes i tried to reset it.i also separate the ground or leds ans ir sensors.

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :)