VS1838B IR receiver (38 kHz)
VS1838B / KY-022 38 kHz IR receiver pinout, wiring on 3.3 V and 5 V boards, decoding NEC remote codes with IRremote, and common problems.
Community draft — report a mistake
3.3 V or 5 V? Power it from your board's logic voltage; OUT is an active-LOW signal at VCC level.
The VS1838B demodulates 38 kHz infrared bursts from TV and AC remotes into a clean digital signal. The IRremote library turns that into protocol + address + command values (NEC is the most common for cheap remotes).
It’s the easiest way to add remote control to a project — relay boards, fans, LED strips, robots.
Bare vs module. The bare 3-leg receiver is OUT, GND, VCC facing the dome. The KY-022 module adds an LED and a resistor and labels its pins — use those labels.
Prices are indicative (Oct 2026) and vary by seller.
Pinout
| Pin | What it does |
|---|---|
OUT | Demodulated signal: LOW while a 38 kHz IR burst is received |
GND | Ground |
VCC | 2.7–5.5 V supply |
Library
IRremote by Armin Joachimsmeyer (shirriff, z3t0)
Arduino IDE → Library Manager → search the name above. Each guide lists the exact version we compile against.
Use it with
- VS1838B IR receiver (38 kHz) with Arduino Nano Arduino C++
- VS1838B IR receiver (38 kHz) with Arduino Uno R3 Arduino C++
- VS1838B IR receiver (38 kHz) with ESP32-C3 SuperMini Arduino C++
- VS1838B IR receiver (38 kHz) with ESP32 DevKit V1 Arduino C++
- VS1838B IR receiver (38 kHz) with NodeMCU ESP8266 Arduino C++
- VS1838B IR receiver (38 kHz) with Raspberry Pi Pico W MicroPython
Common errors
Random codes with no remote pressed
Sunlight and CFL/LED lighting cause noise. Add a 100 Ω resistor in VCC and 4.7–10 µF from VCC to GND near the receiver.
Wrong pin order — receiver gets hot
Facing the dome, legs down, the bare VS1838B is OUT, GND, VCC. KY-022 modules print S, −, + (or similar) — follow the labels, they vary.
Codes differ from tutorials
Library versions changed the API. With IRremote 4.x use IrReceiver.decode() and print decodedIRData.command.