Instructables
Picture of Fully-functional Duplo traffic light
My kids love playing with Duplo vehicles.  And my eldest recently became fascinated by traffic lights.  So I figured they might get a kick out of having a traffic light that lit up, and could change from red to green, and back, with the touch of a button.

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!
 
Remove these adsRemove these ads by Signing Up

Step 1: Ingredients

Picture of Ingredients
DSC05742.JPG
DSC05737.JPG
DSC05736.JPG
DSC05730.JPG
Here are the bits you'll need to make this traffic light.  Obviously you can vary according to personal taste or what you have lying around - all of these things were scavenged from odd lego sets and electronic parts that I had already.

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.
Hacksaw
Superglue (be careful at all times not to glue your skin - that stuff sets FAST and strong).
Small screwdriver
Small pliers
Craft knife
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.
Can u make me one of these?
TomekPL9 months ago
Hi,

why are you not using resistors to limit the current flowing through LED?

I was searching for ideas how to build traffic lights and that's how I came to your site.

BR,
Tomek
FanjitaUK (author)  TomekPL9 months ago

Hi Tomek,

The coin cell isn't capable of putting out enough current to damage the LED, so a resistor just isn't necessary. You can happily wire an LED directly to a coin cell and it will be fine - do a search for "LED throwies" to see another example that makes use of this fact.

TomekPL FanjitaUK9 months ago

Hi,

thanks for your reply. So the red LED (with let's say forward voltage @ 1.8V) also doesn't require a current limiting resistor because the battery (3 Volts) is so low current source- correct?

BR,
Tomek

FanjitaUK (author)  TomekPL9 months ago

Correct. A typical small LED generally has a max current rating of about 10-15mA. The typical maximum discharge current of a CR2032 is about 4mA - so there's lots of margin.

TomekPL FanjitaUK9 months ago

I've found a great article that explores this topic http://www.evilmadscientist.com/2009/some-thoughts...
it turns out, it's good to use current limiting resistor if you want to have long battery life. Note the current they measured using red LED.

Duplo brings back memories....
FanjitaUK (author) 2 years ago
Thanks for the praise.

I knew I wanted to make it as soon as I noticed the perfect pattern of 3 tubes on the bottom of the small bricks, and it was a fun exercise bringing it all together.

Most important of all, the kids love it!
techxpert2 years ago
try a 555 timer not as simple but no programming required
FanjitaUK (author)  techxpert2 years ago
Yeah, I considered a 555, but I happened to have a pile of ATTinies lying around, they're almost as cheap, and their great advantage is the minimal parts count. There's so little space inside the Lego that space was critical.

The ATTiny is programmed to go into deep sleep when the button hasn't been pressed for a while, to preserve battery life. I think that would also be pretty hard to achieve with a 555-based approach.
mikeasaurus2 years ago
Fun idea, I like it!
Very nice!