Chandrasekar
Published © GPL3+

My Remote Controlled Robot | Home Automation

A wireless IR communication that can be used for controlling the robot and even the home appliances through a single TV remote.

IntermediateProtip30 minutes1,247
My Remote Controlled Robot | Home Automation

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
TSOP1738
×1
High speed 12 v Dc motor
×2
l293d motor driver module
×1
12v rechargable battery
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

My Remote Controlled Robot | Home Automation

Motor driver -----> Motor1, Motor2
IR Receiver -----> OUTPUT-----> PIN 11
+ve voltage----->VCC
GROUND----->GND
12 volt rechargable battery to L293D Driver

Code

IR DECODING

Arduino
#include <boarddefs.h>
#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);                 
     
    irrecv.resume(); // Receive the next value
  }
}

IR ROBOT MAIN PROGRAM

Arduino
#include <boarddefs.h>
#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>

int receiver = 11; // Signal Pin of IR receiver to Arduino Digital Pin 11

IRrecv irrecv(receiver);     // create instance of 'irrecv'
decode_results results;      // create instance of 'decode_results'

void setup()   
{
  Serial.begin(9600);
  Serial.println("IR Receiver Button Decode"); 
  irrecv.enableIRIn(); // Start the receiver
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
 

}


void loop()  
{
  if (irrecv.decode(&results)) // have we received an IR signal?

  {
    switch(results.value)

  {

 
  case 0xC1AA0DF2:                                                //mOVEMENT -FORWARD
                  digitalWrite(2,HIGH);
                  digitalWrite(3,LOW);
                  digitalWrite(4,HIGH);
                  digitalWrite(5,LOW);  
                  break;
  case 0xC1AA4DB2:                                                 //MOVEMENT- BACKWARD
                  digitalWrite(2,LOW);
                  digitalWrite(3,HIGH);
                  digitalWrite(4,LOW);
                  digitalWrite(5,HIGH);
                  break;
  case 0xC1AACD32:                                                 //MOVEMENT- LEFT
                  digitalWrite(2,LOW);
                  digitalWrite(3,HIGH);
                  digitalWrite(4,HIGH);
                  digitalWrite(5,LOW);
                  break;
  case 0xC1AA8D72:                                                 //MOVEMENT- RIGHT
                  digitalWrite(2,HIGH);
                  digitalWrite(3,LOW);
                  digitalWrite(4,LOW);
                  digitalWrite(5,HIGH);
                  break;
  case 0xC1AA11EE:                                                 //MOVEMENT- RIGHT
                  digitalWrite(2,LOW);
                  digitalWrite(3,LOW);
                  digitalWrite(4,LOW);
                  digitalWrite(5,LOW);
                  break;            //   ^here your hex code that you got in irdumpv2 or irdemo
  
  default: 
                  Serial.println(" other button   ");

  }// End Case

  delay(100); // to not get immediate repeat
  irrecv.resume(); // receive the next value
  }  
}



  

Credits

Chandrasekar

Chandrasekar

1 project • 1 follower
I am B.Chandrasekar. I am pursuing BE in Electronics and Communication Engineering in SSM Institute of Engineering and Technology,Dindigul.

Comments