Source: https://mokxi.com/parts/irreceiver
Updated: 2026-11-10

Part

# Infrared receiver, VS1838B

It inverts, and that is the whole of it: OUT idles high and drops while a burst arrives.

See every part

- 4 pins
- In 4 projects
- In 2 lessons

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Infrared receiver, VS1838B in brief

What it is, and where it sits on the bench.

The VS1838B is the black infrared receiver with a domed lens that comes bagged with the kit remote: a photodiode, an amplifier tuned to 38 kHz, a filter and a demodulator in one three-legged package. Its pins are OUT, GND and VCC, at 2.7 to 5.5 V, so it runs from 5 V on an Uno with OUT on any digital pin (the IRremote examples use 11), and from 3.3 V on an ESP32 with OUT on any GPIO. Mokxi adds a fourth pin, IR, the light: wire it to the handset’s IR pin, or leave it unwired and any IR LED or handset pointed at the lens within range reaches it. The model inverts as the real one does: OUT idles high through an internal 30 k pull-up and goes low while a burst arrives, so the NEC leader reads as 9 ms of LOW, and a 38 kHz carrier wired straight to IR is demodulated. Below 2.7 V, OUT floats. The classic mistake is decoding with the polarity upside down; another is an unpowered receiver, which reads exactly like an idle one. Ambient light, signal strength and the automatic gain control are not modeled.

Family

Clocks and links

Pins

4

Pins

## 4 pins

Named as the editor names them, so a wire lands where you expect it.

### Output1

- OUT

### Input or output2

- GND
- VCC

### Input1

- IR

How to use it

## How to use the VS1838B IR receiver with an Arduino

Facing the lens, the legs are OUT, GND and VCC. Here OUT goes to pin 11, GND to GND and VCC to 5 V; the receiver needs no resistor, because OUT has its own pull-up of about 30 k. The extra IR pin on Mokxi’s part is the light: in this circuit it is wired to the handset, and left unwired it takes any remote or IR LED pointed at the lens.

The receiver inverts. OUT idles HIGH and goes LOW while a 38 kHz burst arrives, so the NEC leader shows up as 9 ms of LOW; the dome on the part lights while the line is down. The IRremote library handles that for you: IrReceiver.begin(11) starts timer 2 sampling the pin in the background, decode() turns true once a frame is in, and resume() readies it for the next. Timer 2 then belongs to the library, so tone() and analogWrite() on pins 3 and 11 stop working, as on a real Uno.

Part pin

Board pin

OUT

Pin 11

GND

GND

VCC

5 V

IR

The remote’s IR pin (the beam)

The VS1838B runs from 2.7 to 5.5 V, so on an ESP32 power it from 3.3 V and OUT can go to any GPIO.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

The receive loop, from the IR decoder sketch

How it is modeled

## What is true about the Infrared receiver, VS1838B, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Not modeled

The carrier and the air, as above. The automatic gain control, so this receiver
never blanks. A real one turns its gain down under a long continuous burst and
stops seeing anything, which is why NEC's leader is 9 ms and not 90. The tuning,
so a burst at any rate at all is a burst here and two remotes on different
carriers would interfere. The few hundred microseconds of edge error a real
receiver has, which is what makes a decoder's tolerances necessary; here the
edges are exact. And no protocol but NEC: no RC-5, no Sony SIRC, no extended
NEC with a 16-bit address.

From Signals you time, not read, in full.

Projects

## See the Infrared receiver, VS1838B in a project

4 built-in projects use it. Each opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

2 lessons place it in their own circuits.

### Learn articles

2 lessons

- Arduino IR Remote: Decode NEC, Switch Lamps
- Arduino IR Transmitter: Laser Tag With Two Nanos

Boards

## The boards it is shown on

Each of these 2 boards has a built-in project with the Infrared receiver, VS1838B in it.

- Arduino Uno R3
- Arduino Nano

Boards

## The Infrared receiver, VS1838B on each board

The pins, the voltage and the code change from board to board. Each page has that board’s wiring and a circuit you can run.

- Arduino Uno and IR Receiver
- ESP32 and IR Receiver
- Arduino Nano and IR Receiver
- Arduino Mega and IR Receiver
- ESP32-C3 and IR Receiver
- ESP32-S3 and IR Receiver
- Raspberry Pi Pico and IR Receiver
- Arduino Uno R4 and IR Receiver

Libraries

## Arduino libraries for the Infrared receiver, VS1838B

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- IRremote
- IRremoteESP8266

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Infrared receiver, VS1838B

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
