
You use IR remote controls to make arduino projects simple and fun. IR technology helps you control things at home. You can build your own remotes or read signals from other remotes. With arduino infrared remote systems, you can make new ways to control devices. You can also create your own special remotes. The Arduino IR remote setup is an easy way to add wireless control to your projects.
Application Type | Description |
|---|---|
Controlling Home Appliances | Use IR remotes for TVs and other things at home. |
Custom Remote Controls | Make remotes to control many devices more easily. |
Decoding Signals | Use signals again to control new devices. |
Building Custom Controls | Make controls for special needs in arduino infrared remote work. |
You can start by wiring a basic IR receiver. Then you can try new ideas for arduino infrared remote control.
IR Communication Basics
What is IR?
IR lets devices send signals to each other. IR means infrared, which is a kind of light we cannot see. IR communication uses this invisible light to send information. Remote controls and receivers use IR LEDs and sensors for this. There are two main ways IR works: point-to-point and diffuse. Point-to-point needs the remote to face the receiver. Diffuse lets devices talk without a direct line. IR works in a frequency range from 300 GHz to 400 THz. You can find IR in things like TVs, headphones, and home security systems.
Tip: IR signals do not go through solid things. Make sure nothing blocks the path between your remote and receiver.
IR communication uses pulses of infrared light.
IR signals work best with nothing in the way.
IR technology is used in many home electronics.
IR Remote and IR Receiver
You need both an IR remote and an IR receiver to use IR. The remote sends data as pulses of infrared light. The receiver gets these pulses and decodes them. For Arduino IR projects, you often use a SunFounder Uno board, USB cable, infrared-receiver module, remote controller, and a 3-pin cable.
Component | Function |
|---|---|
IR Remote | Sends infrared signals |
IR Receiver Module | Gets and decodes signals |
Arduino Board | Handles the received data |
IR remotes use special encoding methods called Consumer IR. These methods send commands slowly, up to 32 bits at 4000 bits per second. The receiver checks how long the IR light pulses and spaces last. Modulation at 38 kHz helps the receiver ignore other lights.
IR Protocols
You use protocols to control devices with IR. Protocols are rules for sending and reading IR signals. The NEC protocol is very common in electronics. Other popular protocols are JVC, Sony SIRC, Philips RC5, and RC6. These protocols use a 38 kHz carrier wave to send binary signals.
NEC Remote Protocol
RC5 Remote Protocol
JVC Protocol
Sony SIRC Protocol
Philips RC6 Protocol
Each button on your IR remote sends its own code. The receiver matches the code to a command. Protocols and encoding make sure every button does something different. This gives you accurate control because each code is special.
Arduino IR Remote Setup

