# IR remote receiver prints nothing or random codes: VS1838, library and pin

> Fix an IR receiver that gives no codes: check the pin order, use the IRremote library for your version and keep out of strong light.

Canonical: https://roboticsengineering.in/fix/ir-remote-receiver-vs1838-no-codes-or-garbage/ | Published: 2026-11-03 | Updated: 2026-11-04

**Check the pin order of the receiver first.** Output, ground and power are in a different order on different modules.

## What the message means

The receiver demodulates a 38 kHz signal. Wrong power, a wrong pin or a timer clash with another library gives silence or random codes.

## Fix it in this order

1. Check the pin order on your receiver and wire power, ground and signal correctly.
2. Use the signal pin that the library expects, and set it in begin().
3. Install the current IRremote library and read the example for your version, since the functions changed.
4. Point the remote at the receiver within a couple of metres, away from bright light.
5. Avoid another library that uses the same timer, such as some servo or tone code.
6. Print the raw value to see if anything arrives.

## Why it happens

A VS1838-type receiver demodulates a 38 kHz signal. No codes usually mean wrong wiring, a flat remote battery, or a library mismatch, because the IRremote library changed its calls between versions. Bright sunlight and some lamps add interference and give garbage.

Check VCC, GND and OUT against the module markings, test the remote with a phone camera to see the LED flash, use the example that matches your library version, and shade the receiver.

## If you see this, do this

| You see | Do this |
| --- | --- |
| Nothing printed | Wiring or pin. |
| Random codes | Light, noise or protocol mismatch. |

## Related

[library not found](https://roboticsengineering.in/fix/arduino-library-not-found-install-library-manager/), [serial monitor shows nothing](https://roboticsengineering.in/fix/serial-monitor-shows-nothing/).

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.

## Why this happens

A VS1838-type receiver contains a photodiode, an amplifier and a demodulator tuned to about 38 kHz. It outputs a clean, normally high signal that goes low while the remote’s burst is present. The Arduino library measures the lengths of those pulses and decodes the protocol. If the receiver is powered wrongly, the pins are swapped or the library timing is disturbed, you see nothing or random codes.

Pin order differs between modules, so check the markings on yours rather than a drawing. Newer IRremote releases (version 3 and above) changed the interface: the old IRrecv object and results.value style no longer apply, and old sketches fail to compile or behave differently.

## How to confirm the cause

- Look at the remote’s LED with a phone camera. Many phone cameras show an infrared flash as a pale glow; no glow can mean a flat battery or a missing battery pull-tab.
- Measure the receiver’s supply pin with a meter; the output should sit near the supply voltage when no button is pressed.
- Print the raw result with the library’s short print function; ‘UNKNOWN’ with irregular values suggests noise or a remote that uses a protocol the library does not know.
- Move away from bright sunlight and fluorescent or LED drivers which put noise on the line.
- Check your library version and the example sketch that ships with it.

## Worked example

A minimal receiver sketch for IRremote 3 and above. Change the pin to the one you wired.

```
#include <IRremote.hpp>

void setup() {
  Serial.begin(115200);
  IrReceiver.begin(11);
}

void loop() {
  if (IrReceiver.decode()) {
    IrReceiver.printIRResultShort(&Serial);
    IrReceiver.resume();
  }
}
```

## Common mistakes

- Using a sketch written for the old library.
- Powering the sensor from 3.3 V when it needs 5 V, or the reverse.
- Swapping the supply and output pins.
- Forgetting resume(), so only the first code arrives.
- Using the same timer for tone() or a servo library at the same time.

## If this did not fix it

- A timer conflict between the IR library and another library.
- A remote whose carrier is far from 38 kHz gives short range.
- A weak battery in the remote, giving short bursts that fail to decode.
- On ESP32, a pin choice that the library does not support; check the library notes.
