> Source: https://www.tinkered.ai/components/ir-receiver/raspberry-pi-pico (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/raspberry-pi-pico. 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 a Raspberry Pi Pico

The TSOP4838 runs from the Raspberry Pi Pico's 3V3 and sends its demodulated, active-low output to GP0, where IRremote 4.x decodes NEC and RC5 frames. Its OUT pin has an internal pull-up to its own supply, so 3V3 keeps the idle level at 3.3 V.

## Wiring

| IR Receiver (TSOP4838) | Raspberry Pi Pico | Note |
| --- | --- | --- |
| OUT | GP0 |  |
| GND | GND |  |
| VCC | 3V3 |  |

## What to know on the Raspberry Pi Pico

- OUT is pulled up internally with 30 kOhm to VS. On 3V3 it idles at 3.3 V; on VBUS it would idle at about 5 V, above the RP2040's IOVDD + 0.5 V rating. (Vishay TSOP48 datasheet rev 2.4, pp. 1 to 2; RP2040 datasheet, section 5.5.3.1)
- The receiver works from 2.0 V to 5.5 V and draws 0.35 mA typical at 3.3 V, so it is a trivial load on the 3V3 pin. (Vishay TSOP48 datasheet rev 2.4, p. 3)
- Pins are 1 OUT, 2 GND, 3 VS, unlike many IR modules: wire by function, not by position, on the Pico's breadboard. (Vishay TSOP48 datasheet rev 2.4, p. 2)
- ENABLE_LED_FEEDBACK blinks LED_BUILTIN, the Pico's green LED on GP25, with each frame. (Raspberry Pi Pico datasheet, release 21, p. 7)

## Code

Libraries: z3t0/IRremote

```cpp
// IR Receiver (TSOP4838) on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/ir-receiver/raspberry-pi-pico
#define DECODE_NEC
#define DECODE_RC5
#include <IRremote.hpp>          // .hpp, not .h, in 4.x

const int IR_PIN = 0;

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 rp2040:rp2040:rpipico on 2026-10-30.

## Questions

### Can I power the TSOP4838 from the Pico's 3V3 pin?

Yes. It is rated 2.0 V to 5.5 V (Vishay datasheet rev 2.4, p. 3), and at 3.3 V its pulled-up OUT matches the Pico's GPIO level.

### Why does nothing decode on my Pico?

Check the pinout (1 OUT, 2 GND, 3 VS, Vishay datasheet, p. 2), that OUT is on GP0, and that the sketch calls IrReceiver.resume() after each decode.

### Does IRremote work on the Raspberry Pi Pico?

Yes, IRremote 4.x compiles for the RP2040 under the arduino-pico core, as the page's code does. Include IRremote.hpp, not the old .h API.

## 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 Raspberry Pi Pico in the browser, with this wiring and code, free: https://www.tinkered.ai/components/ir-receiver/raspberry-pi-pico
