How to Make a Infrared (IR) Remote Controlled Car With a TV Remote for University Project, Science Fair and Robotics Competition

by square1a in Circuits > Arduino

4479 Views, 27 Favorites, 0 Comments

How to Make a Infrared (IR) Remote Controlled Car With a TV Remote for University Project, Science Fair and Robotics Competition

IMG_20220514_153712.jpg

Follow the instructions below to build the remote control car car. This project is ideal for science fair, robotics competition and university projects. The design is highly adaptable, you can modify it easily and add your own components.


Table of contents

Step 1: video demo

Step 2: circuit diagram

Step 3: Arduino code (software)

Step 4: Fixing common error, if your car does not work

Step 5: Notes for modifying this design

Safety instructions:

  1. Take the batteries out of car when not in use. If you cannot see/supervise the car, take the batteries out.
  2. Do NOT short the circuit. A common symptom of this is the circuit overheats.
  3. If you are using your own power supply, use less than 12 volts, unless you know what you are doing.

Supplies

Screen Shot 2022-05-19 at 12.48.50 pm.png
Screen Shot 2022-05-19 at 12.48.26 pm.png
Screen Shot 2022-05-19 at 12.48.39 pm.png
Screen Shot 2022-05-19 at 1.19.01 pm.png
  1. Chasis car kit: (e.g. https://www.phippselectronics.com/product/2wd-intelligent-robot-car-kit/?gclid=Cj0KCQiAqsitBhDlARIsAGMR1RhVJQm_5bbR5MACucAAQUzIxo9Umyy1rzdiAdgYnaA5uZS3CZ2HafQaApBtEALw_wcB)
  2. IR sensor
  3. L293D motor control module
  4. 6X AAA battery holder (the chasis car kit only includes a 4X AAA battery holder which does not supply enough voltage)
  5. Aduino UNO
  6. 220uF capacitor (or bigger capacitance)
  7. Breadboard and jumper wires
  8. TV remote (ensure its batteries have charge)
  9. 6X AA rechargeable* batteries
  10. A cross-head screw driver
  11. Soldering iron (for attaching wires to the TT motor)

*rechargeable ones are recommended, since DIY car typically have poor power efficiency and drains batteries quickly

Watch the Video

IR car demo video HD 1080p

Timestamp in the video:

0:17 assembling the chassis and motors

4:30 electronics

5:48 circuit diagram

5:54 software (Arduino code)

7:50 demo of the driving (with precision mode code)

8:20 demo of the driving (with racing mode code)

Circuit Diagram

Screen Shot 2022-05-15 at 8.17.50 pm.png

Wire it up according the diagram above.

Arduino Code

Screen Shot 2022-05-15 at 8.18.46 pm.png

There are two modes on offer:

Precision Mode: when it turns left/right, it spin on a fixed axis (see Step 1 video at timestamp 7:49)

  1. Download 'IR_car_precision.ino' AND 'PinDefinitionsAndMore.h', which are attached below
  2. Then save them into a folder called 'IR_car_precision'
  3. To change the speed of car, find the variable "carSpeed" and change it
  4. To change how fast the car turns left/right, change the variable "turnTime"


Racing Mode: it turns left/right, while going forward, like a real-life road car. (see Step 1 video at timestamp 8:19)

  1. Download 'IR_car_racing.ino' AND 'PinDefinitionsAndMore.h', which are attached below
  2. Then save them into a folder called 'IR_car_racing'
  3. To change the speed of car, find the variable "upperSpeed" and "lowerSpeed"
  4. To change how fast the car turns left/right, change "upperSpeed" and "lowerSpeed", so the difference between them is bigger/smaller


If you have never used an Arduino before, check out https://www.arduino.cc/en/Guide/ArduinoUno

Fixing Common Errors

Screen Shot 2022-05-19 at 9.28.39 am.png

If you do not have any errors, skip this step (and congratulations!).

Arduino does not respond to infrared signals.

  1. Go into serial monitor of the Arduino, which would provide you with information
  2. Check the TV remote's battery has power
  3. Have you change 'command' number, which is shown in Step 1's video at timestamp 7:15?
  4. Have you inserted the capacitor into the circuit?
  5. Move the car closer to the TV remote
  6. Do the check mentioned under 'Arduino is not powered on' section below, voltage under 7 volts leads to instability and inaccurate reading by the infrared sensor

Arduino is not powered on

  1. Use a multimeter or voltmeter to measure the voltage between the black and red wire of battery holder. Then measure voltage between pin 8 and 4 of L293D chip, when it is connected to the battery. If any of the two voltage measurements is less than 7 volts, replace with fully charged batteries.


Motor does not move, or very weakly.

  1. Check if the Arduino is powered on
  2. Ensure pin 16 of L293D is connected to 5V on Arduino.
  3. Both wires of each motor are plugged in properly


Car does not drive straight.

  1. A bit of deviation from straight path is expected, and there is little can be done.
  2. Ensure the wheels are mounted properly and are parallel to each other
  3. Ensure pin 16 of L293D is connected to 5V on Arduino.
  4. Try all the commands: drive forward, backward, left, right and stop. You might have mixed up the keys.


For all issues.

  1. Ensure everything is connected as shown in Step 2's diagram
  2. Read the error message in the black window at the bottom of Arduino IDE. Copy the error message into Google.
  3. Go to Tools in Arduino, ensure the Board is "Arduino UNO". And port is usb something, not BlueTooth.

Customise Your Own

IMG_20220515_130859.jpg

For you to design your own car, you need to understand:

  1. Pin 0, 1 and 13 on the Arduino are special, so avoid using them. Pin 2 is reserved for the infrared sensor.
  2. For stable operation, Arduino UNO board needs 7 to 12 volts of power via its Vin port. That's why this design uses six rechargeable AA batteries (voltage of one rechargeable AA is about 1.2V, so 6 X 1.2 = 7.2 > 7 volts.
  3. The L293D motor control chip needs 4.5 to 36 volts of power via its pin 8.
  4. The L293D also has clamp diodes to protect against Inductive Flyback (aka Flyback voltage) voltage spike. So if you want to replace it, the substitute also needs to offer this protection.
  5. The capacitor keeps the voltage at 5V pin on the Arduino constant, using the fact that voltage across a capacitor cannot change instantaneously. A constant voltage is vital for the infrared sensor, which is very sensitive.
  6. If the infrared sensor stops working after adding a servo motor (or any other type of inductive load), replace the 220 µF capacitor with one of bigger capacitance, to enhance constancy of voltage at 5V pin on the Arduino.


component specifications:

Arduino: http://store-usa.arduino.cc/products/arduino-uno-rev3

L293D chip datasheet: https://www.ti.com/lit/ds/symlink/l293.pdf