Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003 Graham Smyth Yungsiow Yang Kevin Shea Jerry Dolata Ilana Smyth."— Presentation transcript:

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

2 Computer Engineering Units Grade 10/11/12 1. Hardware 2. Networking 3. Integrated Circuits 4. Programming 5. Interfaces

3 Interfacing 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 ??

4 Interfacing Activities

5

6 Introduction to Traffic Lights

7 Breadboard Connections Connected High Fives Divider Low Fives

8 Parallelport View from back 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 Output D0 – D7 Input I0 – I3 Input I4 Grounds 18 - 25

9 Computer Interface Peripheral Interfacing System Unit 5 Parallelport Resistors LED's Wires

10 Joystick 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!!!

11 parallelput(number) NumberD7D6D5D4D3D2D1D0 11111111 00000100parallelput(4) parallelput(5)00000101 parallelput(255)

12 Traffic Light Hardware Four male pins One D sub connector Cable Three 220 ohm resistors (red/red/brown) Three LEDs One Breadboard

13 220 ohm Resistor Red Red Brown Gold 2 2 X 10 1 Direction Resistor inserted IS NOT important

14 Resistor Chart

15 LED + = Long Lead - = Short Lead + = Edge - = No Edge Direction LED inserted IS important

16 D sub to Breadboard Male Pin Insulated Wire Large Crimp Tab Stripped Wire Small Crimp Tab

17 Traffic Light Hardware Traffic Light Hardware (Eight wire colour scheme) change White/Orange White/Blue Orange White/Brown Blue Brown Green White/Green

18 The D Sub Connector (with extraction wire)

19 The D Sub Connector Pin 2 Pin 18 D sub Connector

20 Stop Light Wiring Green (Pin18) White/Green (Pin2) White/Orange (Pin4)White/Brown (Pin3)

21 Traffic Light (hardware) Pin 18 Pin 3 Pin 2 Pin 4 GND Wire + -

22 Traffic Light (hardware) Resistor to GND Align

23 The hardware is complete. Now to the software

24 Stop Light Question 1 Write a program that will output a traditional stop light pattern.

25 Stop Light Activation Answer 1 Version 1 parallelput (4) % Red light delay (500) parallelput (2) % Yellow light delay (500) parallelput (1) % Green light delay (500)

26 Stop Light Activation Answer 1 Version 2 for counter : 0.. 2 % three lights parallelput (2 ** counter) % clever expon. delay (500) end for % three lights

27 Adding Graphics Screen (0,0) (640,400)

28 Virtual Traffic Lights % Outline of traffic box drawfillbox (100, 60, 250, 370, gray) % Red light drawfilloval (175, 315, 35, 35, red) % Yellow light drawfilloval (175, 225, 35, 35, 92) % Green light drawfilloval (175, 135, 35, 35, green)

29 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 Lights RED

30 Real and Virtual Traffic Lights YELLOW % Yellow light parallelput (2) drawfilloval (175, 315, 35, 35, red) drawfilloval (175, 225, 35, 35, yellow) drawfilloval (175, 135, 35, 35, green) delay (2000)

31 Real and Virtual Traffic Lights GREEN % Green light parallelput (1) drawfilloval (175, 315, 35, 35, red) drawfilloval (175, 225, 35, 35, 92) drawfilloval (175, 135, 35, 35, brightgreen) delay (2000) end loop

32 Stop Light Question 2 Write a program that will output a traditional stop light pattern including an advanced green.

33 Stop Light Software Answer 2 Advanced Green Insert at appropriate place for counter : 1.. 5 parallelput (1) % Green light on delay (300) parallelput (0) % Green light off delay (300) end for

34 Stop Light Question 3 Write a program that will add a second traffic light to simulate an intersection.

35 Stop Light Question 4 Write a program that will output a traditional stop light pattern to real world traffic lights.

36 Stop Light Software Answer 4 The software for DC LED traffic lights and the real world AC traffic lights is the same. The interface and the peripheral changes.

37 AC Schematic 1 2 Solid State Relay 3 4 Pin 18Pin 2 Check Specs To GFI Red Traffic Light

38 Real World Traffic Interface To AC Light To Pin 18To Pin 2

39 More Hands-On Activities Keyboard Intersection Robot World’s Largest Joystick

40 Addresses smythel@mnsi.net www.classictechnology.ca www.holtsoft.com


Download ppt "Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003 Graham Smyth Yungsiow Yang Kevin Shea Jerry Dolata Ilana Smyth."

Similar presentations


Ads by Google