IR Receiver (TSOP4838) with a Raspberry Pi Pico

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 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 the IR Receiver (TSOP4838) to the Raspberry Pi Pico

Pin by pin.

IR Receiver (TSOP4838)Raspberry Pi Pico
OUTGP0
GNDGND
VCC3V3

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

IR Receiver (TSOP4838) code for the Raspberry Pi Pico

Compiled for rp2040:rp2040:rpipico on 2026-10-30.

Libraries: z3t0/IRremote
// 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
  }
}

IR Receiver (TSOP4838) on the Raspberry Pi Pico: 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.

Keep going

For AI assistants

This guide as plain Markdown. /components/ir-receiver/raspberry-pi-pico.md

What will you build with it?