traffic_lights

A simple set of toy traffic lights using an at-tiny85 at not much else, except the LEDs obviously.

notes/attachments/traffic_lights/IMG_20200321_165418.jpg

There is a button to turn the thing on, and make the lights change before the timer says so. Software has two parts: a simple state machine managing light states and going to sleep and an ISR that generates software PWM on three pins for the LEDs.

notes/attachments/traffic_lights/state_machine.png

There's no off switch, after a while the tiny85 will go to sleep and a press on the button will wake it up again. I use a cheap li-ion pouch cell and USB charger from amazon, one charge lasts for months asleep.

There really isn't much other than the attiny, the LEDs and the switch:

notes/attachments/traffic_lights/traffic_lights_sch.png

Browse the source or build using arduino-makefile (included), say:

$ git clone http://joe.milbourn.org.uk/clone/trafficlights.git
$ cd trafficlights
$ make
$ make ispload

after updating the makefile to point to an arduino running the arduino ISP sketch, and connecting that to the avrisp connector on the traffic lights.

#electronics