EGR 101 – Introduction to Engineering Arduino Projects Project #2

advertisement
EGR 101 – Introduction to Engineering
Arduino Projects
Project #2 – Traffic Light with Motor and Pushbuttons
Objective
The second project builds on the project created in Project #1. You will again have a
traffic light represented by red, yellow and green LEDs. However, in addition to lighting
the LEDs, you must also vary the speed of a motor based on the light. To simulate the
sensing of a car at the stoplight, a pushbutton must initiate the start of the change of the
traffic signal from red to green.
Unlike the lessons, you will not be given a circuit diagram, breadboard layout or program
code to use on this project. However, you should be able to use those tools given in the
first 4 lessons to complete the project.
Components
For this project, you will need the following components.
1
1
1
1
1
1
3
1
1
1
1
2
Arduino UNO Microcontroller
Breadboard
Jumper wire set
Red LED
Yellow LED
Green LED
220 Ω Resistor (red,red,black,black,brown)
DC hobby motor
NPN Transistor
Diode (rectifier)
Pushbutton
10 kΩ resistors
Project
For this project, you must create a traffic light that does the following.
1. Begins at a red light.
2. When the pushbutton is pressed, the light should change to green after 2 s.
3. Turns to a green light for 6 s. While the light is green, the motor should spin
at high speed.
4. Switches to a yellow light for 2 s. While the light is yellow, the motor should
turn at a slower speed (around half of high speed).
5. Returns to red light of step 1.
Download