computer engineering activities introduction to interfacing traffic light project si 2003
DESCRIPTION
Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003. Graham Smyth Yungsiow Yang Kevin Shea Jerry Dolata Ilana Smyth. Computer Engineering Units. Grade 10/11/12 1. Hardware 2. Networking 3. Integrated Circuits 4. Programming 5. Interfaces. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/1.jpg)
Computer Engineering Computer Engineering ActivitiesActivities
Introduction to InterfacingIntroduction to Interfacing
Traffic Light ProjectTraffic Light Project
SI 2003SI 2003Graham Smyth Graham Smyth Yungsiow YangYungsiow Yang
Kevin SheaKevin SheaJerry DolataJerry DolataIlana SmythIlana Smyth
![Page 2: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/2.jpg)
Computer Engineering UnitsComputer Engineering Units
Grade 10/11/12
1. Hardware1. Hardware
2. Networking2. Networking
3. Integrated Circuits3. Integrated Circuits
4. Programming4. Programming
5. 5. InterfacesInterfaces
![Page 3: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/3.jpg)
Interfacing ActivitiesInterfacing Activities
Grade 10• One bit• Three LEDs• LED simulators• ASCII• Binary counting• Light patterns• Intersections• AC ???
Grade 11• One bit• One byte• DC motor• Bi-directional • LED traffic light• LED intersection• Demultiplexer• GUIs• Mouse control• AC ??
![Page 4: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/4.jpg)
Interfacing ActivitiesInterfacing Activities
![Page 5: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/5.jpg)
Interfacing ActivitiesInterfacing Activities
![Page 6: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/6.jpg)
Introduction to Traffic Lights Introduction to Traffic Lights
![Page 7: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/7.jpg)
Breadboard ConnectionsBreadboard Connections
Connected
Connected
HighFives
DividerLowFives
![Page 8: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/8.jpg)
ParallelportParallelport
View from View from backback of Computer of Computer
13 12 11 10 9 8 7 6 5 4 3 2 1
25 24 23 22 21 20 19 18 17 16 15 14
OutputD0 – D7
InputI0 – I3
Input I4 Grounds18 - 25
![Page 9: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/9.jpg)
Computer Computer Interface Peripheral Interface Peripheral
Interfacing SystemInterfacing System
Unit 5
• Parallelport • Resistors • LED's
Wires Wires
![Page 10: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/10.jpg)
Joystick SoftwareJoystick Software
Turing
• parallelput(number) - reads 8 pins• put parallelget - reads 5 pins• mousewhere(x,y,click)• play(“CDEFG”)• drawline(x1,y1,x2,y2,red)• FREE!!!
![Page 11: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/11.jpg)
parallelput(number)parallelput(number)
NumberNumber D7D7 D6D6 D5D5 D4D4 D3D3 D2D2 D1D1 D0D0
11 11 11 11 11 11 11 11
00 00 00 00 00 11 00 00parallelput(4)parallelput(4)
parallelput(5)parallelput(5) 00 00 00 00 00 11 00 11
parallelput(25parallelput(255)5)
![Page 12: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/12.jpg)
Traffic Light HardwareTraffic Light Hardware
• Four male pins • One D sub connector • Cable • Three 220 ohm resistors (red/red/brown)• Three LEDs• One Breadboard
![Page 13: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/13.jpg)
220 ohm Resistor220 ohm Resistor
Red Red Brown Gold
2 2 X 101
Direction Resistor inserted IS NOT important
![Page 14: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/14.jpg)
Resistor ChartResistor Chart
BAND 1 BAND 2 BAND 3 BLACK 0 0 1 BROWN 1 1 10
RED 2 2 100 ORANGE 3 3 1 000 YELLOW 4 4 10 000 GREEN 5 5 100 000 BLUE 6 6 1 000 000
VIOLET 7 7 10 000 000 GRAY 8 8 100 000 000 WHITE 9 9 1 000 000 000
![Page 15: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/15.jpg)
LEDLED
+ = Long Lead - = Short Lead
+ = Edge - = No Edge
Direction LED inserted IS important
![Page 16: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/16.jpg)
D sub to BreadboardD sub to Breadboard
Male Pin Insulated Wire
Large Crimp Tab Stripped Wire
Small Crimp Tab
![Page 17: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/17.jpg)
Traffic Light Hardware Traffic Light Hardware (Eight wire colour scheme)
change
White/Orange
White/Blue
Orange
White/Brown
Blue
BrownGreenWhite/Green
![Page 18: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/18.jpg)
The D Sub ConnectorThe D Sub Connector(with extraction wire)(with extraction wire)
![Page 19: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/19.jpg)
The D Sub ConnectorThe D Sub Connector
Pin 2
Pin 18
D sub Connector
![Page 20: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/20.jpg)
Stop Light WiringStop Light Wiring
Green (Pin18)
White/Green (Pin2)
White/Orange (Pin4) White/Brown (Pin3)
![Page 21: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/21.jpg)
Traffic Light Traffic Light (hardware)(hardware)
Pin 18 Pin 3 Pin 2 Pin 4
GND Wire
+
-
![Page 22: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/22.jpg)
Traffic Light Traffic Light (hardware)(hardware)
Resistor to GND
Align
![Page 23: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/23.jpg)
The hardware is complete.The hardware is complete.
Now to the software Now to the software
![Page 24: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/24.jpg)
Stop Light Question 1Stop Light Question 1
Write a program that will output a Write a program that will output a traditional stop light pattern.traditional stop light pattern.
![Page 25: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/25.jpg)
Stop Light Activation Answer 1 Stop Light Activation Answer 1
Version 1Version 1
parallelput (4) parallelput (4) % Red light% Red light
delay (500)delay (500)
parallelput (2) parallelput (2) % Yellow light% Yellow light
delay (500)delay (500)
parallelput (1) parallelput (1) % Green light% Green light
delay (500)delay (500)
![Page 26: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/26.jpg)
Stop Light Activation Answer 1Stop Light Activation Answer 1
Version 2Version 2
for counter : 0 .. 2for counter : 0 .. 2 % three lights% three lights
parallelput (2 ** counter)parallelput (2 ** counter) % clever expon. % clever expon.
delay (500)delay (500)
end forend for % three lights % three lights
![Page 27: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/27.jpg)
Adding Graphics ScreenAdding Graphics Screen
(0,0)
(640,400)
![Page 28: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/28.jpg)
Virtual Traffic LightsVirtual Traffic Lights
% Outline of traffic box% Outline of traffic boxdrawfillbox (100, 60, 250, 370, gray)drawfillbox (100, 60, 250, 370, gray)% Red light% Red lightdrawfilloval (175, 315, 35, 35, red)drawfilloval (175, 315, 35, 35, red)% Yellow light% Yellow lightdrawfilloval (175, 225, 35, 35, 92)drawfilloval (175, 225, 35, 35, 92)% Green light% Green lightdrawfilloval (175, 135, 35, 35, green)drawfilloval (175, 135, 35, 35, green)
![Page 29: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/29.jpg)
delay (2000)loop % Red light parallelput (4) drawfilloval (175, 315, 35, 35, brightred) drawfilloval (175, 225, 35, 35, 92) drawfilloval (175, 135, 35, 35, green) delay (2000)
Real and Virtual Traffic LightsReal and Virtual Traffic LightsREDRED
![Page 30: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/30.jpg)
Real and Virtual Traffic LightsReal and Virtual Traffic LightsYELLOWYELLOW
% Yellow light
parallelput (2) drawfilloval (175, 315, 35, 35, red) drawfilloval (175, 225, 35, 35,
yellow) drawfilloval (175, 135, 35, 35,
green) delay (2000)
![Page 31: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/31.jpg)
Real and Virtual Traffic LightsReal and Virtual Traffic LightsGREENGREEN
% Green lightparallelput (1)
drawfilloval (175, 315, 35, 35, red) drawfilloval (175, 225, 35, 35, 92) drawfilloval (175, 135, 35, 35,
brightgreen) delay (2000)end loop
![Page 32: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/32.jpg)
Stop Light Question 2Stop Light Question 2
Write a program that will output Write a program that will output a traditional stop light pattern a traditional stop light pattern including an advanced green. including an advanced green.
![Page 33: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/33.jpg)
Stop Light Software Answer 2 Stop Light Software Answer 2 Advanced GreenAdvanced Green
Insert at appropriate placeInsert at appropriate place
for counter : 1 .. 5for counter : 1 .. 5
parallelput (1)parallelput (1) % % Green light Green light onon
delay (300)delay (300)
parallelput (0)parallelput (0) % % Green lightGreen light offoff
delay (300)delay (300)
end forend for
![Page 34: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/34.jpg)
Stop Light Question 3Stop Light Question 3
Write a program that will add a Write a program that will add a second traffic light to simulate an second traffic light to simulate an intersection. intersection.
![Page 35: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/35.jpg)
Stop Light Question 4Stop Light Question 4
Write a program that will output a Write a program that will output a traditional stop light pattern to real traditional stop light pattern to real world traffic lights.world traffic lights.
![Page 36: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/36.jpg)
Stop Light Software Answer 4 Stop Light Software Answer 4
The software for DC LED traffic lightsThe software for DC LED traffic lights
and the real world AC traffic lights is and the real world AC traffic lights is
the the samesame. .
The interface and the peripheral The interface and the peripheral changes.changes.
![Page 37: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/37.jpg)
AC SchematicAC Schematic
1 2 Solid State Relay 3 4
Pin 18 Pin 2
Check Specs
To GFI
Red Traffic Light
![Page 38: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/38.jpg)
Real World Traffic InterfaceReal World Traffic InterfaceTo AC Light
To AC Light
To Pin 18 To Pin 2
![Page 39: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003](https://reader035.vdocument.in/reader035/viewer/2022062409/56814979550346895db6c4a7/html5/thumbnails/39.jpg)
More Hands-On ActivitiesMore Hands-On Activities
• Keyboard• Intersection• Robot• World’s Largest Joystick