IR remote controlled car

Aim: The main objective of this project is to build an Arduino controlled Robot Car with Infrared Remote IR.

Components used:-

1.TSOP 1738:

The TSOP sensor has the ability to read the output signals from home remotes like TV remote, Home theater remote, AC remote etc.. All these remotes will work with a frequency of 38kHz and this IC can pick up any IR signals process them and provide the output on pin 3.

this series TSOP-1738 will receive only 38Khz IR signals. All remotes in India will operate in 38Khz.

Pin NumberPin NameDescription
1GroundConnected to the Ground of circuit
2VccTypically connect to +5V, maximum of 6V can be given
3SignalThe signal pin gives out the sequence based on the IR signal detected
   

TSOP-1738 Characteristics

  • Minimum and Maximum Input Voltage is -0.3 and 5V respectively. Typically +5V is used.
  • Can detect IR signals from Remotes (38kHz)
  • Operating current: 5mA
  • High Range and wide coverage area.
  • Will respond only to IR signals, due to high immunity against ambient light
  • Low power consumption
  • Has in-built pre amplifier
  • TTL and CMOS compatible
  •  The TSOP-1738 is an IR Receiver Sensor, which can be used to receive IR signals of 38Khz. The sensor operates on 5V and consumes around 5mA to operate. Normally the signal pin (pin 3) IC is connected to a microcontroller to analyze the IR signal received.

2. LiPo battery :

  • A LiPo cell has a nominal voltage of 3.7V. For the 7.4V battery above, that means that there are two cells in series (which means the voltage gets added together).
  • Reason we are using this battery is  because to drive a motor we need a minimum of 6v and current should be  420mA and more over this battery will last for long time as it has a capacity of 4000mAh

3. IR Remote working:

What is IR Remote?

IR stands for Infrared and means the remote must be pointed directly at the receiver. RF stands for Radio Frequency and means the remote is multi-directional. Just about every remote that comes with any piece of A/V equipment these days uses an IR based control system.

Working of IR Remote

An IR remote (also called a transmitter) uses light to carry signals from the remote to the device it controls. It emits pulses of invisible infrared light that correspond to specific binary codes. … This means that IR remotes won’t work through walls or around corners. They also have a limited range of about 30 feet.

Hexa values of IR Remote: The Hexa values of necessary button is given below.

  • 1=FE50AF.
  • 2=D607981.
  • 3=6C4D215F.
  • 4=7FE30CF.
  • 5=1FEB04F.
  • 6=1FE708F.
  • 7=D20001FD.
  • 8=1FEF00F.
  • 9=1FE9867.

4.ARDUINO NANO:

  • Arduino Nano is a small, compatible, flexible and breadboard friendly Microcontroller board, developed by Arduino.cc

About Arduino Nano:

The Arduino Nano is a small, complete, and breadboard-friendly board based on the ATmega328P (Arduino Nano 3. x). It has more or less the same functionality of the Arduino Duemilanove, but in a different package. It lacks only a DC power jack, and works with a Mini-B USB cable instead of a standard one.

  • REMOTE CAR CHASSIS.
  • USB CABLE.
  • MINI BREADBOARD.
  • JUMPER WIRES.

BLOCK DIAGRAM:

Working of IR Remote control car with Arduino Nano: Each button in IR Remote is 32 bit. So first find Hexa values of each button. Once button is pressed ‘TSOP’ receives the signal and gives an output from its ‘VOUT’ pin.

 These values can be checked in serial window of Arduino software. Now the decimal values are converted into Hexadecimal values of required button.

 The buttons used here is ‘2’ for forward direction,’8’ for backward direction,’6’ for right direction,’4’ for left direction and ‘5’ for stop.

Now dumping code in Arduino nano to make motor run. The code is given below and circuit connections is made as per block diagram.

Schematic:-

Board:-

           Code:

#include <IRremote.h>
 
/* define IR sensor pin */
int IRsensorPin = 12;
 
/* define functions used by the library */
IRrecv irrecv(IRsensorPin);
decode_results results;
 
/* define L298N motor drive control pins */
int RightMotorForward = 2;    // IN1
int RightMotorBackward = 3;   // IN2
int LeftMotorForward = 4;     // IN3
int LeftMotorBackward = 5;    // IN4
 
 
void setup(){
 
  /* initialize motor control pins as output */
  pinMode(LeftMotorForward,OUTPUT);
  pinMode(RightMotorForward,OUTPUT);
  pinMode(LeftMotorBackward,OUTPUT);
  pinMode(RightMotorBackward,OUTPUT);
 
  /* start serial communication to see hex codes */
  Serial.begin(9600);
  irrecv.enableIRIn();
}
 
void loop(){
 
  /* if the sensor receives any signal */
  if (irrecv.decode(&results)){
   
    /* print hex code value on the serial monitor */
    Serial.println(results.value);
    delay(5);
 
    /* resume function according to hex code */
    irrecv.resume();
  }
 
  /* if the incoming data is "defined hex code" then run the motors functions */
  /* instead of zeros "0000", write the hex codes of your remote control */
  if(results.value == 0000) MotorForward();
  if(results.value == 0000) MotorBackward();
  if(results.value == 0000) TurnRight();
  if(results.value == 0000) TurnLeft();
  if(results.value == 0000) MotorStop();
 
}
 
/* FORWARD */
void MotorForward(){
  digitalWrite(LeftMotorForward,HIGH);
  digitalWrite(RightMotorForward,HIGH);
  digitalWrite(LeftMotorBackward,LOW);
  digitalWrite(RightMotorBackward,LOW);
}
 
/* BACKWARD */
void MotorBackward(){
  digitalWrite(LeftMotorBackward,HIGH);
  digitalWrite(RightMotorBackward,HIGH);
  digitalWrite(LeftMotorForward,LOW);
  digitalWrite(RightMotorForward,LOW);
}
 
/* TURN RIGHT */
void TurnRight(){
  digitalWrite(LeftMotorForward,HIGH);
  digitalWrite(RightMotorForward,LOW);
  digitalWrite(LeftMotorBackward,LOW);
  digitalWrite(RightMotorBackward,HIGH);
}
 
/* TURN LEFT */
void TurnLeft(){
  digitalWrite(RightMotorForward,HIGH); 
  digitalWrite(LeftMotorForward,LOW);
  digitalWrite(LeftMotorBackward,HIGH);
  digitalWrite(RightMotorBackward,LOW);
}
 
/* STOP */
void MotorStop(){
  digitalWrite(LeftMotorBackward,LOW);
  digitalWrite(RightMotorBackward,LOW);
  digitalWrite(LeftMotorForward,LOW);
  digitalWrite(RightMotorForward,LOW);
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Start a Blog at WordPress.com.

Up ↑

Create your website at WordPress.com
Get started
%d bloggers like this: