Keyes IR Remote Sensor


Keyes IR SensorIR remote

My Bluetooth Remote Control Robot kit also comes with a Keyes Infrared remote sensor and a command .

IR command

You’ll need to install the IR Remote library for this to work. You can get it from github – Arduino-IR. To install, just follow the instructions provided in the README file.

If you want, you can learn a bit more about the IR protocol in the Ken Shirriff’s blog (link below).

This sensor has three PINS, from left to right : GND (-), VCC (2nd PIN), SIGNAL (S).

Let’s connect this to the Arduino. The signal PIN connect to digital PIN 11 (If you choose another, please change it in the sketch below).

#include <IRremote.h> //include the library
//PIN
int receiver = 11;
IRrecv irrecv(receiver); //create a new instance of receiver
decode_results results;
void setup() {
 Serial.begin(9600);
 irrecv.enableIRIn(); //start the receiver
}
void loop() {
 if (irrecv.decode(&results)) { //we have received an IR
 Serial.println (results.value, HEX); //display HEX
 irrecv.resume(); //next value
 }
}

Here is the result, from pressing buttons on the remote:

IRResult

References

http://tronixstuff.com/2011/03/30/tutorial-arduino-and-infra-red-control/

http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html

9 thoughts on “Keyes IR Remote Sensor

  1. Error on this sketch

    C:\Program Files\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: ‘TKD2’ was not declared in this scope
    int RECV_PIN = TKD2; // the pin the IR receiver is connected to

    Wat to do, i am a beginner.

    Thanks Bert

    • #include
      IRsend irsend;

      void setup ()
      {
      Serial.begin (9600);
      }

      void loop () {
      if (Serial.read ()! = -1) {
      for (int i = 0; i <3; i ++) {
      irsend.sendSony (0xa90, 12); // Sony TV Power code
      delay (100);
      }
      }
      }

      This is the code.
      I've done the steps to give up. and rename to IRremote
      The error remains the same.
      At every sketch.

      Arduino version 1-0.6

      Greetings Bert

      • Hello Ken.

        It works !!
        I have reset everything, including the P.C
        The I.R now displays the code on the screen.
        I often see FFFFFF among the other code.
        Is that normal?

        Many thanks for your help
        70 years old but not too old to learn.

        Greetings Bert.
        http://www.bertheideveld.nl

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