- Step 1: Assemble Circuit
- Step 2: Download IR Library
- Step 3: Add Library to Sketch
- Step 4: Paste Code and Compile
- Step 5: Open the Serial Monitor
- Step 6: Record Button Codes
- Step 7: Works on Any Remote!
- 12 People Made This Project!
- 137 Comments
It is really easy to control an Arduino using an infrared remote. There is one particular remote that is available from multiple sources and is really quite cheap, they look and operate in a very similar way.
NEOMART Raspberry Pi HX1838 Infrared Remote Control Ir Receiver Module DIY Kit. Amazon
Kootek Raspberry Pi Infrared Remote Control Ir Receiver Module DIY Kit. Amazon
KIT,IR REMOTE,IR RECIVER,ARDUI,COMPATIBLE Jameco
The problem is that documentation seems to be scarce for these particular remotes. Here is how I figured out how to use them.
Step 1: Assemble Circuit
You will need one Arduino for this. I used a UNO, but just about any Arduino should work. First wire up the infrared receiver that came with your kit. There are 3 wires, PWR, GND, and SIG, I used port 11 for SIG. Note! some readers have reported that their sensor has different wiring, double check it yourself.
Step 2: Download IR Library
In order to reverse engineer the remote and obtain the codes for each button we are going to need to download and install the following library.
Extract the file in your libraries directory. e.g. ( C:\electronics\arduino-1.0.5\libraries )
note: I had to rename the library because the name was too long, I just renamed it to IR.
Step 3: Add Library to Sketch
With the IR folder ( or whatever you named it) now in your libraries directory, we can import it into a new sketch.
Start a new sketch and the Click
Step 4: Paste Code and Compile
Paste the following code into the new sketch. Then verify it compiles.
Step 5: Open the Serial Monitor
Connect the Arduino to your computer using the usb port, then upload the sketch. Open up the Serial Monitor, get the remote and press the buttons. Some hex codes should appear on the Serial Monitor.
Step 6: Record Button Codes
Here are the codes that I got for the white remote. FFFFFF is a repeat command, you’ll get a stream of them if you hold down a button.
and here are the codes I got from the black remote.
Step 7: Works on Any Remote!
Now go grab a bunch or remotes from around the house, and give those a try! I got a direct-tv remote and the smartphone pod/remote for a Helo TC remote controlled helicopter. This circuit showed the code for both of these remotes.
Here is the project that inspired me to write this up!
12 People Made This Project!
Did you make this project? Share it with us!
3D Printed Student Design Challenge
Made with Math Contest
Question 4 months ago
i did t get any numbers throw serial monitor
Question 8 months ago on Step 7
const int RECV_PIN = 13;
if (irrecv.decode())< // I removed the parameter results
Serial.println(results.value, HEX); // Receive the next value in HEX. Like [FFFTTG]irrecv.resume(); // Receive the next value
Pls, i want solution from someone here.
I was using compaq laptop window7 programming with Arduino successfully. I changed PC to HP which i’m coding with, but the Serial monitor in Arduino Ide is not reading real Remote button value. I installed(CH34x_Install_Windows_v3_4) (Arduino IDE 1.8.0, 1.8.1, 1.8.13.)
Below is code: