> Source: https://www.tinkered.ai/components/ir-receiver/esp32 (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/ir-receiver/esp32. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# IR Receiver (TSOP4838) with an ESP32 DevKit V1

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

| IR Receiver (TSOP4838) | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| OUT | GPIO13 (D13) |  |
| GND | GND |  |
| VCC | 3V3 |  |

## 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)

## Code

Libraries: z3t0/IRremote

```cpp
// 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
  }
}
```

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

## 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.

## More

- [IR Receiver (TSOP4838) reference](https://www.tinkered.ai/components/ir-receiver.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the IR Receiver (TSOP4838) on the ESP32 DevKit V1 in the browser, with this wiring and code, free: https://www.tinkered.ai/components/ir-receiver/esp32
