Skip to main content

IR Tsop (TV Remote Controlled Robot)

Intrroduction

Step 1 : Install IR remote library by ken shirrif using manage library option under sketch menu .
Step 2: afterintalling library go to examples and select irremote from the list and the go to IrRecvdemo program and upload the program to the arduino and connect tsop only to the arduino.

Step 3: Open serial monitor and use your remote to get the codes from remote keys and note them down.

Step 4 : replace the code (marked below in red) lines looking similar to this -------
                               
     if(results.value==0x1039789F)   with your remote keys code in the following program and upload it.
Step 5 :- connect motor driver and tsop and your robot is complete.


Code of the  project :-

/*
 * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
 * An IR detector/demodulator must be connected to the input RECV_PIN.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 */

#include <IRremote.h>

int RECV_PIN = 9;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  // In case the interrupt driver crashes on setup, give a clue
  // to the user what's going on.
  Serial.println("Enabling IRin");
  irrecv.enableIRIn(); // Start the receiver
  Serial.println("Enabled IRin");
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    if(results.value==0x1039789F)
    {
      digitalWrite(13,HIGH);
      digitalWrite(12,LOW);
      digitalWrite(11,HIGH);
      digitalWrite(10,LOW);
    }
    else if(results.value==0xBB8B3E9E)
    {
       digitalWrite(13,LOW);
      digitalWrite(12,HIGH);
      digitalWrite(11,LOW);
      digitalWrite(10,HIGH);
    }
    else if(results.value==0x45481702)
    {
      digitalWrite(13,LOW);
      digitalWrite(12,LOW);
      digitalWrite(11,HIGH);
      digitalWrite(10,LOW);
    }
    else if(results.value==0xF0B4BB43)
    {
      digitalWrite(13,HIGH);
      digitalWrite(12,LOW);
      digitalWrite(11,LOW);
      digitalWrite(10,LOW);
    }
     else if(results.value==0xB8E7B4FE)
    {
       digitalWrite(13,HIGH);
      digitalWrite(12,HIGH);
      digitalWrite(11,HIGH);
      digitalWrite(10,HIGH);
    }
    irrecv.resume(); // Receive the next value
  }
  delay(100);
}




Connections of the project :-

TSOP(1738)                              Arduino
VCC                                             3.3v
GND                                            GND
OUT                                              pin 9

2. Connections for L293D module:-




Here in L293d motor driver at the top we have total 7 pins . 4 Pins are used for controlling the motor and 3 pins in the middle of the l293d module are used for powering the module.

Connect the arduino and L293d as follows:-

Arduino Pins:-                L293d Motor Driver
Pin 13                                   M1 a                           // for controlling motor 1
Pin 12                                   M1 b
Pin 11                                   M2 a                           // for controlling motor 2
Pin 10                                   M2 b

Vin                                        12v
Gnd                                       Gnd                                     // providing power to L293d module
5v                                          5v



Comments

Popular posts from this blog

Lock using 4 Push button switch with arduino

Introduction : A  combination lock  is a type of locking device in which a  sequence  of symbols, usually numbers, is used to open the lock. The sequence may be entered using a single rotating dial which interacts with several discs or  cams , by using a set of several rotating discs with inscribed symbols which directly interact with the locking mechanism, or through an electronic or mechanical keypad. Here we will be using arduino uno along with em lock to make door lock with password.  Code of the project :- const int buttonPin1 = 1; const int buttonPin4 = 4; const int buttonPin3 = 3; const int buttonPin2 = 2; // the pin that the pushbutton is attached to const int correctLedPin = 7;       // the pin that the LED is attached to const int wrongLedPin = 6;  const int motorPin = 11;// the pin that the LED is attached to // variables that are changed by the program int buttonPushCounter = 0;   // co...

Voice Recording Module ISD1820 with Arduino

1 Introduction  Voice Record Module is base on ISD1820, which a multiple‐message record/playback device. It can offers true single‐chip voice recording, no‐volatile storage, and playback capability for 8 to 20 seconds. The sample is 3.2k and the total 20s for the Recorder. This module use is very easy which you could direct control by push button on board or by Microcontroller such as Arduino, STM32, ChipKit etc. Frome these, you can easy control record , playback and repeat and so on. 2 Feature  - Push‐button interface, playback can be edge or level activated - Automatic power‐dwon mode - On‐chip 8Ω speaker driver - Signal 3V Power Supply - Can be controlled both manually or by MCU - Sample rate and duration changable by replacing a single resistor - Record up to 20 seconds of audio - Dimensions: 37 x 54 mm If you want change record duration, an external resistor is necessary to select the record duration and sampling frequency, which can range from ...

Home Automation Using Arduino (Relay Module)

Inroduction to Home Automation Home automation  or  domotics  is  building automation  for a home, called a  smart home  or  smart house . It involves the control and automation of lighting, heating (such as  smart thermostats ), ventilation, air conditioning ( HVAC ), and security, as well as  home appliances  such as washer/dryers, ovens or refrigerators/freezers.  Wi-Fi  is often used for remote monitoring and control. Home devices, when remotely monitored and controlled via the Internet, are an important constituent of the  Internet of Things . Modern systems generally consist of switches and sensors connected to a central hub sometimes called a "gateway" from which the system is controlled with a  user interface that is interacted either with a wall-mounted terminal, mobile phone software,  tablet computer  or a web interface, often but not always via Internet cloud services.     ...