So I'm building a traffic light controller for a traffic light I just happen to have laying around my house. I have a code that does various patterns on the lights which works fine on LEDs but I'm having trouble on the large scale design. The patterns are cycled by pressing a switch that calls an interrupt and increments a counter. I've tried connecting the UNO to a darlington array ( ULN2803APG) that in turn enables a 12 volt supply to close relays and turn on certain lights but I've been running into issues. The main problem is that when I connect my circuit to 120 AC, the switch is pulled high and low without a toggle. Any suggestions? Once again, the circuitry and code works when used on a small scale model.
I'm trying to figure out a sturdy solution so if you have any suggestions I would greatly appreciate them. I have attached a crude schematic for reference.