Introduction: Arduino Traffic Light
This instructable is derived from: Arduino-Traffic-Light-Simulator
I have used the drawing from this instructable, to create a separate traffic light. I made the following changes:
Holes for LEDs are smaller, for 5mm LEDs (instead of 10mm LEDs).
Added tiny platform, so the traffic light can stand on its own.
Changed the shape, so that it can be used for material with thickness of 4mm (instead of 3mm).
Note on cost: Since 5mm LEDs are cheaper then 10mm LEDs and 4mm plywood is cheaper then 3mm acrylic, this is a 'budget' version of the traffic light.
The traffic light can be connected to (and off course programmed with) any microcontroller (such as Arduino UNO).
Tip: use an Attiny 85 development board if you wish to keep your entire project very small.
With many thanks @ pcvnes for a very good and clear instructable! I really appreciate that even includes instructions (lesmateriaal) in Dutch!
Step 1: Parts List and Tools
The following parts are needed:
- 1 red LED, 5 mm
- 1 yellow (or orange) LED, 5 mm
- 1 green LED, 5 mm
- a piece of plywood, 4 mm thick. Size is about 11 cm x 12 cm.
Or acrylic or any other material that can be cut with a lasercutter, as long as the thickness is 4 mm.
- 4 jumper wires:
- a red, yellow, green wire, 10 cm
- a black one, 15 or 20 cm
I have used wires that correspond with the colors of the LEDs, if you don't care about the colour, 2 jumper wires will be enough, as they are cut in half.
a bit of scrap wire (3 cm or so)
To turn the traffic light on, and to program it, you also need a microcontroller (such as Arduino UNO) and 4 jumper wires to connect the traffic light to your microcontroller. This part is not included in this instructable.
The following tools are needed:
- a laser cutter (see next step if you don't have one)
- a soldering iron (and a bit of solder tin)
- something to strip the jumper wires with (I used a sharp knife (stanleymes) for this)
- wood glue
Step 2: Cut Out Parts
Cut out the parts with a lasercutter. The base (square with the cross-shaped hole) needs to be cut out twice.
I have used the laser cutter from my local FabLab.
To find the FabLab closest to you , visit: https://www.fablabs.io/labs/map
I assume you could also print the drawing on a piece of paper, stick it to plywood and use a hand (fret)saw, and drill the holes. Or even use strong cardboard. I have not tried it though.
Step 3: Assemble Parts
Assemble the parts, as described in step 3 of this instructable: https://www.instructables.com/id/Arduino-Traffic-L...
Because the LEDs are smaller then in the original instructable, you may not be able to connect all LEDs without an extra piece of wire. I needed one piece of wire of 2,5 cm (from the red LED to one of the resistors) so I used a piece of wire left over from another project. If you don't have wire left over, you could also use a piece of paperclip (leg of a LED, resistor, etc.), this also works fine.
Because I do not own tools to put 4 dupont pins at the end of a wire, I have cut 4 jumper wires in half. Strip the end of each wire. Solder half a jumper wire to the end of each resistor (red wire at the resistor that has the red light, yellow to yellow, green to green). Then solder a black jumper wire to the green LED, the anode (minus or short) pin.
- Jumper wires can be male or female. Males are recommended if you plan to connect your traffic light to a breadboard or Arduino UNO. Females if you plan to connect to an Arduino Nano or Attiny 85.
It is most easy to attach LEDs, wires and resistors, before gluing the parts together.
- Because you only need half a each wire for 1 traffic light, you could used the 4 pieces of wire left over for a second traffic light.
- I stapled the wires to the wood for extra strength, this was a bad idea. The wires do not stay in place, and it's easy to damage them. Next time, I plan to use hot glue.