Computer Engineering Interfacing Activity The Traffic Light Project ACSE Nov 13 2004 - PowerPoint PPT Presentation

1 / 46
About This Presentation
Title:

Computer Engineering Interfacing Activity The Traffic Light Project ACSE Nov 13 2004

Description:

Computer Engineering Interfacing Activity. The Traffic Light Project ... Rat Tail. Snap Rat Tail into Light. Rat Tail and Lights. Insert Rat Tail into Hole ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 47
Provided by: graham61
Category:

less

Transcript and Presenter's Notes

Title: Computer Engineering Interfacing Activity The Traffic Light Project ACSE Nov 13 2004


1
Computer Engineering Interfacing ActivityThe
Traffic Light ProjectACSE Nov 13 2004
  • Graham Smyth
  • Jerry Dolata

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

3
Interfacing System Unit 5
Computer Interface Peripheral
  • Resistors
  • Relays
  • Power Supply
  • Breadboard
  • etc
  • Parallelport
  • LED's
  • or Sealed Beams
  • or Real World

Wires
Wires
4
Introduction to Traffic Lights
5
Interfacing Activities
6
Interfacing Activities
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
Input I4
Grounds 18 - 25
View from back of Computer
9
Traffic Light Software
Turing
  • parallelput(number) - reads 8 pins
  • put parallelget - reads 5 pins
  • mousewhere(x,y,click)
  • play(CDEFG)
  • drawline(x1,y1,x2,y2,red)
  • Provincially Licenced

10
parallelput(number)
11
Traffic Light Hardware
  • Four male pins
  • One D sub connector
  • Cable
  • Breadboard
  • 3 sealed beams
  • 3 pig tails
  • 3 mounting Brackets
  • 3 PN2222A transistors
  • 1 2x4x9 (base)
  • 1 1x2x9 (backing)
  • 1 5/8x12 dowel
  • Screws
  • 2 clamps for dowel
  • 12VDC Power Supply
  • extra wire

12
Stop Light Brackets
1x4 Mounting Board
Align Brackets
Evenly Space
Two Screws
13
Rat Tail
Snap Rat Tail into Light
14
Rat Tail and Lights
Insert Rat Tail into Hole
Shorter End of Board
Then Rotate Light ΒΌ turn Clockwise to
Tighten Repeat for All 3 Lights
15
Stop Light Wiring
Wrap Red Wire to Red Light
Wrap Yellow Wire to Yellow Light
Add White Wire to EACH of the THREE White Wires
Wrap Green Wire to Green Light
Wrap ALL Connections with Electrical Tape
16
Cable ConstructionMale Pin Connections
Male Pin
Insulated Wire
Small Crimp Tab
Stripped Wire
Large Crimp Tab
17
Cable With Male Pins (3 pair colour scheme)
White/Green
Green/White
Orange/White
White/Orange
Blue/White
change
White/Blue
18
D sub and Cable Colour Codes
19
The D Sub Connector(with extraction wire)
20
The D Sub Connector
Pin 2
D sub Connector
Pin 18
21
D Sub Connector Wiring
White/Orange (Pin18)
Green/White (Pin4)
Blue/White (Pin3)
Orange/White (Pin2)
22
PN2222A Transistor
Flat Side Front
Emitter (Ground)
Collector (Remote)
Base (Trigger)
23
Breadboard with Transistors
Black/White ()
Transistors (3) Flat Front
Black (-)
24
Transistors with Grounds(left pin)
Jumper
3 Transistors Grounded
25
Breadboard to Lights
To Green Light
To Red Light
To Yellow Light
Jumper
26
Cable to Transistors (middle pin)
To Pin 18
To Pin 2
To Pin 4
To Pin 3
27
Lights to Transistors (right pin ground)
Ground to Yellow Light
Ground to Green Light
Ground to Red Light
28
The hardware is complete. Now to the software
29
Stop Light Question 1
  • Write a program that will output a traditional
    stop light pattern.

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

31
Stop Light Activation Answer 1 Version 2
  • for counter 0 .. 2 three lights
  • parallelput (2 counter) clever expon.
  • delay (500)
  • end for three lights

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 (4) 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 virtual stop
    light that will activate with the real world
    light.

35
Adding Graphics Screen
(640,400)
(0,0)
36
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)

37
Real and Virtual Traffic Lights RED
delay (2000) loop Red light parallelput
(1) drawfilloval (175, 315, 35, 35,
brightred) drawfilloval (175, 225, 35, 35,
92) drawfilloval (175, 135, 35, 35, green)
delay (2000)
38
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)

39
Real and Virtual Traffic LightsGREEN
  • Green light
  • parallelput (4)
  • drawfilloval (175, 315, 35, 35, red)
  • drawfilloval (175, 225, 35, 35, 92)
  • drawfilloval (175, 135, 35, 35, brightgreen)
  • delay (2000)
  • end loop

40
Stop Light Question 4
  • Write a program that will continuously flash all
    lights to indicate a power outage.

41
Stop Light Question 5
  • Write a program that will add a second traffic
    light to simulate an intersection.

42
Stop Light Question 6
  • Write a program that will output a traditional
    stop light pattern to real world traffic lights.

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

44
AC Schematic
Red Traffic Light
To GFI
1 2 Solid State Relay
3 4
Check Specs
Pin 18
Pin 2
45
Real World Traffic Interface
To AC Light
To AC Light
To Pin 18
To Pin 2
46
Addresses
smythel_at_mnsi.net www.classictechnology.ca www.ho
ltsoft.com
Write a Comment
User Comments (0)
About PowerShow.com