IR
Interfacing TSOP1738 IR with ESP32
What is the TSOP1738?
A demodulating IR receiver tuned to 38kHz, used to decode signals from standard infrared remote controls. Rather than just detecting raw infrared light, the TSOP1738 internally filters and demodulates the 38kHz-modulated carrier that virtually all consumer IR remotes use, rejecting ambient light noise and outputting a clean digital pulse train that directly matches the original transmitted code — making it the standard receiver for universal remote clone projects, IR-controlled robots, or capturing existing remote codes for later playback.
Specifications
| Sensor type | TSOP1738 demodulating infrared receiver, tuned to a 38kHz carrier frequency |
| Operating voltage | 2.5V–5.5V DC |
| Operating current | ~1.5 mA typical, low standby current |
| Carrier frequency | 38kHz (matches the vast majority of consumer IR remote controls) |
| Output | Active-LOW demodulated digital signal — pulses LOW when a matching 38kHz-modulated IR signal is received |
| Range | ~10-15m typical for standard remote-control transmission power |
| Ambient light rejection | Built-in filtering rejects sunlight and normal indoor lighting noise that would otherwise interfere with detection |
| Interface | Single digital output pin, typically read using an IR-remote decoding library (e.g. IRremote) |
TSOP1738 Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | OUT | Demodulated digital signal output, active LOW — connect to a digital input pin |
| 2 | GND | Ground |
| 3 | VCC | Power, 2.5–5.5V DC |
Add a small decoupling capacitor (e.g. 10-100µF) across VCC and GND close to the sensor if experiencing unreliable readings, since the internal AGC circuit can be sensitive to power supply noise; libraries like IRremote handle the pulse-timing decode automatically once wired to a digital input pin. Confirm the carrier frequency matches your target remote — 38kHz covers most consumer electronics, but a few remotes (particularly some Japanese TV brands) use 36kHz or 40kHz and need a differently-tuned TSOP variant.
Setting Up TSOP1738 with ESP32
Library
IRremote by Armin Joachimsmeyer
Arduino IDE → Tools → Manage Libraries → search "IRremote"
Wiring
| Component pin | ESP32 pin | Note |
|---|---|---|
| VCC | 3.3V | — |
| GND | GND | — |
| OUT | GPIO15 | Any interrupt-capable GPIO works; avoid strapping pins (0, 2, 12) to prevent boot issues |
Example code
TSOP1738 is tuned for a 38kHz carrier -- works with most consumer IR remotes. IRremote v3+ uses the IrReceiver object shown here; older sketches written against IRrecv/decode_results need updating.
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.