IR Receiver Pinout
You need to know the pinout before you start the arduino ir remote setup. Most IR receivers have three pins. Each pin has a special job. You must connect each pin to the right spot on your arduino board. This helps your setup work well.
IR Receiver Pin | Arduino Pin |
|---|---|
– | GND |
+ (middle pin) | 5V |
S | Digital Pin 11 |
The minus pin goes to GND. The plus pin connects to 5V. The signal pin links to a digital pin, often pin 11. Always check your IR receiver’s datasheet. Some receivers use different pin names, but most follow this pattern.
Wiring to Arduino
You must wire your IR receiver to your arduino for a working arduino ir remote setup. Use jumper wires for easy setup. Make sure you connect the receiver to the right pins. This step is key for good hardware connections.
IR receiver | Arduino |
|---|---|
OUT (left) | Pin 2 |
GND (middle) | GND (-) |
Vcc (right) | 5 V (+) |
Follow these steps for your setup:
Place the IR receiver on your breadboard.
Connect the OUT pin to digital pin 2 on your arduino.
Attach the GND pin to the GND on your board.
Link the Vcc pin to the 5V pin.
Tip: Double-check each wire before you power up your setup. A wrong connection can stop your arduino ir remote setup from working.
Hardware Check
After you connect the receiver, you need to check your setup. Make sure each wire is tight. Look for loose wires or bent pins. Your arduino ir remote setup needs solid hardware connections. If you see blinking lights on your receiver, your setup works. If not, check your wiring again.
You can use a multimeter to test voltage at the receiver. The 5V pin should show close to 5 volts. The GND pin should read zero. The signal pin should change when you press buttons on your ir remote. This means your setup is ready for the next step.
Programming Arduino and Reading Codes
Install IRremote Library
You need the IRremote library to program your ir receiver. This library helps you read signals from your remote. To install it, follow these steps: Open the Arduino IDE. Go to Sketch, then Include Library, then Manage Libraries. Search for ‘Arduino-IRremote’ in the Library Manager. Click install.
If you see errors like ‘TCCR2B was not declared’ or relocation errors, you might have a chip mismatch. These problems happen with Attiny microcontrollers. You can fix them by using Arduino IDE version 1.0.5. Make sure the library files are in the right folder.
After you install the library, you can start programming your ir receiver. The IRremote library has examples to help you read codes and control devices.
Read IR Codes
You can use IRremote library examples to read codes from your remote. Open the “IRrecvDemo” example sketch. Upload it to your arduino. Connect your ir receiver to the board. Open the Serial Monitor in Arduino IDE.
When you press a button on your remote, the ir receiver gets the signal. The arduino decodes the signal and shows codes in hexadecimal format. Press each button to find its code. Write down the codes so you can use them later.
Tip: To record codes for all buttons, press each button and note the codes in the Serial Monitor. This helps you find the codes for your remote.
You may want to know which protocol your remote uses. You can do this in different ways: Use an oscilloscope to look at the signal. Use your ir receiver with arduino to decode the protocol. Try encoding methods like Pulse Width Modulation or Bi-Phase encoding.
The IRremote library examples often show the protocol name with the codes. This helps you match codes to the right protocol.
Map Codes to Actions
After you find the codes for your remote, you can map them to actions in your arduino sketch. Use IRremote library examples to control LEDs, motors, or other devices. Upload your code to the arduino. Open the Serial Monitor. Point your remote at the ir receiver and press buttons. The arduino reads the codes and does the actions you set.
You can use ir key codes to control outputs. For example, turn on an LED with one button. Turn it off with another button. You can also use codes to control motors or relays. Set actions in your sketch for each code you want to use.
Capture the codes for each button.
Use the codes in your arduino sketch to control outputs.
Set up functions for each code to make custom remote controls.
Try different examples to learn how to use codes for many devices.
You can try mapping codes to new actions. This lets you build custom controls for your projects. If you want codes for a new remote, repeat the process and update your sketch. Programming the ir receiver with arduino gives you many ways to use wireless control.
Control Outputs with IR Remote
LEDs and Devices
You can use the ir remote to make your arduino control things. The most common things you control are LEDs and home devices. First, set up the ir receiver and connect it to your arduino. Each button on the remote sends its own signal. Your arduino reads these signals and controls what you want.
LEDs
Appliances
Many devices you can control without wires
You can turn on more than one LED at the same time. In your code, pick which pins go to each LED. Use switch cases to match each button to a certain LED or device. When you press a button, the arduino turns the output on or off.
Tip: You can use the ir remote to control lights, fans, or other things without wires.
Here is a simple code example for controlling several LEDs:
#include <IRremote.h>
int IR_Recv = 3;
int ledPins[] = {5, 6, 9, 10};
void setup() {
for (int i = 0; i < 4; i++) {
pinMode(ledPins[i], OUTPUT);
}
IrReceiver.begin(IR_Recv, ENABLE_LED_FEEDBACK);
}
void loop() {
if (IrReceiver.decode()) {
switch (IrReceiver.decodedIRData.command) {
case 0x10: digitalWrite(ledPins[0], HIGH); break;
case 0x11: digitalWrite(ledPins[1], HIGH); break;
case 0x12: digitalWrite(ledPins[2], HIGH); break;
case 0x13: digitalWrite(ledPins[3], HIGH); break;
}
IrReceiver.resume();
}
}
You can change the pin numbers and codes to fit your project. This way works with any remote.
Customizing for Different Remotes
You might want to use different kinds of ir remotes. You need to change your arduino code a little. First, find out which ir protocol your remote uses. Write down the commands for each button. Look at the signals for each job and keep notes. Change one thing at a time and write down what happens.
Find out the ir protocol for your remote.
Write down the commands for every button.
Check and keep notes for each signal and job.
Change one thing at a time and record what happens.
With the ir remote, you can change your arduino project for many remotes. This lets you control lots of things. You can use any remote by updating your code with new commands and protocols.
Troubleshooting IR Receiver and Codes

