> Source: https://www.tinkered.ai/components/ir-receiver-st1089/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-st1089/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 Module (VS1838B) with an ESP32 DevKit V1

The ST1089 module's VS1838B receiver runs from the ESP32 DevKit V1's 3V3, inside its 2.7 V to 5.5 V range, and its S pin goes to GPIO13. Powered from 3.3 V its output idles at the ESP32's own logic level, so no divider is needed.

## Wiring

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

## What to know on the ESP32 DevKit V1

- Keep the module on 3V3, not VIN. Its output high follows its supply, 4.5 V minimum on a 5 V supply, which would exceed the ESP32's VDD + 0.3 V input limit. (VS1838B datasheet, p. 2; Espressif ESP32 Series Datasheet v5.3, p. 52)
- The ESP32 also has a hardware Remote Control peripheral (RMT) with eight channels built for sending and receiving IR signals, which libraries can use to capture remotes without CPU timing. (Espressif ESP32 Series Datasheet v5.3, p. 38)

## Code

Libraries: z3t0/IRremote

```cpp
// IR Receiver Module (VS1838B) on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/ir-receiver-st1089/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

### Can I connect the VS1838B module to any ESP32 pin?

Any GPIO that can read an input works for OUT, including the input-only GPIO34 to GPIO39 (ESP32 datasheet, p. 61). The page uses GPIO13, which is not a strapping pin.

### Why do I get only one code from my remote on the ESP32?

Call IrReceiver.resume() after every decode, as the page's sketch does; without it the receiver stays stopped.

## More

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

## Try it

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