Module 4: Traffic Signal Design Lesson 1: Traffic Signal (Arduino) Control System Laboratory Exercise Grade 6-8

Similar documents
Lesson 4 RGB LED. Overview. Component Required:

Lecture (04) Arduino Microcontroller Programming and interfacing. By: Dr. Ahmed ElShafee

Model Railway Animation: Part 1, LEDs - Expanded By David King

EP486 Microcontroller Applications

Arduino Lesson 3. RGB LEDs

Objectives: Learn how LED displays work Be able to output your name on the display

ENGR 40M Project 3b: Programming the LED cube

1. Arduino Board and Breadboard set up from Project 2 (8 LED lights) 2. Piezo Speaker

Lesson Sequence: S4A (Scratch for Arduino)

Experiment 0: Hello, micro:bit!

The Micropython Microcontroller

COLOUR CHANGING USB LAMP KIT

Informatics Enlightened Station 1 Sunflower

Preface. About SunFounder. About Super Kit. Free Support

Introduction 1. Green status LED, controlled by output signal ST. Sounder, controlled by output signal Q6. Push switch on input D6

Lab #10: Building Output Ports with the 6811

Self-Playing Xylophone

ELECTRONIC GAME KIT TEACHING RESOURCES. Version 2.0 BUILD YOUR OWN MEMORY & REACTIONS

This module senses temperature and humidity. Output: Temperature and humidity display on serial monitor.

ENGR 40M Project 3a: Building an LED Cube

Assignment #3: Piezo Cake

Building the ChronoDot Calendar Reminder

QUIZ BUZZER KIT TEACHING RESOURCES. Version 2.0 WHO ANSWERED FIRST? FIND OUT WITH THIS

Dynamic Animation Cube Group 1 Joseph Clark Michael Alberts Isaiah Walker Arnold Li

Ginger Bread House

The Infinity Portal Craig A. Lindley 03/16/2011

POINTS POSITION INDICATOR PPI4

COMPUTER ENGINEERING PROGRAM

Microcontrollers and Interfacing week 7 exercises

Arduino LED Matrix Control. Controlling lots of LEDs

Digital 1 Final Project Sequential Digital System - Slot Machine

The Serial Port is Dead! Long Live the Serial Port! USB Serial Port Breadboard Experiments with the FTDI FT232R

8 PIN PIC PROGRAMMABLE BOARD (DEVELOPMENT BOARD & PROJECT BOARD)

Measure the value of water flow using water flow sensor and DC water pump 12 V interfacing with Arduino uno

SparkFun Inventor's Kit for micro:bit Experiment Guide

Implementing a Rudimentary Oscilloscope

Laboratory 9 Digital Circuits: Flip Flops, One-Shot, Shift Register, Ripple Counter

Embedded Systems Lab. Dynamic Traffic and Street Lights Controller with Non-Motorized User Detection

ECE Design Team 3 Madi Kassymbekov How to use MSP 430 Peripheral Sensors and use of LEDs as sensors

Laboratory 10. Required Components: Objectives. Introduction. Digital Circuits - Logic and Latching (modified from lab text by Alciatore)

PLTW Engineering Digital Electronics Course Outline

Basic LabVIEW Programming Amit J Nimunkar, Sara Karle, Michele Lorenz, Emily Maslonkowski

Data Acquisition Using LabVIEW

Digital Electronics Course Outline

Technology Control Technology

Introduction 1. Green status LED, controlled by output signal ST

Introduction 1. Digital inputs D6 and D7. Battery connects here (red wire to +V, black wire to 0V )

Preface. If you have any TECHNICAL questions, add a topic under FORUM section on our website and we'll reply as soon as possible.

Application Note. Traffic Signal Controller AN-CM-231

A 400MHz Direct Digital Synthesizer with the AD9912

Embedded Systems. Interfacing PIC with external devices 7-Segment display. Eng. Anis Nazer Second Semester

Safety Information. Camera System. If you back up while looking only at the monitor, you may cause damage or injury. Always back up slowly.

Laboratory 7. Lab 7. Digital Circuits - Logic and Latching

Computer Architecture and Organization. Electronic Keyboard

PCMT Conflict Monitor Tester. User's Manual Revision 1.7

Informatics Enlightened Station 2 Park distance control system

R,G,B LEDs. Three PWM outputs and three primary colors. Just screams to be made, doesn t it? 220 (red,red,brown) or 330 (orange,orange,brown)