Hardware Issues
You may face problems with your ir receiver setup. Hardware issues often stop your arduino project from working. You can check the ir LED using a cell phone camera. The camera can see the light that your eyes cannot. If you do not see any light, try reversing the LED’s orientation. Sometimes, the LED faces the wrong way. Point a TV remote at the receiver and watch the status LED. If it flashes, your receiver gets the signal. If the status LED stays on when you break the beam, block the ir signal and see if the receiver reacts.
Loose wires or bent pins can cause trouble. Make sure the detector connects to the arduino correctly. Use a multimeter to check voltage at the receiver pins. The GND pin should read zero. The 5V pin should show close to five volts. The signal pin should change when you press buttons on the remote. If you see no change, check your wiring again.
Tip: Test your system in a shaded area. Direct sunlight or strong lights can disrupt the ir receiver. You get better results indoors or in low light.
Use a cell phone camera to check the ir LED.
Reverse the LED if it does not light up.
Point a TV remote at the receiver and watch for flashes.
Make sure the detector wires connect to the arduino.
Block the ir signal and check the status LED.
Test voltage at the receiver pins.
Software and Signal Problems
Software problems can stop your ir receiver from working. You may choose between IRremote or IRLib libraries for sending and reading ir signals. Try all example sketches from these libraries. Testing examples helps you find problems with your receiver or remote. Sometimes, the receiver cannot decode signals from certain remotes. Check if your library supports your remote’s protocol.
Ambient light or other ir sources can interfere with your receiver. Hardware filters help reduce unwanted light. Position the receiver away from bright lights. Test your system in a dark room to see if the receiver works better. If you still have problems, check for other ir sources nearby.
Try different libraries like IRremote or IRLib.
Test all example sketches to find software issues.
Check if your receiver decodes signals from your remote.
Use hardware filters to block unwanted light.
Move the receiver away from bright lights.
Test in a dark room for better performance.
Look for other ir sources that may cause interference.
Note: Decoding many types of ir remote signals helps you find compatibility problems. Always record the codes for each button and match them to the right action in your arduino sketch.
You learned how to use an arduino with an IR remote. Here are steps to help you:
Install the IRremote library. Connect your IR sensor to the right pins.
Use example code to get signals from your remote. Watch the output on your monitor.
Match each button on your remote to a control action in your project.
Try different remotes to make your control better and fix problems.
If you need help, look at these community resources:
Discussion Title | Description |
|---|---|
Help | Ask questions about IR remote problems. |
How do I interpret the raw data from the monitor for IR codes? | Learn how to read and use IR code data. |
sendSamsungLG() does not work with my LG HX906 | Find answers for device compatibility issues. |
ESP32 problem with channel 0 already used for display | Get tips for ESP32 and IR remote problems. |
bootloop | See if others have the same IR remote problems. |
Troubleshooting is part of learning. Try new ways to control things and test different remotes.
FAQ
How do you know if your IR receiver works?
You can check your IR receiver by pointing a remote at it and watching for a blinking LED. If you see flashes when you press buttons, your receiver gets signals. You can also use a phone camera to see the IR light.
Why does your arduino not read any IR codes?
You may have a wiring problem or a library issue. Check all connections and make sure you use the right pins. Install the IRremote library. Try example sketches to test your setup. Make sure your arduino board gets power.
Can you use any remote with your arduino IR receiver?
Most IR receivers work with many remotes. You need to find the codes for each button. Some remotes use special protocols. Test your remote with the IRremote library. Write down the codes and match them to actions in your sketch.
What should you do if your IR signals do not reach the receiver?
Move objects away from the path between your remote and receiver. IR signals need a clear line. Try using your setup in a room with less sunlight. Check if your receiver faces the remote directly.
How do you control more than one device with your arduino IR remote?
You can map different codes to different outputs in your sketch. Use switch cases for each button code. Connect more devices to your arduino and set actions for each one. Test each button to make sure it works.



