Step 1: Define the Project
This project is defined as:
Control 3 outputs
Read 4 inputs
Read 1 interupt
3 outputs are sequenced in multiple modes
-Standard Traffic Light pattern
-Steady on each output
-Blink each output
Increment and decrement sequence speed
Modify saved timing parameters using remote control
and most important; Execute in a realtime manor.
Step 2: Prototype the Circuit
I used the Arduino Duemilanov. I attached 3 LED's , 4 switches and began to write the code. The Arduino IDE (which is FREE!!) uses a syntax that is very similar to good old fashioned ANSI C. I started with the modes of signal patterns. I used a case statement to modularize my code. I the added the code for the buttons. The buttons control mode UP/DN and speed UP/DN.
Step 3: Write the Code
Step 4: TEST TEST TEST TEST
The Arduino allows for field program ability, but that is no excuse for not testing.
After adding the remote control I had alot of code changes in order to operate the code.
This version has usable code for the remote's receiver but it breaks the ability to reprogram the timing and default flash pattern and speed at power up.
Step 5: Electronic Schematic Design
Create each component and connect their pins together
Step 6: PCB Layout
Step 7: Cut the PCB
Special thanks to Steve over at The Award Gallery. Check with your local trophy shop or sign engraver. They may not know they have this ability.
My board was cut on a 10 year old trophy/plaque engraver. I used NOVARM's DipTrace to make my schematic and PCB.
Step 8: Assemble the Project
Solder the pins and leads.
Step 9: Install the PCB
Wire all the components
Step 10: Finish
BTW the light bulbs are handmade high efficiency LED's. This whole traffic light draws less than 10W at 5V with all three lights on.