IR
Interfacing IR Transmit Kit with ESP32
What is the IR Transmit Kit?
A matched infrared LED and receiver pair used for building custom remote controls or simple line-of-sight communication links. The transmitter side is a standard IR LED driven with modulated pulses (typically 38kHz carrier) to encode a signal, while the receiver is a demodulating IR photodiode module (like the TSOP1738) that filters out ambient IR noise and outputs a clean digital signal a microcontroller can decode — the standard building block for replicating TV/appliance remote codes or sending simple short-range wireless signals between two line-of-sight devices.
Specifications
| Transmitter | Standard 5mm IR LED, typically driven at 38kHz carrier frequency to match common receiver modules |
| Transmitter operating voltage | Driven from a digital GPIO pin (often through a transistor for higher current) at 3.3-5V logic levels |
| Receiver | IR demodulator module (e.g. TSOP1738/TSOP4838) tuned to a specific carrier frequency (commonly 38kHz) |
| Receiver operating voltage | 3.3V-5V DC depending on module |
| Range | ~5-10m line-of-sight typical for basic remote-control style use, shorter in bright ambient IR conditions (e.g. direct sunlight) |
| Protocols | Commonly used with NEC, Sony SIRC, RC5, or raw pulse-timing protocols depending on the library/firmware used |
| Interface | Transmitter: single digital output pin (often via a transistor driver for brighter/longer-range LEDs). Receiver: single digital input pin |
IR Transmit Kit Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | IR LED anode | Connect through a current-limiting resistor (and optionally a transistor for higher drive current) to a digital output pin |
| 2 | IR LED cathode | Connect to ground (or transistor collector/drain if using a driver transistor) |
| 3 | Receiver VCC | Power, 3.3-5V DC depending on receiver module |
| 4 | Receiver GND | Ground |
| 5 | Receiver OUT | Demodulated digital signal output — connect to a digital input pin, typically read with an IR-remote decoding library |
For reliable transmission range beyond a few centimeters, drive the IR LED through a small NPN transistor rather than directly from a GPIO pin, since a microcontroller pin usually can't source enough current for a bright, long-range IR burst; libraries like IRremote handle both the 38kHz carrier modulation on transmit and automatic demodulation-aware decoding on receive.
Setting Up IR Transmit Kit with ESP32
Library
IRremote by Armin Joachimsmeyer
Arduino IDE → Tools → Manage Libraries → search "IRremote"
Wiring
| Component pin | ESP32 pin | Note |
|---|---|---|
| IR LED anode | GPIO4 (via 100Ω resistor; add a transistor driver stage for longer range) | Direct GPIO drive works for short range |
| IR LED cathode | GND | — |
| Receiver VCC | 3.3V | — |
| Receiver GND | GND | — |
| Receiver OUT | GPIO15 | — |
Example code
IRremote's send and receive pins must be different GPIOs. Sending and receiving on the same board is mainly for testing round-trip decoding -- typical real use has one board sending and a separate one receiving.
Related Guides & Projects

ESP32-CAM Web Server: Stream Live Video in 5 Minutes
A complete, no-guesswork walkthrough for flashing an AI-Thinker ESP32-CAM as a live MJPEG video stream -- wiring, Arduino IDE setup, the CameraWebServer sketch, and every failure mode that actually causes problems.

ESP32 MQTT Tutorial: Publish and Subscribe with Arduino IDE
A complete, broker-agnostic ESP32 MQTT tutorial -- topics, QoS, retained messages, Last Will and Testament, TLS security for production, and a working publish/subscribe example with PubSubClient.

Installing ESP8266 in Arduino IDE: NodeMCU (ESP-12E) Complete Setup Guide for Windows
From driver headaches to a blinking LED — the full Windows walkthrough for getting NodeMCU ESP8266 boards running in Arduino IDE, plus notes for Mac and the bare ESP-01 module.

ESP32 Pinout Guide: Every GPIO, ADC, PWM, and Restricted Pin Explained
Complete ESP32 pinout guide covering all GPIOs, input-only pins, strapping pins, flash-reserved pins, dual ADC channels, PWM via LEDC, I2C, SPI, UART, and deep sleep wake pins.