IR Remote Cloner
A pocket-sized remote with four buttons. Hold Learn, press a button, point your old remote at it, and it copies that signal. Then it replays it whenever you press the button.
“Build me a small handheld device that can learn the buttons from my TV remote and replay them.”
Spec
IR Remote Cloner
A pocket-sized remote that learns up to four buttons from any infrared remote and replays them on demand.
- Power
- Rechargeable 500 mAh LiPo, charges over USB-C
- Size
- About 74 × 44 × 20 mm, fits in one hand
- Inputs
- 4 slot buttons, Learn button, IR receiver (38 kHz)
- Outputs
- 2 × 940 nm IR LEDs, RGB status LED
- Connectivity
- USB-C for charging and firmware updates, Wi-Fi/Bluetooth capable (unused in v1)
- Budget
- Under $25 in parts
Constraints
- Infrared only: works with standard TV and AV remotes
- Board arrives assembled, no fine-pitch hand soldering
- Enclosure prints in PLA or PETG without supports
Why
Infrared, not radio
TV remotes almost all use infrared light at 38 kHz, so the device needs an IR receiver to listen and IR LEDs to talk. No radio parts are needed for this.
Why
Four buttons plus a Learn button
You asked for four commands. A separate Learn button keeps everyday use simple: just press a button to send, and only hold Learn when you want to copy a new code.
Why
A small rechargeable battery
A 500 mAh LiPo is thin enough to sit under the board and lasts months of normal use because the device sleeps between presses.
Circuit board
Why
ESP32-C3 as the brain
I picked an ESP32-C3 because it has built-in Wi-Fi and Bluetooth for a future phone app, native USB so you don't need a separate USB-to-serial chip, and enough pins for the IR LEDs, the receiver, five buttons and a status light. It costs about $3.
Why
A transistor drives the IR LEDs
A chip pin can only supply about 20 mA safely, but IR LEDs need around 100 mA pulses to reach across a living room. Q1 (an AO3400A) switches battery current through both LEDs, and R1 (10 Ω) limits each pulse to about 100 mA.
Why
A 38 kHz receiver up front
The TSOP38238 matches the 38 kHz signal most TV remotes use and filters out room light, so the firmware only has to read on/off timings. It sits between the two LEDs, facing forward like a normal remote.
Why
Safe charging from any USB-C charger
The MCP73831 charges the battery at 250 mA, which is gentle for a 500 mAh cell. Two 5.1 kΩ resistors on the USB-C CC pins let any USB-C charger know it may supply power. The AP2112K regulator gives the chip a steady 3.3 V.
Firmware
// IR Remote Cloner — learns buttons from an infrared remote and replays them.
//
// How to use it:
// 1. Hold LEARN and press a slot button (1-4). The LED pulses blue.
// 2. Point your TV remote at the front and press the button to copy.
// Green flash = saved. Red = nothing received within 10 seconds.
// 3. Press the slot button any time to send that code.
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#include "esp_sleep.h"
#include "driver/gpio.h"
#define RAW_BUFFER_LENGTH 200 // Enough for long air-conditioner codes
#define DECODE_NEC
#define DECODE_SONY
#define DECODE_RC5
#define DECODE_RC6
#define DECODE_SAMSUNG
#define DECODE_PANASONIC
#define DECODE_DISTANCE_WIDTH // Catch-all for many other remotes
#include <IRremote.hpp>
#include "pins.h"
#include "slot_store.h"
namespace {
5 files: src/main.cpp, include/pins.h, include/slot_store.h, platformio.ini, README.md
Why
Arduino with the IRremote library
IRremote is widely used and well tested. It decodes common remote formats (NEC, Sony, RC5, Samsung) and can also record raw timings for remotes it doesn't recognise, so almost any remote works.
Why
Pins come straight from the board
pins.h was generated from the circuit board's pin map: IR receiver on GPIO4, IR LED driver on GPIO5, buttons on GPIO6, 7, 10, 1 and 9. Change the board and this file is regenerated, so the two never drift apart.
Why
Learned codes are saved to flash
Codes are stored with the ESP32's Preferences library, so they survive a dead battery or a reset. Each slot holds either a decoded code or the raw timings.
Why
Sleeps between presses
After 30 seconds idle the chip enters light sleep and wakes the moment any button is pressed. That stretches the battery to months instead of days.
Enclosure
- Outer size
- 74 × 44 × 20 mm
- Material
- PETG, 0.2 mm layers
- Print time
- 2 h 10 min, no supports
Why
Shell sized around the board
The board is 64 × 34 mm. I added 2 mm of clearance and 2.4 mm walls on every side, giving a 74 × 44 × 20 mm case with 8 mm rounded corners so it sits comfortably in your hand.
Why
A clear window for the IR parts
The front wall has an opening in front of the two IR LEDs and the receiver, because even thin plastic blocks a surprising amount of infrared light.
Why
Prints without supports
The case splits at the board line into a base and a lid. Each half prints flat side down with no supports. Four M2 screws go into the board's mounting holes, and the halves snap together.
Why
Button caps line up with the switches
Each cap sits directly over its switch with 0.3 mm of play, so presses feel crisp without the caps rattling.
Assembly
- 1Plug the battery into J2 and lay it in the base, label side down.
- 2Drop the board onto the four standoffs and fasten with M2 × 4 mm screws.
- 3Press the five button caps into the lid from the inside.
- 4Snap the lid onto the base, starting at the USB-C end.
- 5Flash the firmware over USB-C and teach it your first button.
Why
Everything fits
The tallest part (the IR receiver) clears the lid by 1.8 mm. The USB-C port lines up with the rear opening within 0.3 mm.
Why
Five steps, one screwdriver
Assembly needs only a small Phillips screwdriver. The battery plugs in with a connector, so there's no soldering at home.
See every stage run, step by step
The workspace shows each engine working, with approval checkpoints in between.