// frequently asked

ESP32 FAQ: Questions, Answered.

103 questions across every ESP32 topic. Pick one on the left — the answer loads right here.

FAQ › GPIO & Signals › ESP32 RMT and IR Control
// rmt · infrared · faq

ESP32 RMT and IR Control

Filed under: ESP32 · RMT · Infrared · Updated August 2026

The ESP32 RMT peripheral is the closest thing to a universal remote on a chip — it sends and receives IR pulses with hardware timing, so your CPU never has to watch the clock.

How to Use RMT in an ESP32 with IR Controller?

Two layers: the RMT peripheral does the pulse timing; a library maps it to real remotes. The fastest path is IRremoteESP8266 — despite the name it runs on ESP32 — where sending an NEC code is one call:

IRsend irsend(4);
irsend.sendNEC(0x00FF30CF, 32);

Receiving is equally short: IRrecv on another pin. You never touch RMT registers directly — the ESP-IDF RMT API was rewritten between major versions and half the forum examples are stale. The under-the-hood FAQ explains what the peripheral does underneath.

What Is the RMT Peripheral?

RMT stands for Remote Control — a hardware block that measures and generates pulse trains with 12.5ns ticks (80MHz clock), independent of the CPU. Built for IR, it is also why the ESP32 is good at WS2812 strips and servo work: any signal that's pulses with specific widths fits RMT.

Do I Need RMT to Send IR?

Not strictly — you can bit-bang the pulses in software, and it works until WiFi interrupts your timing and the TV stops decoding. That is the whole point of RMT: the pulse train continues while the CPU is busy. Bit-bang for a one-off, RMT for anything that must work tomorrow.

How to Receive IR with RMT?

Wire an ESP32 IR receiver module — a TSOP38238 or similar, three wires, 3.3V, output to a free GPIO — then IRrecv irrecv(15) and irrecv.decode(&results) in loop(). The module strips the 38kHz carrier and hands the ESP32 the raw pulse widths, which RMT times precisely.

What IR Protocols Are Supported?

Everything common: NEC, Sony SIRC, RC-5, RC-6, Samsung, Panasonic, JVC, plus raw pulse dumps — about a hundred protocols in IRremoteESP8266's table. NEC alone covers half the remotes on Earth. Unknown remote? Capture it raw and replay it — protocol names stop mattering.

Why Does My IR Setup Not Work?

Check the carrier frequency first — receivers come in 36, 38, and 40kHz variants and are not interchangeable. Then the transmitter: a GPIO pin at 3.3V with 12mA max barely lights an IR LED. I got 20cm of range driving the LED straight from a pin; through a transistor at 5V with a 100Ω series resistor, the same LED reached across the room. The debugging FAQ has the rest.

How Do I Send Raw IR Codes?

Capture with IRrecv, then replay with irsend.sendRaw() using the recorded pulse array — no decoding required. This is the fallback for unknown remotes; recorded widths replay at the same tick precision. Repeat frames need care: replay exactly what you captured, frame count included.

How Many RMT Channels Does My ESP32 Have?

It depends on your chip: classic ESP32 has 8 channels, the S3 has 8, the S2 has 4, and the C3 has 2 — each usable as TX or RX. IR projects rarely need more than two, the limit only bites if you also drive LED strips from RMT on a C3. Check the datasheet row for your exact chip.

What Is the 38kHz Carrier and Why Do I Need It?

The IR LED blinks at 38kHz — invisible to the eye — and the receiver demodulates that to logic levels. The carrier separates a real remote from a warm light bulb; ambient infrared would otherwise swamp the signal. LED and receiver must share a frequency. The LED is a 940nm near-infrared diode, like every remote.

Can I Practice IR Projects Without Hardware?

Yes — write and run the protocol logic in the free browser simulator, then flash the same sketch to a real board. NEC encoding, pulse handling, and repeat logic are all testable before any component arrives.

Still stuck? A real engineer answers — usually within a day.

Email support →