Traffic lights for driver training, school and autodrome. Idle mode selectable by switch.
Arduino Duemilanove with Atmega168 microcontroller onboard is used as controlling device.
The device is supplied from AC power grid via switching power supply, or from 12 V SLA or NiMH accumulator.
Duty cycle polls switch state. If switch input pulled low, device shows idle mode by yellow
light blinking. Otherwise, the device goes through traffic light program via delays between
lights switching. Lights are switched by 943-1C-9DS relays, driven by any small power NPN
transistors, such as S8050.
If SLA cell or other 12 V source is used as power supply, 943-1C-12DS relays should be used
insted of 943-1C-9DS. Total current sank from relays should be less than 7 A. 7809 regulator
is preferred before Arduino power input to reduce 7805 heating on it.
If AC/DC power supply is used, it should be capable to supply up to 400 mA at 9 V.
Algorithm and Arduino sketch
RED/YELLOW/GREEN outputs is used for main direction and RED2/YELLOW/GREEN2 for perpendicular
direction. There no second YELLOW relay since yellow lights on both directions are turned on
or off simultaneously.