loading

Today you will be making a simple traffic light out of materials that you can get from a starter kit or online. If you are shopping for these supplies I would recommend www.sparkfun.com but whatever you chose to do is fine. Have fun with this and hope you enjoy!

Step 1: Materials

Here are the parts you need:

x3 330 resistors

various jumper wires

x1 green LED

x1 red LED

x1 yellow LED

x1 Breadboard

x1 Arduino (Uno, but others should work)

Step 2: Wiring Part 1:

Line up your three LED's like a traffic signal. Green, then yellow, then red. Make sure that the short side is on the left, long on the right. Connect the resistor from the short side to negative on all three. Then, put a jumper wire in ground, and connect it to negative on the breadboard.

Step 3: Wiring Part: 2

Now, connect a wire from the long side of the LED, or the one that you haven't used yet and connect it to 13 on the arduino. Connect the yellows long side to 12, and reds to 11.

Step 4: The Code

int RED = 11;

int YEL = 12;

int GRN = 13;

void setup() {

pinMode(RED, OUTPUT);

pinMode(YEL, OUTPUT);

pinMode(GRN, OUTPUT);

}

void loop() {

digitalWrite(RED, HIGH);

delay(1000);

digitalWrite(RED, LOW);

digitalWrite(YEL, HIGH);

delay(1000);

digitalWrite(YEL, LOW);

digitalWrite(GRN, HIGH);

delay(1000);

digitalWrite(GRN, LOW);

}

<p>There have been a lot of good arduino traffic light projects lately. How do you plan to use yours?</p>
I dont know how, it was my first instructable, but I am more in to making Robots and more complex circuits and such. Right now I got a sensors kit, and I am making a lamp turn on by me just touching the side of it.

About This Instructable

320views

1favorite

License:

More by awilhelmy5:Arduino Traffic Light 
Add instructable to: