Arduino: Making a set of traffic lights

 by unknowndomain
6.jpg
THIS PROJECT IS STILL A WORK IN PROGRESS FEEDBACK APPRECIATED!!!

This tutorial will step you through the process of creating a set of controlable and configurable traffic lights whilst also teaching you the basics of Arduino. Some knowledge is needed and I highly recommend reading and following through on most if not all of the pages of the following document, created by the wonderful Arduino.cc people!

Arduino - Getting started guide

This document will explain in simple terms about the basic electronic components we will be using and how to use them, it also describes digital, analogue and serial inputs and outputs and how they are used.

You may have read my previous tutorial on traffic lights, this will be a similar concept however will be easier to build and more feature rich, because of the simplicity of the Arduino development environment.

After this project, you might like to extend it by...
+ Making the lights work for cross roads (expanding the complexity of the sequence).
+ Making the settings programmable by using the EEPROM and Serial port.
+ Making the lights communicate with another Arduino running the same code.
 
Remove these adsRemove these ads by Signing Up

Step 1: Parts

You will need a few parts, if you already did my previous project on AVR microprocessors, then you don't need to buy the same things again, You should only need the Arduino and USB lead which you can get from Tinker.it and some form of 5v piezo sounder.

These are minimum requirements you could order more for backup or expansion of this project.

1x Breadboard (34-0655)
1x Jumper Links (34-0495)
2x Red LEDs (55-0155)
1x Orange (not amber) LED (55-0124)
2x Green LEDs (55-0120)
1x White LED (55-1640)
1x Piezo Sounder (35-0282)
1x Push to make button (78-0630)
1x 10K Resistors (62-0394)
1x 220ohm Resistors (62-0354)

OPTIONAL - 1x 3m USB Cable (19-8662)

Rapid Online - £20.70

1x Arduino Diecimila

Tinker.it- £20.35

The total was £41.05 which is higher than the AVR tutorial but its worth it and that includes delivery.

The delivery charges are quite high at rapid so why not shop about while your there and at Tinker.it and see if you can find some parts which you can play with at a later date. More LEDs and other bits which you think you can play with.

Good news is you won't need any tools or soldering for this project, its just pushing bits together! Once you have all the parts you are ready to assemble your project, however if you are planning to make this project more permanent you will want to get some form of strip board to solder your work down once its working.
saleh alomari says: Dec 7, 2012. 11:08 AM
What's name's program to software arduino ??
arduinolover says: May 8, 2010. 8:31 AM
 HI!
Great Project! ..but i cant see the code. The file is .tmp not .pde, please help us with this :)
unknowndomain (author) in reply to arduinoloverMay 8, 2010. 4:29 PM
 Its probably just your web browser, rename it to .pde and open in processing, should be fine, else DM me your email address and ill do it that way.
cocoliso in reply to unknowndomainFeb 5, 2011. 11:32 AM
It happens the same, you can send the sketch to my email?
albert_1960@hotmail.es

