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!

Step 1: Ingredients

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.
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.
<p>I made it for my son :)</p>
<p>Hey! I made a modified version for my girlfriends nephew! </p><p>Check it out: <a href="https://www.instructables.com/id/ATtiny85-Traffic-light-toy/" rel="nofollow">https://www.instructables.com/id/ATtiny85-Traffic-l...</a></p>
Can u make me one of these?
Hi,<br><br>why are you not using resistors to limit the current flowing through LED? <br><br>I was searching for ideas how to build traffic lights and that's how I came to your site.<br><br>BR,<br>Tomek
<p>Hi Tomek,</p><p>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 &quot;LED throwies&quot; to see another example that makes use of this fact.</p>
<p>Hi,<br><br>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><br>BR,<br>Tomek</p>
<p>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.</p>
<p>I've found a great article that explores this topic <a href="http://www.evilmadscientist.com/2009/some-thoughts-on-throwies/" rel="nofollow">http://www.evilmadscientist.com/2009/some-thoughts...</a> <br>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.</p>
Duplo brings back memories....
Thanks for the praise.<br><br>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.<br><br>Most important of all, the kids love it!
try a 555 timer not as simple but no programming required
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.<br><br>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.
Fun idea, I like it!
Very nice!

About This Instructable




More by FanjitaUK:Fully-functional Duplo traffic light 
Add instructable to: