1 / 40

Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

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.

laken
Download Presentation

Computer Engineering Activities Introduction to Interfacing Traffic Light Project SI 2003

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Engineering ActivitiesIntroduction to InterfacingTraffic Light ProjectSI 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. Interfacing Activities

  6. Introduction to Traffic Lights

  7. Breadboard Connections Connected High Fives Divider Low Fives Connected

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

  9. Interfacing System Unit 5 Computer Interface Peripheral • Parallelport • Resistors • LED's Wires 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)

  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 2 2 X 101 Red Red Brown Gold Direction Resistor inserted IS NOT important

  14. Resistor Chart

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

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

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

  18. The D Sub Connector(with extraction wire)

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

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

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

  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 (640,400) (0,0)

  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. Real and Virtual Traffic Lights RED 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)

  30. Real and Virtual Traffic LightsYELLOW % 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 LightsGREEN % 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 lightoff 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 Red Traffic Light To GFI 1 2 Solid State Relay 3 4 Check Specs Pin 18 Pin 2

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

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

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

More Related