My design goals for this project were:
1. It must be kid-proof - including an inquisitive toddler.
2. It should be properly compatible with Duplo sets.
3. It must be an authentic traffic light sequence - in the UK, that's Red, Red+Amber, Green, Amber, Red.
4. The battery should last a long time between changes.
5. It must be cheap!
In total, not counting the cost of the Lego parts (which were all scavenged from sets lying around the house) this traffic light cost me less than £5 UKP. Here's a video of it in action:
This is my first Instructable, so bear with me!
Step 1: Ingredients
2x standard Lego 2x4 black bricks (part code 3001)
1x Lego Technic black ribbed hose (part code 78). I used this for the 'pole', as it's flexible so much harder for kids to break!
1x Lego Traffic Cone (I couldn't find a part number, but it's in this cheap set: 5679)
1x Lego Duplo 2x2x1 black square brick (part code 3437)
1x 5mm Red LED
1x 5mm Yellow LED
1x 5mm Green LED
(I think that using LEDs with coloured, rather than clear, plastic gives the best effect)
1x small tactile pushbutton with a round button (like this)
1x CR2032 coin cell
1x CR2032 battery holder (like this)
1x ATTiny45 or ATTiny85 microcontroller
2x very small machine screws + bolts (I think I used M3 x 25mm)
A blob of BluTac or similar putty-like substance
A small length of hookup wire - preferably solid core rather than stranded. Having multiple colours, especially red, yellow and green, helps.
As for tools, you'll need:
Soldering iron and solder
Wire strippers and cutters
Drill or Dremel with a selection of small bits, including 5mm.
Superglue (be careful at all times not to glue your skin - that stuff sets FAST and strong).
Hot glue gun
Some way of programming the microcontroller - you can use an Arduino (using these instructions), or a dedicated programming tool such as an USBtinyISP.
A breadboard or other electronic prototyping environment, for testing the program.