Best regards
get to da parakeet says: Nov 15, 2008. 11:00 AM
why a beeper?
unknowndomain (author) in reply to get to da parakeetJan 11, 2009. 3:23 AM
Its actually a piezo, which allows you to make any sound, where as a beeper allows you to only play with the built in circuit of that beeper. I did this because in the UK its customary for the traffic lights to beep to let you know when you can cross if you are blind.
cdousley in reply to unknowndomainJun 25, 2010. 11:04 PM
Why would you be driving if your blind?
jamie50 in reply to cdousleySep 27, 2010. 10:41 AM
he means if you are walking and you are blind, then you would know when to cross and when not to cross
cdousley in reply to jamie50Sep 27, 2010. 6:09 PM
ohh thanks I dont cross many streets so i didnt even think of it.
get to da parakeet in reply to unknowndomainMar 9, 2009. 4:19 PM
where do i get a Arduino Board for less than 30$ , i need one :(
Derin in reply to get to da parakeetMay 22, 2009. 7:03 AM
Adafruit has about 900 in stock for 22$ minus shipping.I will buy one tomorrow.
unknowndomain (author) in reply to get to da parakeetApr 11, 2009. 8:41 AM
http://www.sparkfun.com/commerce/product_info.php?products_id=666

There less than $30 however you will have to pay shipping.
BlackHatCracker in reply to get to da parakeetApr 10, 2009. 11:24 PM
I am sure if you search it out that you can find one somewhere close... or just blow the money, and then etch more boards from the design of that one... Its easy...
cdousley in reply to BlackHatCrackerSep 27, 2010. 6:09 PM
ebay!
chrisapalo says: Jul 7, 2009. 5:21 PM
Wow.. that's like the best instructable ever. Good work on making step by step for beginners. So I have a suggestion. I have no clue how to get this to work though... Get the light synced up with local ones, like maybe some that are down the street, or see if they have the actual timings somewhere, and set them up. Nice use of serial printing! And any arduino is well worth paying $30 for! Thanks and Good Job!
unknowndomain (author) in reply to chrisapaloJul 8, 2009. 12:45 PM
Thanks for your kind words, I do not think its possible to link with those but good luck tinkering!
Pyrotechnic-Robot says: Apr 11, 2009. 10:31 AM
Do you know how to run the arduino in VB so you can press a button in VB and then it lights a light? Thanks!
unknowndomain (author) in reply to Pyrotechnic-RobotApr 12, 2009. 3:57 AM
Its not about running it in VB all arduino is is a language and board, what you need to learn is how to communicate over the serial port using VB which I have never used as I am a mac user so unfortunatly I cannot help you but I am sure it is possible, perhapse a little experimentation with the basic built in Arduino examples and a bit of VB experimentation could make a good subject for an instructable and for your learning.
Pyrotechnic-Robot in reply to unknowndomainApr 12, 2009. 7:17 PM
Yhankyou. So i have to open the seral in the arduino and have it look for "F" and then have Vb write "F" in the seral when the arduino it will then exciute a program Seet! Bummer you can't us VB :(
unknowndomain (author) in reply to Pyrotechnic-RobotApr 13, 2009. 1:58 AM
No the device is a small computer which is running an app when you send it the letter F the program on it picks that up and does what you tell it to... Its called Visual Basic because it is based of the basic programming language so take a look at the Basic stamp it is a device which uses that language but to be totally honest your expecting it to be designed and crafted for VB which none of them are, Arduino is one of the easiest to use, theres parallax, basic stamp, arduino or simple Atmel chips which require C or ASM programming.
BlackHatCracker says: Apr 10, 2009. 11:44 PM
Ok so editing the sequence for the R,Y,G for the U.S. is easy... The question I have is, do you really need the buzzer in there? Is it at all possible to remove the buzzer and add a resistor that is the same value as the buzzer in place of that? I guess I am going to have to build this... Although I am thinking of making it on a larger scale. and doing 4 sides to it. and having 4 cross walk signs too... Thanks for the basic idea...
unknowndomain (author) in reply to BlackHatCrackerApr 11, 2009. 8:39 AM
Could you not just edit the code so it doesnt have a beep command rather than putting in a resistor?
amando96 says: Feb 7, 2009. 5:02 AM
thets pretty cool
unknowndomain (author) in reply to amando96Feb 7, 2009. 7:59 AM
Thanks.
Pyrotechnic-Robot says: Dec 31, 2008. 1:06 PM
HOw did you bet the black display box?
unknowndomain (author) in reply to Pyrotechnic-RobotJan 11, 2009. 3:22 AM
By clicking the last icon on the tool bar after installing the software i wrote.
dinky says: Oct 25, 2008. 5:23 AM
how you program the button ?
unknowndomain (author) in reply to dinkyOct 27, 2008. 6:41 AM
What do you mean?
dinky in reply to unknowndomainNov 15, 2008. 10:36 AM
how you program the button in the software because it is possible to pragram it in the arduino program.
unknowndomain (author) in reply to dinkyJan 11, 2009. 3:22 AM
It is programmed in the arduino software, so I am unsure as what your trying to do.
uberdum05 says: Jan 11, 2009. 2:22 AM
I bought myself a freeduino off eBay, but in the software I don't know what board to set it to.Please help me =)
unknowndomain (author) in reply to uberdum05Jan 11, 2009. 3:20 AM
DavidRobertson says: Aug 11, 2008. 8:18 AM
Cool. I just built it
unknowndomain (author) in reply to DavidRobertsonAug 11, 2008. 1:23 PM
Woop! Were there any parts which were not clear or you got stuck on, and what was / is your experiance level, I ask because I am trying to tune this to make it clearer, its not as good as my first tutorial but I hope it makes sense. I have been trying to do it for quite some time.
DavidRobertson in reply to unknowndomainAug 13, 2008. 1:54 PM
It's a great instructable with clear steps. I have been into electronics for a while but am new to the arduino. But how about a schematic drawing? (i know its quite a simple circuit but it would make it clearer. I learned a lot when i took a look at the code. A+
unknowndomain (author) in reply to DavidRobertsonAug 14, 2008. 4:43 PM
Thanks for that, Will add one at some point.
unknowndomain (author) in reply to unknowndomainOct 27, 2008. 6:41 AM
Still haven't had the time but I haven't forgotten
unknowndomain (author) says: Jun 1, 2008. 6:51 PM
I am aware that the image show here is not the same as that which I show next being built, at this was taken before I started writing the tutorial, as was the video!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!