Description
This is an Infrared IR wireless Remote Control Kit for Arduino and 38 KHZ infrared receiving module, the Mini ultra-thin has 17 function keys, the infrared emission furthest distance up to 8 meters, Infrared remote control receiving module can receive standard 38 KHZ modulation signals, by means of programming the Arduino, the remote control signal decoding operation can be realized, which can produce all kinds of remote control robots and interactive work.
Features
- Transmission Frequency: 38KHz;
- Transmission Distance: up to 8m (depending on the surrounding environment, sensitivity of receiver etc)
- Effective Angle: 60
- Static Current: 3~5uA,
- Dynamic Current: 3~5mA
- Suitable for Arduino, PIC ,AVR and other development boards
Application
- It is very suitable for indoor control devices of all kinds.
- Suitable for robots control
- Suitable for control things at distance like lights and so on.
How to get started with IR remote control
In this infrared remote kit, ther is an Infra Red remote, Infra Red receiver and an Infra Red Emitting Diode (IRED). In this article we are going to show you how to get startes with this remote control kit and control your arduino.
ThIS is an easy-to-connect. It can be plugged into a Arduino with a 3-pin cable from the Infra Red receiver and you can control your arduino with these.
The pinout of Infra Red reciever
The first pin from the bottom is the Ground, the next pin is the 5V power supply pin for IR receiver and the last pin above is signal out pin marked with S to which pin sends data.
Hardware setup
Hardware needed:
First we are going to connect the IR receiver to Arduino to determine the code for each key on our remote key pad. Set the connection as follow:
Connect the Signal out Pin to the Arduino pin D11 and GND to the ground pin of the IR receiver and 5V pin on Arduino to the middle pin of the IR receiver.
Installing the library
You must download and install this IRremote-2.8.0 into your Arduino library folder. For people who have newer version of Arduino with a library IRRobotRemote, it may conflict and you may have to remove that library. Make sure to delete Arduino_Root/libraries/RobotIRremote. Where Arduino_Root refers to the install directory of Arduino. The library RobotIRremote has similar definitions to IRremote and causes errors. For windows user who have installed the Arduino IDE, go to C:Program Files (x86)Arduino libraries and delete a RobotIRremote.
Extract the file in your libraries directory (C:UsersGwizaDocumentsArduinolibraries)
Note: For info on easier Library Installs, refer to this link, also remember to insert a Lithium battery in the back of the remote as the kit comes without a battery.
FIND THE CODES FOR YOUR REMOTE
To find the key codes for your remote control, upload this code to your Arduino and open the serial monitor:
#include <IRremote.h>
int input_pin = 11;
IRrecv IRR (input_pin);
void setup () {
Serial.begin (9600);
IRR.enableIRIn ();
Serial.print (“IR Ready … @Pin”);
Serial.println (input_pin);
}
void loop () {
if (IRR.decode ()) {
Serial.println (IRR.results.value, HEX);
IRR.resume ();
}
}
Once you have completely uploaded the Arduino sketch, Open your Serial monitor set the baud rate to 9600 and take your remote and start pressing on the key and observe what the serial monitor show. Here is mine
Record the Buttons
Here are the code that I got from the remote. FFFFFF is a repeat command, you’ll get a stream of them if you hold down a button.
FFA25D
FF629D
FFA25D
FFE21D
FF22DD
FF02FD
FFC23D
FF906F
FFA857
FFE01F
FF6897
FFB04F
FF18E7
FF10EF
FF38C7
449E79
FF4AB5
Controlling LED with IR remote
We are going to control the LED on digital pin 13 on Arduino UNO. The sketch used in this case can be enhanced and used into controlling s toy car that has a IR receiver to control it. in this step you will need a LED to get this working and the kit.
Wire your IR receiver as shown below and add LED on Digital pin 13 and upload the following code onto your Arduino UNO board and press Button 1 to turn the LED on and press Button 2 to turn LED off.
Code
Now, grab the codes you captured in the previous step. You need to convert your codes from hex to decimal.
For that, you can use the following website: www.binaryhexconverter.com/hex-to-decimal-converter.
Here’s a conversion example for one of my codes:
Repeat that process to all your hex values and save the decimal values. These are the ones you need to replace in the code below.
Copy the following sketch to your Arduino IDE. Write your own decimal values in the sketch provided in the case lines and upload it to your Arduino board. Make sure that you have the right board and COM port selected.
#include <IRremote.h>
int IR_Recv = 11; //IR Receiver Pin 11
int bluePin = 13;
IRrecv irrecv(IR_Recv);
decode_results results;
void setup(){
Serial.begin(9600); //starts serial communication
irrecv.enableIRIn(); // Starts the receiver
pinMode(bluePin, OUTPUT); // sets the digital pin as output
}
void loop(){
//decodes the infrared input
if (irrecv.decode(&results)){
long int decCode = results.value;
Serial.println(results.value);
//switch case to use the selected remote control button
switch (results.value){
case 16753245: //when you press the 1 button
digitalWrite(bluePin, HIGH);
break;
case 16736925: //when you press the 4 button
digitalWrite(bluePin, LOW);
break;
}
irrecv.resume(); // Receives the next value from the button you press
}
delay(10);
}
Demonstration
In the end you can control LED individually using the buttons of your remote control. This is a great project to learn about the IR receiver. There are endless possibilities for what you can do with it. For example, you can replace that LED with a relay to control your house appliances.