320 likes | 678 Views
Computer Engineering Tethered Car Project University of Waterloo Summer Institute 2005 Graham Smyth smythel@mnsi.net Computer Engineering Units Grades 10 - 12 Five Hands-0n Units 1. Hardware 2. Networking 3. Integrated Circuits 4. Programming 5. Interfaces Tethered Vehicle Approach
E N D
Computer Engineering Tethered Car ProjectUniversity of WaterlooSummer Institute2005 Graham Smyth smythel@mnsi.net
Computer Engineering Units Grades 10 - 12 Five Hands-0n Units 1. Hardware 2. Networking 3. Integrated Circuits 4. Programming 5. Interfaces
Tethered Vehicle Approach • LEDs • DC Power Supply • Transistors • Uni-direction motor • Bi-direction motor • Single motor vehicle • Two motor vehicle • Hand built vehicle • Additional Features (head lights, tail lights, turn signals, fog lights etc)
Hardware • Computer’s parallelport through D sub connector • D sub to interface (transistors, resistors, diodes) • Interface to motor (in car)
Software Turing • parallelput ( number) • put parallelget • mousewhere ( x, y, click) • play (“CDEFG”) • drawline ( x1, y1, x2, y2, red) • Provincially Licensed
Bidirectional Motor Interfacing Hardware • vehicle with DC motor • tethering ribbon cable – 2 meters • D sub 3 pair wire • solid core wire – various, short • 2 TIP 31s • 2 TIP 42s • 1 D sub connector • 12 male pins • 9 V DC power supply (white is +) • 1 breadboard • 4 1K resistors (Brown/black/red) • 2 diodes (1N401) • LEDs
Breadboard in Detail Top Rail Connected Connected In Fives Bottom Rail Connected Divider
Interfacing System Unit 5 Computer Interface Peripheral • Parallelport • Wires • Diodes • Resistors • Transistors • Vehicle Wires Wires
Parallelport Pin Configuration(printer port) 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
Interface Wire Male Pin Insulated Wire Stripped Wire Crimp Tabs
Transistor TIP31 & 42Physical Schematic Emitter Base Collector (Right Left Middle) Base Collector Emitter
Disassembling Tips • Leave wire long on remote board • Put car on blocks (gears dislodge) • Ribbon cable through antenna hole • Knot ribbon cable on interior post of car • Feed cable through antenna hole • carefully strip ribbon cable
Ribbon Cable Configuration Wire # FUNCTION 1 Ground 2 Head and spot lights 3 Right rear signal 4 Left rear signal 5 Motor 6 Motor - marked
Disassembling the Vehicle (with care) Remove Three Screws 2 1 3
Separate Frame Halves 4. Clip 3 3. Clip 2 1. Remove Aerial 2. Clip 1 Spread Clips Carefully
Access Motor Leads 2. Cut Red/Black Wires 3. Strip Black Wire 4. Strip Red Wire 1. Place Upper Body on Lower
Attach Ribbon Cable 1. Strip All Wires 3. Tie Cable to Post 4. Wrap Red Wire to Ribbon Wire 5 5. Wrap Black Wire to Ribbon Wire 6 2. Mark 6th Wire 6. Tape Two Motor Wires
Replace Frame Halves Snap Body Together Feed Cable Through Antenna
Re-attach Body 2. Feed Cable Through Antenna 3. Re-attach Body with 3 Screws 1. Identify 6th Wire 4. Attach Male Pins to Wire 5 & 6
Wiring Interface Cable 1. Attach Male Pins to the Orange/Blue/Green Wires 2. Strip 1cm from the Orange/Blue/Green Wires
D sub 1. Attach Wiring Harness 2. Insert Blue Wire Into pin 2 4. Insert Green Wire Into pin 18 3. Insert Orange Wire Into pin 3
Wiring Interface: Transistors TIP42 TIP42 + White Stripe - TIP31 TIP31
Wiring Interface : DiodesBack View 3. Diode Direction 1. Middle Pin of 42 2. To Middle Pin of 31 4. Repeat Steps 1&2 for diode 2
Wiring Interface : Resistors 5. Repeat Steps 1&2 6. Repeat Steps 3&4 3. Left Pin of 31 • Left Pin of 42 • (Viewed from front) 4. To Any Spot 2. To Middle Pin of 31
Wiring Interface : + 3. Repeat Steps 1&2 • Left Pin of 42 (back view) 2. +
Wiring Interface : Ground 3. Repeat Steps 1&2 1. Right Pin of 31 2. -
Wiring Interface : D sub • Resistor to • Pin 2 of D sub 2. Resistor to Pin 3 of D sub 3. Ground to Pin 18 of D sub
Wiring Interface : Ribbon Cable 4. To Middle Pin of 42 2. To Middle Pin of 42 3. Wire 5 1. Wire 6
Bidirectional Motor Software • Write a program to control the car such that when • 1 is pressed the car moves backward • 2 is pressed the car moves forward • 3 is pressed the car stops.
Bidirectional Motor Software var answer : int var key : string (1) put “ 0 is stop, 2 is forward, 1 is reverse” loop getch (key) cls answer := string (1) if answer = 1 then parallelput (answer) put “REVERSE” elsif answer = 2 then parallelput (answer) put “FORWARD” elsif answer = 0 then parallelput (answer) put “STOP” end if exit when answer = 0 end loop
Additional Features • Additional options could include: • Separate left and right tail lights • Head lights • Search lights on roof • Software control of all lights individually • Backup lights • Audio backup signal
Addresses smythel@mnsi.net www.classictechnology.ca www.holtsoft.com