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.

Simple Arduino Traffic Lights

Simple Arduino Traffic Lights
Have you ever made a city out of Legos? I know i have built many of them but they all missed something... Traffic lights!
So i decided to make my very own traffic light setup from my arduino board.
 
Remove these adsRemove these ads by Signing Up
 

Step 1You will need:

You will need:
You will need:

An arduino board
Red, Green and amber LED's
Three 220 Ohm Resistors

Optional:

Wire
and an Protoshield
« Previous StepDownload PDFView All StepsNext Step »
11 comments
Feb 29, 2012. 9:42 AMbiomech75 says:
Nice job ...but here is the fix for the red,yellow, green. It is incorrect The traffic lights goes as follows green, yellow,red... then red,green (not red,yellow.green).
Enjoy;)
CODE:

int greenled = 8; //Led's and pins
int yellowled = 9;
int redled = 10;

void setup()
{
pinMode(greenled, OUTPUT); //Pinmodes of the leds
pinMode(yellowled, OUTPUT);
pinMode(redled, OUTPUT);
}

void loop()
{
digitalWrite(greenled, HIGH); //Green on for 5 seconds
delay(5000);
digitalWrite(greenled, LOW); //Green off, yellow on for 2 seconds
digitalWrite(yellowled, HIGH);
delay(2000);
digitalWrite(yellowled, LOW); //yellow off, red on for 5 seconds
digitalWrite(redled, HIGH);
delay(5000);
digitalWrite(redled, LOW); //Red and Yellow off
digitalWrite(yellowled, LOW);
}
Mar 6, 2012. 7:46 AMbiomech75 says:
Ok My bad
Feb 23, 2012. 5:19 PMBaqutain says:
Thanks for this useful materiel
Nov 18, 2011. 10:36 PMatif khair says:
The arduino device is using in the traffic lED lights that make it more attractive.
Jaycon
Oct 28, 2011. 8:47 AMB2BSurvivor says:
Thanks again for responding. Yes, I am quite familiar with Google, and sorry if this isn't the "right place" to ask. BUT when I went to Google and found the Arduino home page, the Arduino was described as an "open source electronics prototype platform" etc. All I wanted was a simple answer, because I had no clue after reading the home page. So thanks, again. Obviously I am not an electronics hobbyist. Just trying to catch up a little on the technology. By the way, "lingo is an old slang term for "language" and "loop" is another old, outdated slang term for "information loop" or in other words, "lingo loop" would mean "techno speak", referring to the language of the "informed electronics technical people" like you.
Oct 27, 2011. 2:39 PMB2BSurvivor says:
Thanks for your reply to my comment. All I meant was that I am new to some of the terminology and behind in the technology, What is an Arduino?
Thanks,
B2Bsurvivor
Oct 25, 2011. 12:00 PMB2BSurvivor says:
Looks like a great project. So please help me out here, I'm out of the lingo loop. What is the Arduino reference all about?
Oct 17, 2011. 9:09 AMRobot Lover says:
Good instructable! This is great for beginner arduino users! Brotip: only one resistor is required, put it between the LED's ground and arduino ground. this helps save resistors for other projects!

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!
5
Followers
2
Author:bjarni1995