introArduino 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.
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.
step 1Bits and bobs.
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)
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)
step 2Mount the Arduino
I needed to come up with a way of fastening my Arduino to my breadboard, so I put a cut, bent paper clip through the PCB and into two of the boards holes.
The close-up photo was taken using a home made macro lense - search instructables to find out how! :-D
The close-up photo was taken using a home made macro lense - search instructables to find out how! :-D
step 3Wires, wires, wires.
According to the programme the wiring should go like this:
Pin 12 - Red LED
Pin 3 - Amber LED
Pin 2 - Green LED
Ground - bottom row of breadboard
have a look through all the pictures to get a better idea of what is going on.
Don't ask why I did not use pins nearer to each other :-D
Pin 12 - Red LED
Pin 3 - Amber LED
Pin 2 - Green LED
Ground - bottom row of breadboard
have a look through all the pictures to get a better idea of what is going on.
Don't ask why I did not use pins nearer to each other :-D
step 4Light emitting diodes, *Ta Cha Cha Chaaaa*
Next we are going to insert the LEDs into their correct locations:
Pin 12 - Red - 0v
Pin 3 - Amber (yellow) - 0v
Pin 2 - Green - 0v
Pictures -
Pin 12 - Red - 0v
Pin 3 - Amber (yellow) - 0v
Pin 2 - Green - 0v
Pictures -
step 5Programming time!
C'mon folks you know how to do this :-)
Load of the IDE on your computer, connect the USB lead and take the plunge!
The "traffic_lights.pde" file is attached...
When you click to download, it saves as a .tmp, just change the extension to .pde to use it with the Arduino IDE.
Load of the IDE on your computer, connect the USB lead and take the plunge!
The "traffic_lights.pde" file is attached...
When you click to download, it saves as a .tmp, just change the extension to .pde to use it with the Arduino IDE.