NX APPLICATION NOTE Led Guided Assembly Connector Pinning with Continuity

Prototyping & Engineering Electronics Kits Magic Mandala Kit Guide

Lab Using The Multimeter And The Trainer

Schematic Analysis of P10 16x32 RGB LED Panel 3 in 1 DIP Type Dual (Dual In-Line Package) on Trafficlight Revolution

Character LCDs. Created by lady ada. Last updated on :47:43 AM UTC

uresearch GRAVITECH.US GRAVITECH GROUP Copyright 2007 MicroResearch GRAVITECH GROUP

The UK sequence is shown below. The duration of each phase can be easily adjusted during the programming to suit.

SWITCH: Microcontroller Touch-switch Design & Test (Part 2)

PHYS 3322 Modern Laboratory Methods I Digital Devices

Laboratory Exercise 4

Traffic Light Controller

Laboratory 11. Required Components: Objectives. Introduction. Digital Displays and Logic (modified from lab text by Alciatore)

AXE101 PICAXE-08M2 Cyberpet Kit

Part (A) Controlling 7-Segment Displays with Pushbuttons. Part (B) Controlling 7-Segment Displays with the PIC

A Directional Indicator with a Symbol Based Interface for improvised Safety-Enhanced Directional Indicators using Matrix LED

PASS. Professional Audience Safety System. User Manual. Pangolin Laser Systems. November 2O12

VISSIM TUTORIALS This document includes tutorials that provide help in using VISSIM to accomplish the six tasks listed in the table below.

Azatrax Model Railroad Track Signal Control - Single Track

RDS: The RDS, or Radio Data System, is supported in the g! interface where available.

Embedded Systems. Interfacing PIC with external devices 7-Segment display. Eng. Anis Nazer Second Semester

Fig. 1 Analog pins of Arduino Mega

Combo Board.

Solutions to Embedded System Design Challenges Part II

VNS2200 Amplifier & Controller Installation Guide

EE 367 Lab Part 1: Sequential Logic

9/23/2014. Andrew Costin, Tom Syster, Ryan Cramer Advisor: Professor Hack Instructor: Professor Lin May 5 th, 2014

Instructions for DataMark PDF Temperature Logger

TV Character Generator

Bill of Materials: 7-Segment LED Die with Arduino PART NO

Configuring the Stack ST8961 VS Module when used in conjunction with a Stack ST81xx series display.

Introduction. The Clock Hardware. A Unique LED Clock Article by Craig A. Lindley

Integration Note. Manufacturer: OVERVIEW AND SUPPORTED FEATURES

Noise Detector ND-1 Operating Manual

Electrical and Electronic Laboratory Faculty of Engineering Chulalongkorn University. Cathode-Ray Oscilloscope (CRO)

Assembly and Operating Instructions for HiViz.com Kits

JAMAR TRAX RD Detector Package Power Requirements Installation Setting Up The Unit

VNS2210 Amplifier & Controller Installation Guide

210E - 210ECL ECL ECL

Receiver Integration Note

Trusted 40 Channel Analogue Input FTA

Experiment (6) 2- to 4 Decoder. Figure 8.1 Block Diagram of 2-to-4 Decoder 0 X X

STATE OF OHIO DEPARTMENT OF TRANSPORTATION SUPPLEMENTAL SPECIFICATION 872 LIGHT EMITTING DIODE TRAFFIC SIGNAL LAMP UNITS JULY 19, 2002

Rfid Based Attendance System

Transcription:

Name: Class: Module 4: Traffic Signal Design Lesson 1: Traffic Signal (Arduino) Control System Laboratory Exercise Grade 6-8 Background Traffic signals are used to control traffic that flows in opposing directions at intersections. Traffic signals use red, yellow and green indicators to permit or prevent vehicles from entering the controlled intersection at different times. The indicators, frequently referred to as red lights, yellow lights, and green lights, organize traffic to prevent crashes and establish a right of way. Traffic signals work by alternating the ability for vehicles to travel on each approach using different phases, which can have set or varying phase lengths. Phase lengths are the amount of time assigned to each green, yellow, or red phase. Traffic Signal Design Activity For this activity, you and your partner will act as transportation engineers and use an Arduino to construct a working traffic signal. In order for the Arduino traffic signal to operate properly, you will need to develop a computer program that tells each light (red, yellow, and green) when to come on, how long to stay on, and when to turn off. Part 1: Constructing the Arduino Traffic Signal Circuit 1. Break into groups of 2 or 3 students. 2. Obtain the following Materials: Arduino Microcontroller 3 LEDs (1 Red, 1 Yellow, 1 Green) 3 330 Ω Resistors Breadboard 4 Wires Computer with Arduino Programming Software 1

