how to make a IR remote control car

0

IR REMOTE CONTROL CAR

Today in this article we are going to Make IR remote control car with Arduino Maga , L293D Motor Driver, IR Receiver and IR remote. Here you will get Fully Detailed instructions for making Arduino Joystick Controlled Car. Codes are also Included.

I have tried to provide you all the must-have Circuit Schematics and Diagrams in this article. My intention was to give you all in one guide for making joystick Car.

Joystick controlled car is a motion controlled car. Here, the Joystick can be used in two ways by using the button underneath the Joystick: By changing the Gear and moving the Joystick left ,right, forward and backward the car can be controlled accordingly.

If you want to make a School/ College project then this project is for you. You would not need any special knowledge for making the Arduino joystick control car. So, you should definitely try it.

WATCH YOUTUBE VIDEO

Watch the Full Video and you will understand everything. Next, follow the step by step guide below.

Arduino joystick Control Car Video

IR CONTROL CAR WORKING

The principle behind this project is to send infrared modulated signals to the IR receiver. TSOP1738 works here as an infrared receiver. The TSOP1738 IR receiver receives the modulated signal and demodulates it into the Arduino. Then the demodulated signal has some noise that should be filtered. After this, the input signal is extracted. The main part of this project is decoding the remote keys in hex form.

COMPONENTS REQUIRED

Item Image

Item Name

Quantity

Shop Online

Plywood 16cm X10cm

1 No

Caster Wheels

1 No

Arduino UNO

1 No

L298N Motor Driver

1 NO

dc gear motor

2 no

Wheel

2 no

IR Receiver
TSOP1738

1 No

Any IR remote

1 No Order Now

18650 cells

1 No

18650 battery holder

2 No

Switch

1 No

Jumper wires

Enough

TOOLS REQUIRED

Tool Image

Tool Name

Shop Online

Gun gum

Soldering rod with lead

Order Now

Screwdriver

Order Now

APPS AND ONLINE SERVICES

Arduino IDE

Downlond now

STEPS TO MAKING

I have divided the IR control car into several steps. By this, you can understand the Arduino car more easily. Please don’t skip any step otherwise it will be difficult to replicate.

Step 1:

First, you will need 4 gear Motors. Sometimes the motor doesn’t come with wire attached. So, In that case, you have to attach the wire to the motors with a soldering iron.

Step 2:

In the same way, I have connected wires with Motors. One suggestion to solder is that please don’t heat the motor terminals too much they will be damaged if you heat that too much. After that, I tested all the motors before connecting and it works just fine.

Step 3:

Now take a Piece of Plywood dimension of 16CM x 10CM. Now use a Glue Gun and place the motor on the Plywood corners. Use the same technique and connect all 2 Motors on the chassis.

Step 4:

I have attached Motor in the Plywood. One suggestion to you is to align the motors. Otherwise, the motors will not go straight.

Step 5:

First take Arduino Uno and them attach it on the Chassis. Many people use Hot Glue to attach but I don’t recommend that at all. The coper traces under the PCB may be damaged for the hot glue. So, I used Double sided tape for attaching the Board.For controlling the Motors we will definitely need a motor driver. The L298n and the L293D motor drivers are most commonly used with Arduino. All these drivers have an inbuilt H-Bridge inside in it for controlling the motors.

Step 6:

Here is the Left and the Right side view of the Car. You can see the connection more clearly here. If you change the motor wires then the motor rotation will also change. Just connect all the motor as shown in the picture and will work just fine.

Note:

Suppose you are powering a DC motor with a power source like 9V Battery. Just think that your motor is rotating in a certain direction. Now, If you change the connection (Suppose previously you connected Red Wire to the +ve and the Gray wire with the -ve of the battery. So, here changing connection means you have to connect the Red wire with the -ve and Gray wire with the +ve) then the motor will rotate in the opposite direction. This is the property of DC Motor. In this way, you can also check your DC Motor is working or not.

Step 7:

I have used 18650 Batteries for Joystick Control Car. You can also use Li-Po Batteries or Lead Acid Batteries as well. My recommendation is to go with Li-ion or Li-Po Battery because this is most commonly used in Projects. Nowadays you can get 18650 Batteries as cheap as 2$. And these batteries will give you the most power.

Connect the Battery wires with the EXT_PWR Terminal Block. The Battery Terminal block has a Switch inbuilt in it. It is used to turn On/ Off the car. I have attached Double-sided tape with the battery holder and connected with the Chassis.

Note:

