Grove - Infrared Receiver

From Wiki
Jump to: navigation, search


The Infrared Receiver is used to receive infrared signals and also used for remote control detection. There is an IR detector on the Infrared Receiver which is used to get the infrared light emitted by the Infrared Emitter. The IR detector have a demodulator inside that looks for modulated IR at 38 KHz. The Infrared Receiver can receive signals well within 10 meters. If more than 10 meters , the receiver may not get the signals. We often use the two Groves-the Infrared Receiver and the Grove - Infrared Emitter to work together.

400px-Grove - Infrared Receiver.jpg


Voltage: 3.3-5V Distance: 10m


We will use Grove-Infrared Receiver and Grove - Infrared Emitter in this demonstration. The Infrared Receiver will receive the data that the Grove - Infrared Emitter sends.

Connect the Grove - Infrared Emitter to D3; Connect the Grove - Infrared Receiver to A4;

IR SendRev1.jpg

Download the library file:IR Send and Receiver Library, Unzip it into the libraries file of Arduino IDE by the path: ..\arduino-1.0\libraries. Open the code directly by the path:File -> Example ->IRSendRev->sendTest. //************** //IR sent demo v1.0 //Connect the IR sent pins to D3 for this demo //By: //******************************

  1. include <IRSendRev.h>

void setup() {


} //unsigned char d[] = {9, 90, 91, 11, 31, 4, 1, 2, 3, 4}; unsigned char d[] = {15, 70, 70, 20, 60, 10, 1, 2, 3, 4,5,6,7,8,9,10}; //Very Important: //the first parameter(15): the data that needs to be sent; //the next 2 parameter(70,70): the logic high and low duration of "Start"; //the next 2 parameter(20,60): the logic "short" and "long"duration in the communication // that to say: if "0", the high duration is 20ms and low is 20 ms; while logic "1", // the high duration is 20 ms and low is 60 ms; //the next 2 parameter(10): number of data you will sent; //the next parameter(1, 2, 3, 4,5,6,7,8,9,10): data you will sent ; void loop() {

   IR.Send(d, 38);//sent the data via 38Kz IR


Open the code directly by the path:File -> Example ->IRSendRev->revTest.


//IR receive demo v1.0 //Connect the IR sent pins to A4 for this demo //By: //******************************

  1. include <IRSendRev.h>

//#include <IRSendRevInt.h>

void setup() {

   Serial.println("init over");


unsigned char dta[20];

void loop() {

      // IR.Recv(dta);
       int length= IR.Recv(dta);
       for (int i =0;i<length;i++)

// Very Important: // the received data is comprised of the transmission parameters, please refer to // the sendTest.ino in the library ;


When the Infrared Emitter tube faces the IR receiver tube(the distance of emitter to receiver should be less than 10m), then open the Grove - Infrared Receiver serial port for getting information:

IR Send and Receiver.jpg