DIY Line Tracking Smart Car with AT89C2051 1. Introduction: A DIY Smart Car design involves mechanical structure, electronic based sensor principle, automatic control, and even knowledge of microcontroller programming. We hope users can greatly improve their knowledge of electronics, robotics, controls, mechanical, and even soldering technique through hands on practice. We all know that block objects absorb more heat than lighter objects. This Smart Car has infrared receivers which detect signals from infrared emitting diodes. It detects white vs. dark surface, if a darker surface is on the right side, the right motor would stop and vice versa, so the car can always run along a dark trail. With AT89C2051 microcontroller with 2K bytes built in flash memory, this smart car is a very well designed platform which allows different accessories to be added. With innovative thinking it can be converted to fighting robots, remote control cars and so on. As it requires high temperature soldering skill, guardian is required if you are less than 18 years old. Please read through the instruction before start assembling. 2. Things you will learn: Robotics Control How to read electrical schematic How does IR emitter and sensor work How does LM393 use as comparator http://en.wikipedia.org/wiki/comparator How does PNP transistor work http://en.wikipedia.org/wiki/bipolar_junction_transistor How does LED work http://en.wikipedia.org/wiki/light emitting_diode How does Potentiometer work http://en.wikipedia.org/wiki/potentiometer Reading resistor color codes http://www.wikihow.com/read Resistors Improve soldering skill http://www.wikihow.com/solder %28Electronics%29 Microcontroller Programming 3. Things that you need but not included with the kit: a. Soldering Iron b. Solder c. Solder Wick (for desoldering) d. Screw Driver e. Digital Multimeter www.elabpeers.com Page 1
Contents: Schematic Name Component Value Quantity U1 AT89C2051 1 U1 IC Socket for AT892051 1 U2 LM393 1 U2 8pin DIP IC Socket 1 C1 Capacitor 104 1 C2 Capacitor 104 1 C3 Capacitor 104 1 C6 Capacitor 30 1 C7 Capacitor 30 1 C4 Capacitor 100uF 1 C5 Capacitor 100uF 1 D1 LED Green 1 D2 LED Green 1 R1 Resistor 10K 1 R2 Resistor 10K 1 R3 Resistor 10K 1 R4 Resistor 1K 1 R5 Resistor 1K 1 R8 Resistor 510 1 R9 Resistor 510 1 R10 Resistor 1K 1 R11 Resistor 1K 1 R12 Resistor 1K 1 R13 Resistor 1K 1 R6 Photoresistor 1 R7 Photoresistor 1 D1, D2 LED Green 2 D3, D4 IR emitter Transparent 2 D5, D6 IR sensor Black 2 Q1, Q2 PNP Transistor 8550 2 M1, M2 Motor 2 S1 Switch 1 J1 J5 Pin 15 Y1 Resonance 12Mhz 1 Wheels 2 Caster Screw 1 Caster Nut 2 Caster 1 Chassis PCB 1 Wire 2 AA Battery Holder 1 www.elabpeers.com Page 2
4. Instruction for assembly (Please read through the instruction before start): a. Study the schematic. (can be download from our site) b. Cut the wire into half and solder them on the motors. Soldering Tips: Step1 put solder on the motor. Step2 solder down the wire. c. Assemble the wheels and put them on the motors. d. Populate all the resistors to the according location. e. Populate the DIP sockets. f. Populate the Green LEDs. g. Populate the capacitors and resonance. www.elabpeers.com Page 3
h. Populate Q1 and Q2 (Very Important!!! Make sure it is the same as the picture below). i. Populate the pins, potentiometer, and switch (orientation of the switch is not important). j. Turn around the chassis PCB and populate the IR emitters and sensors. Put the LED ~1/2 above the PCB. www.elabpeers.com Page 4
k. Stick the battery holder on the PCB, run the wires thru the hole on the PCB and solder the wires accordingly. l. Stick the motor module on the PCB, and solder the wires accordingly. Reserve the wires if the wheel does not turn forward. m. Assemble the wheels, the caster set. 5. Testing: Put the main switch at the OFF position. DO NOT insert LM393 and AT89C2051. Insert the AA batteries. With the switch OFF, use a digital multimeter to measure the current from the switch ON pin to switch Middle pin. If the system is measured much higher than 12mA please double check the connection of all the components. If ~12mA is measured, please insert LM393 IC and measure the current again. The current should now be 1 2mA higher than the previous measurement. If the difference measured is much higher than ~2mA difference, please double check the connection of all the components. If the second measure is correct. You can now insert AT89C2051. Measure the current again with AT89C2051. It should now be 125mA. And this would indicate the system is installed correctly and ready for calibration. 6. Calibration: Insert batteries and turn on the switch. Without influencing IR sensor and detectors, adjust the potentiometers until both wheels are running. Make sure both wheels are running in the correct direction. 7. Troubleshooting: Make sure the IC is installed correctly. Make sure both of the PNP transistors are installed correctly. If D4 or D5 never turns on, first make sure R5 and R6 are soldered correctly, and then you can try to reserve the connection of D4 or D5. If M1 motor runs but D1 diode is not on, first make sure R11 is soldered correctly, and then you can try to reserve the connection of D1. www.elabpeers.com Page 5
If M2 motor runs but D2 diode is not on, first make sure R12 is soldered correctly, and then you can try to reserve the connection of D1. For further debugging, examine voltages at the INPUTs of LM393. 8. Programming: The DIY Smart Car line tracking feature is designed to run with the programmed AT89C2051. No extra programming is needed for line tracking feature. All the useful pins of AT89C2051 are brought out by the pins which are easily access by users. It will be fun to have add on to the Smart Car with AT89C2051. AT89C2051 datasheet is provided. 9. Copyright: In order to design this low cost high value product which benefits lots of people or students, the original designer has spent days and nights to improve and create this new product. We hope the hardwork of the original designer would be respected. We encourage improvement and new ideas. However, direct copying the design is not only theft, but also kills future innovations. www.elabpeers.com Page 6