What you can build with Arduino and infrared
An Arduino remote control uses an infrared LED to send signals to devices that accept IR commands — televisions, stereos, air conditioners, and other appliances. The Arduino board acts as the brain, the infrared LED acts as the transmitter, and a simple circuit connects them together. You write code that tells the Arduino which infrared pattern to send when you press a button, then upload that code to the board.
This is different from buying a universal remote. You are building the hardware and writing the instructions yourself, which means you can control any device that uses infrared, customize the button layout, and add features a commercial remote does not have — like controlling multiple devices from one remote, or triggering sequences of commands with a single button press.
Key Takeaways
- You will need an Arduino board (Uno or Nano), an infrared LED, a resistor, buttons, and a breadboard to wire them together.
- The infrared LED sends invisible light pulses that mimic the signals from a real remote, and the Arduino controls the timing and pattern of those pulses.
- You write code in the Arduino IDE that maps each button to a specific infrared code, then upload it to the board.
- Most household appliances use one of a few standard infrared protocols, and libraries exist that handle the technical details of those protocols.
The hardware you need to gather
Start with an Arduino Uno or Arduino Nano. The Uno is larger and easier to work with if this is your first project; the Nano is smaller and fits into tighter spaces. Both cost between $20 and $30 from electronics retailers like Adafruit, SparkFun, or Amazon.
You will also need an infrared LED (usually 940 nanometers wavelength), a 220-ohm resistor to protect the LED, a breadboard to wire everything together without soldering, jumper wires, and pushbuttons — one for each command you want to send. A basic kit with most of these parts costs $15 to $25. You may already have some of these items if you have done other Arduino projects.
Optional but useful: a 9V battery and connector to power the Arduino without a USB cable, and an infrared receiver module (like a TSOP4838) if you want to record codes from an existing remote instead of looking them up.
How to wire the circuit
The infrared LED connects to a digital pin on the Arduino through the 220-ohm resistor. The resistor goes between the Arduino pin and the positive (longer) leg of the LED. The negative (shorter) leg of the LED connects to ground. This protects the LED from drawing too much current and burning out.
Each pushbutton connects between a digital pin and ground. When you press the button, it pulls that pin to ground, and the Arduino detects the change. You can wire multiple buttons to different pins — a typical remote might use pins 2 through 5 for four different commands.
The breadboard holds all these connections in place. Plug the Arduino into one end, the LED and resistor into the middle section, and the buttons along the side. Jumper wires connect everything. If you are new to breadboards, the holes in each row are electrically connected horizontally, so components plugged into the same row are wired together.
Writing and uploading the code
Download the Arduino IDE (free, from arduino.cc) and install the IRremote library by Ken Shirriff. In the IDE, go to Sketch > Include Library > Manage Libraries, search for "IRremote", and install the version by Arduino. This library handles the timing and protocol details of infrared signals.
Write code that defines which pin the LED is on, which pins the buttons are on, and what infrared code to send for each button. A basic structure looks like this: set up the pins in the setup() function, then in the loop() function, check if a button is pressed, and if it is, send the corresponding infrared code using the library's send function.
You need the actual infrared codes for the device you want to control. For common devices like televisions, these codes are published online and in databases. If you have an existing remote, you can use an infrared receiver to record the codes it sends, then use those codes in your Arduino sketch. Upload the code to the Arduino using the USB cable and the IDE's Upload button.
Finding the infrared codes for your device
Most televisions, air conditioners, and stereos use one of a few standard protocols — NEC, Sony SIRC, or Philips RC5. The IRremote library supports all of these. If you know the brand and model of the device you want to control, search online for "infrared codes [brand] [model]" and you will often find a list of hex codes for each button.
If the codes are not published, use an infrared receiver module to record them from an existing remote. Wire the receiver to the Arduino, run a sketch that reads and prints the codes, then press each button on the original remote and note the codes it sends. This takes a few minutes but gives you the exact codes your device expects.
Some devices use proprietary or undocumented codes. In those cases, you may need to reverse-engineer the protocol by recording many button presses and looking for patterns, or you may find the codes in forums where other people have done this work.
Testing and troubleshooting
Point the infrared LED at the device you want to control and press a button on your Arduino remote. If nothing happens, check that the LED is actually lighting up — it emits infrared light you cannot see with your eyes, but a smartphone camera can often see it. Open the camera app, point it at the LED, and press a button. If you see a bright spot on the phone screen, the LED is working and the problem is likely the infrared code or the device settings.
If the LED does not light up at all, check the wiring: make sure the resistor is in series with the LED, the negative leg of the LED is connected to ground, and the positive leg connects to the Arduino pin through the resistor. Check the code to make sure you specified the correct pin number. If a button does not work but others do, the infrared code for that button may be wrong — double-check it against your source.
Some devices require the infrared signal to be repeated multiple times. If a single button press does not trigger the device, modify the code to send the signal three or four times in quick succession. The IRremote library has a function for this.
Expanding your remote with more features
Once the basic remote works, you can add complexity. Wire a potentiometer (variable resistor) to an analog pin and use it to control volume or brightness by sending multiple commands in sequence. Add an LCD screen to display which device or command is selected. Wire an infrared receiver so the remote can learn codes from other remotes by recording them.
You can also program combinations: one button that sends "power on" followed by "input HDMI" followed by "volume up" three times. This is useful for devices that require a sequence of commands to reach a specific state. The Arduino can send these commands with delays between them using the delay() function.
Frequently Asked Questions
Can I control multiple devices with one Arduino remote?
Yes. Wire multiple infrared LEDs to different pins, or use a single LED and switch which device it targets based on a button press or menu selection. You can also use different infrared protocols for different devices if needed — the IRremote library supports several.
How far away does the remote have to be from the device?
Most infrared remotes work from 10 to 30 feet away, depending on the LED brightness and the receiver sensitivity. A standard infrared LED on an Arduino typically works from 10 to 15 feet. You can increase range by using a brighter LED or adding a lens, but this requires more power and more complex wiring.
What if the device I want to control uses radio frequency instead of infrared?
Radio frequency remotes use a different technology and require a radio transmitter module instead of an infrared LED. The Arduino can control RF modules, but you will need different hardware and different code. Infrared is more common for household devices.
Do I need to solder anything?
No. A breadboard and jumper wires let you build the circuit without soldering. If you want a permanent remote, you can solder the components to a circuit board later, but breadboards are fine for testing and learning.
Can I power the Arduino with a battery instead of USB?
Yes. Connect a 9V battery to the power and ground pins using a battery connector, or use four AA batteries in a holder for 6V. The Arduino can run on anything from 5V to 12V. A battery makes the remote truly portable.