Top Banner
Computer Engineering Computer Engineering Activities Activities Introduction to Interfacing Introduction to Interfacing Traffic Light Project Traffic Light Project SI 2003 SI 2003 Graham Smyth Graham Smyth Yungsiow Yang Yungsiow Yang Kevin Shea Kevin Shea Jerry Dolata Jerry Dolata Ilana Smyth Ilana Smyth
40

Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

Jan 15, 2016

Download

Documents

laken

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 Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

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

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

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

Interfacing ActivitiesInterfacing Activities

Page 5: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

Interfacing ActivitiesInterfacing Activities

Page 6: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

Introduction to Traffic Lights Introduction to Traffic Lights

Page 7: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

Breadboard ConnectionsBreadboard Connections

Connected

Connected

HighFives

DividerLowFives

Page 8: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Traffic Light Traffic Light (hardware)(hardware)

Resistor to GND

Align

Page 23: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

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

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

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

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

Adding Graphics ScreenAdding Graphics Screen

(0,0)

(640,400)

Page 28: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

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

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

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

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

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

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

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

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

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

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

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

More Hands-On ActivitiesMore Hands-On Activities

• Keyboard• Intersection• Robot• World’s Largest Joystick

Page 40: Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

AddressesAddresses

[email protected]

www.classictechnology.ca

www.holtsoft.com