But one thing I should definitely mention that Li Batteries are great for DIY Projects. But use with care. Charge with Dedicated chargers. Just being at the safe side you may use the TP4056 Li Charger module. And never ever Over-charge, Over-discharge, or short circuit these batteries. It may blast.

Step 8:

CIRCUIT FOR DECODE

Arduino IR Remote Control car with L293D Motor Driver

Pinout diagram of TSOP1738

Connect the wires as per the shown in the figure or table

wire connection between Arduino and motor driver

TSOP1738 Arduino MEGA
GND GND
VS VIN
OUTPUT A0

CODE FOR DECODE

Now, I have provided the code below. Just copy the code and paste it in your Arduino IDE. Before uploading the code to Arduino we need to add a library to Arduino. Just go to the following.

#include <IRremote.h>

int IR_Recv = A0;
IRrecv irrecv(IR_Recv);
decode_results results;

void setup() {
  pinMode(13, OUTPUT);
  Serial.begin(9600); //starts serial communication
  irrecv.enableIRIn(); // Starts the receiver
}

void loop() {
  if (irrecv.decode(&results))
  {
    long int decCode = results.value;
    Serial.println(decCode);
    irrecv.resume();
  }
}

Step 9:

Connect the wires as per the shown in the figure or table

CIRCUIT FOR IR REMOTE CONTROL CAR

Connect the wires as per the shown in the figure or table

wire connection between Arduino and motor driver

Motor Driver(L298n) Arduino UNO
IN 1 Pin 4
IN 2 Pin 5
IN 3 Pin 6
IN 4 Pin 7

CODE FOR CONTROL IR REMOTE CONTROL CAR

Next, connect your Arduino with your PC or MAC. After that, we will dive into the software section.

#include <IRremote.h>

#define in1 8
#define in2 9
#define in3 10
#define in4 11
int IR_Recv = A0; //IR Receiver Pin 7
IRrecv irrecv(IR_Recv);
decode_results results;

void setup(){
  pinMode(in1 , OUTPUT);
  pinMode(in2 , OUTPUT);
  pinMode(in3 , OUTPUT);
  pinMode(in4 , OUTPUT);
  
  Serial.begin(9600); //starts serial communication
  irrecv.enableIRIn(); // Starts the receiver
}

void loop(){
  if (irrecv.decode(&results)){
    long int decCode = results.value;
    Serial.println(decCode);
    if (results.value == 12583000) 
    {
    digitalWrite(in1, HIGH);
    digitalWrite(in2, LOW);
    digitalWrite(in3, HIGH);
    digitalWrite(in4, LOW);
    }
    if (results.value == 12583001) 
    {
    digitalWrite(in1, LOW);
    digitalWrite(in2, HIGH);
    digitalWrite(in3, LOW);
    digitalWrite(in4, HIGH);
    }
    if (results.value == 12583003)
     {
    digitalWrite(in1, HIGH);
    digitalWrite(in2, LOW);
    // Set Motor B forward
    digitalWrite(in3, LOW);
    digitalWrite(in4, HIGH);
      }
     if (results.value == 12583002) 
     {
    digitalWrite(in1, LOW);
    digitalWrite(in2, HIGH);
    // Set Motor B forward
    digitalWrite(in3, HIGH);
    digitalWrite(in4, LOW);
      }
    if (results.value == 12583004) 
    {
    digitalWrite(in1, LOW);
    digitalWrite(in2, LOW);
    // Set Motor B forward
    digitalWrite(in3, LOW);
    digitalWrite(in4, LOW);
     }
    irrecv.resume();
  }
}

Step 10:

Now choose the Board as Arduino Uno and Choose the right COM port. Next compile the code first and then Upload the code to Arduino.

Step 11:

Now I attached the 18650 Batteries in the 18650 Battery Holder. Before powering the car just check all the necessary connections like Battery Power +ve and -ve is connected or not, joystick modules Polarity is right or different. A simple mistake can lead you to damage any modules. And turned on the Switch. Here you will see the L293D Motor Driver’s Green LED glow after turning it on.

Step 12:

Now you will need theIR Remote for controlling the car.

OUTPUT VIDEO

I hope this step by step guide will help you for making the Arduino Joystick control car with L293D whether you are a Beginner or it is your first-ever Arduino project. All components link are included with proper pricing. Hope this helps. If you have any queries or any suggestions then don’t forget to mention that into the comment section. I will definitely try to help you. Moreover, you can subscribe to our Youtube channel Electromechanics for more amazing content like this.

Thank you

Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !