Video not playing? See it on YouTube: http://www.youtube.com/watch?v=q0tiiWwC6Zo
Every Christmas we set up a large LEGO train layout in a section of the living room. This year, I ended up winning an eBay auction for a number of older-model LEGO road plates, one of which included a T-intersection. At about the same time, I saw a web magazine article on how to get started programming an Arduino embedded microcontroller. I'm a computer programmer by trade.
It seemed obvious to me at this point that a perfect project would be to create an LED traffic light out of LEGO bricks, some LEDs and resistors and an Arduino Nano controller. The T-Intersection became the center-piece of the layout. This Instructable will lead you through building the traffic light, as well as illustrate how the Arduino program works.
This is my second attempt at building the traffic light. On the first attempt, my 9-year old son helped me. Being slightly impatient, as 9-year-olds are apt to be, I was left with no time to take detailed photographs. The LEDs I used, found in my parts bin, were also extremely dim: bright at night, but invisible in the day.
With this second attempt, I obtained much brighter LEDs from a string of LED Christmas Tree lights that only half lit up. I also took very detailed close-up photographs with a brand new Sony DSC-TX5 digital camera that can close focus down to 1cm. I've annotated many of the photos.
You can choose to build this Instructable as presented or just use it for inspiration for your own creation. I realize that LEGO T-intersection road plates have long since been discontinued and are hard to come by now. Cross-intersections are all that are available in LEGO stores now. You might choose to build a fourth light. I've supplied an alternate program that should drive a cross-intersection with four advance green-lights. It should work, but since I was testing the program only on my T-intersection, it might not work perfectly. You'll need more LEGO bricks and LEDs to build such a light.