IR Receiver (TSOP4838) with an ESP32 DevKit V1

A TSOP4838 infrared receiver module that demodulates 38 kHz remote-control signals into a clean digital output.

IR Receiver (TSOP4838), A TSOP4838 infrared receiver module that demodulates 38 kHz remote-control signals into a clean digital output.
In short

The TSOP4838 runs from the ESP32 DevKit V1's 3V3, inside its 2.0 V to 5.5 V range, with OUT on GPIO13. Its output pull-up goes to its own supply, so on 3V3 the idle-high signal is already at the ESP32's logic level.

Wiring the IR Receiver (TSOP4838) to the ESP32 DevKit V1

Pin by pin.

IR Receiver (TSOP4838)ESP32 DevKit V1
OUTGPIO13 (D13)
GNDGND
VCC3V3

What to know on the ESP32 DevKit V1

  • OUT has an internal 30 kOhm pull-up to VS. Powered from VIN that pull-up would hold GPIO13 near 5 V, above the ESP32's VDD + 0.3 V limit; powered from 3V3 it needs nothing added.Vishay TSOP48 datasheet rev 2.4, pp. 1, 2; Espressif ESP32 Series Datasheet v5.3, p. 52
  • Because the TSOP4838 brings its own pull-up, OUT may also go on an input-only pin, GPIO34 to GPIO39, which have no internal pull resistors of their own.Espressif ESP32 Series Datasheet v5.3, p. 61
  • The ESP32's RMT peripheral has eight channels designed for receiving and sending IR remote signals, an option for decoding protocols in hardware instead of with timing in software.Espressif ESP32 Series Datasheet v5.3, p. 38

IR Receiver (TSOP4838) code for the ESP32 DevKit V1

Compiled for esp32:esp32:esp32 on 2026-10-30.

Libraries: z3t0/IRremote
// IR Receiver (TSOP4838) on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/ir-receiver/esp32
#define DECODE_NEC
#define DECODE_RC5
#include <IRremote.hpp>          // .hpp, not .h, in 4.x

const int IR_PIN = 13;

void setup() {
  Serial.begin(9600);
  IrReceiver.begin(IR_PIN, ENABLE_LED_FEEDBACK);
}

void loop() {
  if (IrReceiver.decode()) {
    Serial.println(IrReceiver.decodedIRData.command, HEX);   // e.g. 45
    // also: .address, .protocol, .decodedRawData,
    //       .flags & IRDATA_FLAGS_IS_REPEAT
    IrReceiver.resume();                                     // required
  }
}

IR Receiver (TSOP4838) on the ESP32 DevKit V1: questions

Does the TSOP4838 work at 3.3 V on an ESP32?

Yes. Its supply range is 2.0 V to 5.5 V, and at 3.3 V it draws about 0.35 mA (Vishay datasheet, pp. 2, 3).

Which IR library should I use on the ESP32?

The page uses IRremote 4.x (IrReceiver.begin and decode). IRremoteESP8266 is a separate library with the older IRrecv style; pick one per sketch.

Keep going

For AI assistants

This guide as plain Markdown. /components/ir-receiver/esp32.md

What will you build with it?