Circuit created using online application called Autodesk from https://circuits.io
The following circuit schematic was created utilizing Proteus 8.
This is a simple four-way traffic controller which was created with an Arduino Uno micro controller and various electronics parts, such as LED's resistors, push buttons. The program is interrupt driven. This system will periodically change signals when triggered by a timer interrupt which calls a timer Interrupt Service Routine (ISR) to change the signal. Moreover, this system also has a hardware interrupt in the form of a momentary push button which will trigger and interrupt to change the signal. The purpose of the push button is to simulate a pedestrian crossing.
Note: To simplify the design I connected the two opposing ends of the traffic lights by wires. Due to this connection I simply need to issue commands to one terminal and both ends of the lights will change. This limits the flexibility of the project but it simplifies the design, makes the code more manageable, and compensates for the limitation of I/O pins available through the Arduino Uno board.
Key highlights that I would like to discuss regarding this project is that the code that was used in this system operates via interrupts.
1) The purpose of the timer interrupt is to change the signal periodically, around every twenty seconds.
2) A second form of interrupt that was used in this system is the push button interrupt which simulates the pedestrian crossing signal
Due to the potential threat of these two different interrupts glitching and interfering with each other I utilized interrupt flagging to notify each corresponding interrupt that the other is in progress.
If this were an embedded system the program could be placed into sleep mode the preserve battery life while it waited for one of the two interrupts to occur. The main reason I designed this system to use interrupts is because I did not want to tie up the processor with a loop.
The outcomes of this project was to aid me in better understand the nature, the implementation, purpose, and utilization of interrupts when designing embedded systems. I feel that through the course of this mini project i gained months of experience in a short time. where such valuable experience cannot be found in class room environments. Moreover, I believe this project better geared me on out to tackle a problem and utilize my problem solving skills.