3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Arduino traffic lights

Arduino traffic lights
 I made this project on the same night that my Arduino Duemilanove arrived from Cool Components.  After being an Instructables member for about a year I though it was time I should contribute. There is another Arduino traffic light project similar to this, but it is much more complex; mine is aimed at beginners and children (who already know the basics).

As a beginner to the Arduino I had spent a fair amount of time researching them and how they work prior to investment, I had already learnt a little about www.processing.org so I was familiar with the programming environment.

This project takes very little skill to make, and I think it is ideal as a 'first' project (it gives a 'real world' application to the traditional 'LED Blink' tutorial.

This instructable aims to give beginner Arduino users a project to do, rather than teach them about electronics, so I have left out things such as the polarity of LEDs, because information like this can be found in a myriad of locations.  Because of this I have made the presumption that you own (or are getting) an Arduino, can connect it to your computer, know how to strip wires and the such.

"Hear me ye foreigners, there be Angles on this here site!" - The code and hardware is designed for the English lighting system, feel free to adapt it to your preferred pattern/colours etc.


 
Remove these adsRemove these ads by Signing Up
 

Step 1Bits and bobs.

Bits and bobs.
«
  • arduino.JPG
  • workspace.JPG
  • wire.JPG
  • LEDs.JPG
  • BB.JPG
  • USB.JPG
 For this project you will need:

  1 x Arduino (Duemilanove 328)
  1x Breadboard, fairly large one (I don't know the size)
  3 x LEDs (Red, amber and green)
  *some wire*
  USB cable for programming
  Computer / laptop preferably with a desk
  1 x paper clip

The paper clips shown in the picture have already been shaped. (sorry)
« Previous StepDownload PDFView All StepsNext Step »
8 comments
Apr 15, 2012. 6:04 PMWorldOfTanks says:
where is your resistors!!! if you dont add in any resistors then your arduino sockets will be burned to where you cant use them anymore!
Apr 18, 2012. 8:52 PMWorldOfTanks says:
lol we all do trial and error
Apr 17, 2011. 7:02 AMgapak says:
You can also use an elastic in stead of paper clips to attach the arduino to the breadboard.

I haven't downloaded the code and I only see taylors version downhere so I don't know if it's different in the original code but I don't understand the delay(0) lines. Aren't they totally useless?
Jul 3, 2010. 12:46 AMLenny24 says:
Uh! Shame on you! You forgot the resistors! :DD No, srsly, this COULD damage your Arduino or the LEDs. The pins on your Duemilanove may only draw 50 mA of Current. If LEDs are directly connected to +5v , they often draw much more than 50 mA. So... In case youre' connecting an LED to your arduino, simply add an 150 Ohm Resistor ( everything around 150 Ohms will work ( 220 Ohm etc.) but at 150 your LED will be very bright)
May 1, 2010. 9:08 PMtaylor179 says:

hey, excellent instructable, but in your programming it has the red and amber overlap. heres my version of the programming.:

int red = 12;              //defines pin number for each colour
int amber = 4;
int green = 5;

void setup(){              //this section of code only runs once
  pinMode(red, OUTPUT);    //defines what each pin will be doing
  pinMode(amber, OUTPUT);
  pinMode(green, OUTPUT);
}


void loop() {
  digitalWrite(red, HIGH);
  delay(4000);
  digitalWrite(red, LOW);
  delay(0);
  digitalWrite(green, HIGH);
  delay(5000);
  digitalWrite(green, LOW);
  delay(0);
  digitalWrite(amber, HIGH);
  delay(1000);
  digitalWrite(amber, LOW);
}


Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
3
Followers
2
Author:zoltzerino(Moonbeam Media Youth Films)