Circuit Background When working with LED (light emitting diode) lights, you will notice that one leg of the light is shorter than the other (as shown in the picture below). Because LEDs are polarized and only allow current to flow in one direction as their circuit symbol indicates, manufacturers make the legs different lengths to allow users to differentiate the polarization. As shown, the longer leg is called the anode and represents the positive (+) polarity and the shorter leg is called the cathode and represents the negative (-) polarity. Using the picture below, assemble the traffic light circuit; notice that the polarity of the LEDs are shown on the breadboard. When constructing the traffic signal circuit using the LED lights, the anode (+) should be connected to the digital pins on the Arduino board to turn the light on and off (any numbered pin can be used but you ll need to remember this number later). The cathode (-) will be connected to the resistor which is connected to the ground to complete the circuit. If the LED is positioned incorrectly, the current will be unable to flow and the LED will not work. 2

Part II: Algorithm Development with Pseudo Code As a transportation engineer, you will need to write a computer program to allow your traffic signal to function properly. First, we will develop a flowchart to help us think about how we want the traffic signal to function. Consider the questions below before beginning your flowchart. 1. Will the lights in the traffic signal be inputs or outputs? 2. Will the lights in the traffic signal follow a specified order? 3. How long should each light remain on? 4. When one light turns on, what happens to the other two lights? Now that you have identified how your traffic signal will function, use this information to develop a flowchart that shows the sequence the traffic signal will follow. Use the following symbols to represent the traffic signal processes. Flow Chart Symbols Traffic Signal Logic Flow Chart Develop the traffic signal flow chart below 3

Part III: Writing Arduino Code 1. Connect Computer to USB port on the Arduino Uno boards. 2. Open the Arduino program: 3. Find the Arduino connection on the computer: Tools à Serial Port Your computer communicates to the Arduino microcontroller via a serial port à through a USB-Serial adapter. Check to make sure that the drivers are properly installed. 4. Double-check that the proper board is selected under the ToolsàBoard menu. (You are using an Arduino Uno). 4

5. Just like any work you do put your name and date at the top in a comment along with a brief description: 6. When you first open the Arduino program, you will be looking at an Arduino sketch. A sketch is what the Arduino calls the program or code. You should see two required functions on your screen: void setup() { // put your setup code here, to run once: } **The void setup() function is where you will define your inputs and outputs. void loop() { // put your main code here, to run repeatedly: } **The void loop() function is for your main code that the Arudino will continually loop through. Both of these functions are automatic and are required to run the Arduino program. **Remember: When you are writing a computer program, the language is very sensitive, so spaces, punctuation, lower and uppercase letters make a difference! When you use codes that Arduino recognizes, you will notice them change color. 5

7. When you begin writing a computer program, a good practice is to first define the variables. You will need to do this before the void setup function. In this case, there will be 3 variables green, yellow, and red. You will define your variable related to the pin number. Ex. int GREEN = 2; (this would mean that the green light is in pin 2) 8. Once you have defined your variables, you are ready to write the program. Under the void setup function, you will need to setup whether each pin is an output or input. To do this, Arudino has a function that it already understands. Ex. pinmode (GREEN, OUTPUT); 9. Now, under the void loop function, you will need to tell the traffic signal exactly how to function. Keep in mind you will need to tell the lights when to come one, how long to stay on, when to turn off, and how long between each light. (Remember the language is very sensitive so be careful). Arduino Coding digitalwrite (GREEN, HIGH) This function tells the light to turn on or off. A HIGH reading turns the light on and a LOW reading would turn the light off. Delay (400) This function delays the Arudino for a specific length of time. The Ardunio reads milliseconds so this function would delay the program for 400 milliseconds. 1000 milliseconds = 1 second. 10. Once you have written the code for the traffic signal, you will need to verify the code to ensure that there are no mistakes. To do this, click on the checkmark. If it produced errors look for missing parenthesis and semicolons. 11. If your code didn t produce any errors on the bottom, upload the code to the Arduino (click the right pointing arrow) and see if it works. 6