IR Remote Transmitter Receiver Kit Codes and Programming
IR Infrared Keypad Transmitter Remote + Receiver Kit with Breakout Board
This kit includes:
The kit can be used with any of the popular micocontroller boards such as Arduino, Raspberry Pi, micro:bit, Nodemcu, ESP8266 and many more.
To use the keypad and receiver with one of these boards you will need to check if you have a software library installed or if you need to download one.
For the Arduino, as an example, a popular library can be found here:
- just download and install to your Arduino libraries folder in the normal way and then use the include command in your sketches. Scroll Down for sample code.
The remote works by sending a code for each key pressed. You can then use these codes in conditional steps of your sketch/program to turn anything on or off, change volume, move something with a motor, or anything you can think of.
Here are the codes for our IR transmitters:
The transmitter is battery powered (CR2032) so to set up a project you just need to connect the receiver.
You can do this either by just using the photodiode receiver on its own, or by plugging it into the breakout board (or soldering it in) and connecting that to a breadboard or pcb.
The receiver has three connections - signal, ground and voltage in.
The voltage can be 3.3v to 5v and then the signal wire just needs to be connected to an input pin on your arduino or other board. To use the breakout board, plug the receiver into it and then use the header pins to connect it to your microcontroller. The breakout board includes a 10k pullup resistor for the signal pin, along with an LED indicator.
SAMPLE ARDUINO CODE
UPDATE TO ARDUINO LIBRARY:
The IRremote library has recently been updated to Version 3
The code below is for library Version 2
There have been some changes, so this code may not work if you have recently downloaded the Arduino software or updated your library.
A quick solution is to go to Manage Libraries in the File Menu and install Version 2
This page will be updated to reflect the changes soon - meanwhile you can find details of the changes here:
An easy way to get started is to set up a sketch to read the codes from your remote keypad.
Connect your signal wire to Pin 7 of an Arduino board, and take power and ground from the board for the receiver.
Copy and past this code into a blank Arduino sketch:
const int RECV_PIN = 7;
Upload the sketch and open the Serial Monitor - when you press a key you should see the code for that key displayed in the Serial Monitor window.
Control an LED with IR Remote Keypad
You can then use the key codes to perform some actions.
Connect two LEDs - here we used a Red one on Pin 2 and a Green one on pin 11.
Upload the sketch here:
const int RECV_PIN = 7;
const int redPin = 2;
const int greenPin = 11;
case 0xFF38C7: //Keypad button "5"
case 0xFF18E7: //Keypad button "2"
Now when you press button 5 the Red LED should light and when you press button 2 the Green LED will light and the Red LED will turn off.