The Traffic Lights Project
"Hello World!"
When you learn to program a computer, you begin with the "Hello World!" program. The words "Hello World!" appear on a display that is part of the computer. An operating system takes your text and figures out how to get it on the display without your needing to know the details. Your program is typically just a few lines of code.
Embedded systems frequently don't have a display. If they do, it's often part of the programmer's job to write the software to get text onto the display. This is not a simple task and it's not the place to begin learning embedded systems programming. The usual starting point - the equivalent of "Hello World!" in hosted systems - is flashing an LED. This is about the simplest thing you can do that gives an observable and satisfying result.
But, how much can you learn by flashing LEDs? Quite a lot, it turns out, if you're using the ECROS Technology Traffic Lights Project.
Traffic Lights
The Traffic Lights Project consists of three parts:
- a circuit board with LEDs arranged like traffic lights around a road intersection plus switches for sensing traffic flow, pedestrians and emergency vehicles,
- documentation that carefully describes requirements for the operation of the traffic lights in various situations and ...
- ... software, provided by you, as you learn increasingly sophisticated embedded systems programming techniques!
Does this sound too hard? Remember, you begin with the simplest of programs - turning an LED on and off. From there you build up by controlling how long an LED is on and turning on and off each color of LED in sequence. You can stop at any stage where the result meets your learning requirements. The Traffic Lights Project is inexpensive so you're not obliged to spend a lot of money if you don't think you'll develop the project to the end.
Does it sound too easy? The requirements include response to pedestrians and emergency vehicles, a night-time operating mode (so you'll need to keep track of the time of day), the ability to configure timing from a remote console using a menu system and logging traffic density. What are you going to do when the emergency vehicle button is pushed just after a pedestrian arrives during a change of direction while a menu is being sent to the remote console?
Interested in hardware? The circuit board includes driving circuits for the six pairs of LEDs, two of each color in the North/South and East/West directions. Also included are connections to the two traffic sensing switches. It connects to an eight-bit port of your microcontroller via a ten-pin header (in the Atmel pin-out, used, for example, on the STK500). But, reading the pedestrian and emergency vehicle switches is a problem for you to solve (with hints from the included documentation).
No Longer Available For Purchase
ECROS Technology has closed down and the Traffic Lights Project is no longer available for purchase. These pages are maintained for the benefit of existing owners.
More Information
Click this button for a description of the Parts Kit and assembly hints
Click this button for a list of steps towards a highly-functional road intersection
simulation
Requirements
The Traffic Lights Project does not include a microcontroller system. You can use one that you already own, purchase one from ECROS Technology or chose one from many other suppliers. The documentation assumes that you will be using an Atmel microcontroller, but can easily be adapted to other architectures. Your microcontroller system should have the following:
- At least one eight-bit general purpose I/O port (GPIO port)
- The ability to set the direction of each bit at the port independently
- The ability to supply the traffic lights circuit board with from 3.3 to 5 volts at a current of approximately 50 mA
Examples of suitable microcontroller systems are:
- The Atmel STK500
- The Atmel AVR Dragon coupled with a
Dragon Rider 500
- The Atmel AVR Butterfly coupled with a
Butterfly Carrier