> Source: https://www.tinkered.ai/components/ir-receiver/arduino-uno (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/arduino-uno. 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 Arduino Uno

The bare TSOP4838 has an internal 30 kΩ pull-up to its own supply, so powered from the Arduino Uno's 5V its OUT idles at 5 V and pulls low on each burst, ready for any Uno input. Unlike a breakout, it has no filtering of its own, and the Uno's USB 5 V is not a quiet supply.

## Wiring

| IR Receiver (TSOP4838) | Arduino Uno | Note |
| --- | --- | --- |
| OUT | D2 |  |
| GND | GND |  |
| VCC | 5V |  |

## What to know on the Arduino Uno

- OUT's 30 kΩ pull-up goes to VS, so VS must be the Uno's 5V for OUT to reach the Uno's logic high; the receiver runs from 2.0 V to 5.5 V. (Vishay TSOP48 datasheet rev 2.4, pp. 1 to 3)
- Vishay's application circuit adds a resistor in series with VS and a capacitor from VS to GND to keep supply disturbances out of the receiver. On the Uno's USB-powered 5V, add them close to the part if the range is shorter than expected or codes are missed. (Vishay TSOP48 datasheet rev 2.4, application circuit)
- Wire by pin number, not position: pin 1 is OUT, 2 GND, 3 VS. The TSOP's order differs from many breakouts, so a breadboard copied from a module tutorial puts 5 V on the wrong pin. (Vishay TSOP48 datasheet rev 2.4, p. 2)
- The Uno's IRremote 4.x build claims Timer2: keep tone() out of the sketch and expect no PWM on D3 or D11. (IRremote library documentation; Arduino language reference, tone())

## Code

Libraries: z3t0/IRremote

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

const int IR_PIN = 2;

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 arduino:avr:uno on 2026-10-30.

## Questions

### How do I wire a TSOP4838 to an Arduino Uno?

Pin 1 (OUT) to D2 or any digital pin, pin 2 to GND and pin 3 (VS) to 5V (Vishay datasheet, p. 2). OUT has its own 30 kΩ pull-up, so no resistor is needed on the signal.

### Why does my TSOP4838 miss codes on the Uno?

Supply noise is a common cause on a USB-powered Uno. Add the series resistor and decoupling capacitor from Vishay's application circuit at the receiver, and keep it away from switching parts.

### Can I use tone() with the TSOP4838 on an Arduino Uno?

Not with IRremote 4.x, which uses Timer2 on the Uno, the timer tone() needs too.

## 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 Arduino Uno in the browser, with this wiring and code, free: https://www.tinkered.ai/components/ir-receiver/arduino-uno
