0% found this document useful (0 votes)
175 views

Arduino Project Report IR Car

This document describes a project to build an infrared remote controlled car using an Arduino. The car will use an IR receiver module to detect signals from the remote and move motors via an L298 motor driver. The remote will have buttons to control forward, backward, left, and right movement. The Arduino program decodes the IR signals and calls functions to control the motor driver accordingly. Required equipment includes an Arduino, breadboard, motors, battery, IR receiver, remote, and motor driver. The project aims to successfully build a car that can be controlled wirelessly via infrared remote signals.

Uploaded by

mohammad shoaib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
175 views

Arduino Project Report IR Car

This document describes a project to build an infrared remote controlled car using an Arduino. The car will use an IR receiver module to detect signals from the remote and move motors via an L298 motor driver. The remote will have buttons to control forward, backward, left, and right movement. The Arduino program decodes the IR signals and calls functions to control the motor driver accordingly. Required equipment includes an Arduino, breadboard, motors, battery, IR receiver, remote, and motor driver. The project aims to successfully build a car that can be controlled wirelessly via infrared remote signals.

Uploaded by

mohammad shoaib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Final Project:

Infrared Remote controlled Car

Using Arduino

Instructor:

Team Members:

Name: Name: Name:

Roll Number: Roll Number: Roll Number:

Submission Date:
Objective:
The objective of this project is to design and implement an Arduino based car that can
be controlled using, infrared remote controlling kits by mini ultra-thin infrared remote
controlling, and uses a 38 KHz IR receiver to detect the remote signal. The car should
work within line of sight to efficiently detect the remote signal. The remote buttons for
up, down, left, and right could be used to control the car movements.

Introduction:
As the remote controlling is used almost in every controlled device although the medium
could be Radio controlled or the Infrared. In this project we will be using the Infrared
remote controller to control a car and using an Arduino as the controller. The IR signal
will be received using an IR receiver that will receive a signal with a carrier frequency of
38 KHz and the signal will be decoded to detect the left, right, forward or back
commands. The commands than be further used to call the programed functions for left,
right or forward, back movements of the car. The movement control functions will than
transmit a digital signal to the H-Bridge motor driver L298 along with a PWM based
speed control signal onto the enable input of the H-Bridge. The motor driver will amplify
the digital signals and control the motor rotation direction i.e. clockwise or
counterclockwise and the RPM (revolutions per minute) based on the PWM signal duty
cycle. The remote controller we will be using will have the following specifications:

 CR2025 environmental protection button battery, capacity 160mah


 Emission range: 8m above (specific and the surrounding environment, the
receiver's sensitivity and other factors)
 Effective angle: 60 degree
 Surface materials: 0.125mmPET, effective life 20 thousand times.
 Stable quality, high cost performance

 Static current 3-5uA, dynamic current 3-5mA.


Equipments Required:
We require following software and hardware equipments to implement this project:

 Arduino IDE and a PC to run this software

Figure 1
 Arduino USB programming cable

Figure 2
 IR-Remote controller:

Figure 3
 Breadboard

Figure 4
 Car with battery:

Figure 5

 Arduino Uno board

Figure 6
 L298 Motor Driver:

Figure 7

Wire Connections:

Figure 8
Project Wiring Chart:

Figure 9
Conclusion:
In this project, we have successfully designed and implemented an IR remote controlled
car that has been programmed to detect the IR signals and perform the left, right,
forward or back motions based on these commands received. The hardware used for
receiving these signals is a TSOP infrared receiver designed to receive a 38 KHz base
frequency signal. That signal is than transmitted digitally to the Arduino pin connected to
the receiver and is decoded via code and the IR library. The decoded signal is than at
last used to call the functions controlling the car motions via H-Bridge motor driver.

Arduino Program:
#include <IRremote.h>
////////// IR REMOTE CODES //////////
#define F 16736925 // FORWARD
#define B 16754775 // BACK
#define L 16720605 // LEFT
#define R 16761405 // RIGHT
#define S 16712445 // STOP
#define UNKNOWN_F 5316027 // FORWARD
#define UNKNOWN_B 2747854299 // BACK
#define UNKNOWN_L 1386468383 // LEFT
#define UNKNOWN_R 553536955 // RIGHT
#define UNKNOWN_S 3622325019 // STOP

#define RECV_PIN 12

/*define channel enable output pins*/


#define ENA 5 // Left wheel speed
#define ENB 6 // Right wheel speed
/*define logic control output pins*/
#define IN1 7 // Left wheel forward
#define IN2 8 // Left wheel reverse
#define IN3 9 // Right wheel reverse
#define IN4 11 // Right wheel forward
#define carSpeed 150 // initial speed of car >=0 to <=255

IRrecv irrecv(RECV_PIN);
decode_results results;
unsigned long val;
unsigned long preMillis;
/**
* BEGIN DEFINE FUNCTIONS
*/

void forward(){
digitalWrite(ENA,HIGH);
digitalWrite(ENB,HIGH);
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,LOW);
digitalWrite(IN4,HIGH);
Serial.println("go forward!");
}
void back(){
digitalWrite(ENA,HIGH);
digitalWrite(ENB,HIGH);
digitalWrite(IN1,LOW);
digitalWrite(IN2,HIGH);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
Serial.println("go back!");
}
void left(){
analogWrite(ENA,carSpeed);
analogWrite(ENB,carSpeed);
digitalWrite(IN1,LOW);
digitalWrite(IN2,HIGH);
digitalWrite(IN3,LOW);
digitalWrite(IN4,HIGH);
Serial.println("go left!");
}
void right(){
analogWrite(ENA,carSpeed);
analogWrite(ENB,carSpeed);
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
Serial.println("go right!");
}
void stop(){
digitalWrite(ENA, LOW);
digitalWrite(ENB, LOW);
Serial.println("STOP!");
}

void setup() {
Serial.begin(9600);
pinMode(IN1,OUTPUT);
pinMode(IN2,OUTPUT);
pinMode(IN3,OUTPUT);
pinMode(IN4,OUTPUT);
pinMode(ENA,OUTPUT);
pinMode(ENB,OUTPUT);
stop();
irrecv.enableIRIn();
}

void loop() {
if (irrecv.decode(&results)){
preMillis = millis();
val = results.value;
Serial.println(val);
irrecv.resume();
switch(val){
case F:
case UNKNOWN_F: forward(); break;
case B:
case UNKNOWN_B: back(); break;
case L:
case UNKNOWN_L: left(); break;
case R:
case UNKNOWN_R: right();break;
case S:
case UNKNOWN_S: stop(); break;
default: break;
}
}
else{
if(millis() - preMillis > 500){
stop();
preMillis = millis();
}
}
}

You might also like