Blog

HX1838 (VS1838B) IR Receiver Module – Complete Guide

Infrared Receiver Module

HX1838 (VS1838B) IR Receiver Module

38kHz Infrared Remote Control Receiver

Most consumer IR remote controls - TV remotes, universal remotes, and the small remotes bundled with many hobby kits - communicate by rapidly switching an infrared LED on and off in specific timed patterns, modulated onto a 38kHz carrier frequency specifically so receivers can filter out ordinary ambient infrared noise (sunlight, incandescent bulbs) and only respond to genuine remote signals. The HX1838 module integrates a photodiode tuned to detect infrared light, a bandpass filter and amplifier stage tuned specifically to that 38kHz carrier, and a demodulator that strips the carrier back out - leaving a clean digital output pulse train that directly represents the remote's original on/off pattern, active-low (it idles HIGH and pulses LOW when a signal is present). Because all of that carrier-detection work happens in hardware, your microcontroller's job is reduced to timing the lengths of those LOW/HIGH pulses in software and matching them against the specific protocol - NEC being by far the most common among inexpensive remotes - that the transmitting remote uses.

38 kHz
Carrier Frequency
NEC (most common)
Protocol
Up to ~18m
Range

Key features

38kHz Carrier Filtering

Rejects ambient IR noise, responding only to modulated remote signals.

Simple Digital Output

A single active-low pulse-train pin, easy to read in software.

Wide Compatibility

Works with the vast majority of inexpensive NEC-protocol remotes.

Long Detection Range

Reliably picks up signals from several meters away.

Small 3-Pin Footprint

Drops straight onto a breadboard with minimal wiring.

Low Power Consumption

Draws only a few milliamps, safe for battery-powered receivers.

Technical specifications

Supply Voltage 2.7V – 5.5V
Carrier Frequency 38 kHz
Output Digital, active-LOW pulse train
Reception Angle ~90° (±45°)
Range Up to ~18m (remote and conditions dependent)
Operating Current ~1.5mA idle, higher briefly on signal
Common Protocol NEC (most inexpensive remotes)
Output Timing Fast enough for microsecond-level pulse decoding
Package 3-pin TO-92-style receiver module

Pinout

PinFunction
OUT Digital signal output, active-LOW
GND Ground
VCC Power supply

Applications

TV/media remote-controlled Arduino projects IR-controlled robots and RC toys Universal remote learning/relearning projects Remote-triggered relay and appliance control Simple IR-based data links Remote-button-code proximity hacks

What's in the box

1x HX1838 IR receiver module

Downloads

Datasheet (PDF) Arduino IRremote Library Example
🔌
Pin Connections
1 Table
Pin Connections Table 1
BoardSensor PinConnection
HX1838VCC/GND/OUT3.3-5V / GND / board digital pin
📟
HX1838 VS1838 NEC Infrared IR Remote Control Sensor Module For Arduino
7 Examples • C/C++ | Boards: Arduino Uno, Arduino Nano, Arduino Mega, ESP32, ESP8266, STM32, Raspberry Pi Pico
HX1838 VS1838 NEC Infrared IR Remote Control Sensor Module For Arduino - Arduino Uno
HX1838 VS1838 NEC Infrared IR Remote Control Sensor Module For Arduino - Arduino Nano
HX1838 VS1838 NEC Infrared IR Remote Control Sensor Module For Arduino - Arduino Mega
HX1838 VS1838 NEC Infrared IR Remote Control Sensor Module For Arduino - ESP32
HX1838 VS1838 NEC Infrared IR Remote Control Sensor Module For Arduino - ESP8266
HX1838 VS1838 NEC Infrared IR Remote Control Sensor Module For Arduino - STM32
HX1838 VS1838 NEC Infrared IR Remote Control Sensor Module For Arduino - Raspberry Pi Pico
📄 File: hx1838_vs1838_nec_infrared_ir_remote_control_sensor_module_for_arduino_-_arduino_uno.inoArduino Uno
377 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// OUT pin 2 on Arduino Uno
6#include <IRremote.hpp>
7
8#define IR_RECEIVE_PIN 2
9
10void setup() {
11 Serial.begin(115200);
12 IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
13}
14
15void loop() {
16 if (IrReceiver.decode()) {
17 Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
18 IrReceiver.resume();
19 }
20}
📄 File: hx1838_vs1838_nec_infrared_ir_remote_control_sensor_module_for_arduino_-_arduino_nano.inoArduino Nano
378 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// OUT pin 2 on Arduino Nano
6#include <IRremote.hpp>
7
8#define IR_RECEIVE_PIN 2
9
10void setup() {
11 Serial.begin(115200);
12 IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
13}
14
15void loop() {
16 if (IrReceiver.decode()) {
17 Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
18 IrReceiver.resume();
19 }
20}
📄 File: hx1838_vs1838_nec_infrared_ir_remote_control_sensor_module_for_arduino_-_arduino_mega.inoArduino Mega
378 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// OUT pin 2 on Arduino Mega
6#include <IRremote.hpp>
7
8#define IR_RECEIVE_PIN 2
9
10void setup() {
11 Serial.begin(115200);
12 IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
13}
14
15void loop() {
16 if (IrReceiver.decode()) {
17 Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
18 IrReceiver.resume();
19 }
20}
📄 File: hx1838_vs1838_nec_infrared_ir_remote_control_sensor_module_for_arduino_-_esp32.inoESP32
371 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// OUT pin 4 on ESP32
6#include <IRremote.hpp>
7
8#define IR_RECEIVE_PIN 4
9
10void setup() {
11 Serial.begin(115200);
12 IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
13}
14
15void loop() {
16 if (IrReceiver.decode()) {
17 Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
18 IrReceiver.resume();
19 }
20}
📄 File: hx1838_vs1838_nec_infrared_ir_remote_control_sensor_module_for_arduino_-_esp8266.inoESP8266
375 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// OUT pin D4 on ESP8266
6#include <IRremote.hpp>
7
8#define IR_RECEIVE_PIN D4
9
10void setup() {
11 Serial.begin(115200);
12 IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
13}
14
15void loop() {
16 if (IrReceiver.decode()) {
17 Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
18 IrReceiver.resume();
19 }
20}
📄 File: hx1838_vs1838_nec_infrared_ir_remote_control_sensor_module_for_arduino_-_stm32.inoSTM32
375 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// OUT pin PB4 on STM32
6#include <IRremote.hpp>
7
8#define IR_RECEIVE_PIN PB4
9
10void setup() {
11 Serial.begin(115200);
12 IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
13}
14
15void loop() {
16 if (IrReceiver.decode()) {
17 Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
18 IrReceiver.resume();
19 }
20}
📄 File: hx1838_vs1838_nec_infrared_ir_remote_control_sensor_module_for_arduino_-_raspberry_pi_pico.inoRaspberry Pi Pico
383 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// OUT pin 2 on Raspberry Pi Pico
6#include <IRremote.hpp>
7
8#define IR_RECEIVE_PIN 2
9
10void setup() {
11 Serial.begin(115200);
12 IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
13}
14
15void loop() {
16 if (IrReceiver.decode()) {
17 Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
18 IrReceiver.resume();
19 }
20}
38kHz IR remote receiver module.
Decoding raw pulse timing by hand is a common beginner exercise but genuinely fragile - the well-maintained Arduino IRremote library already handles NEC and several other protocols' timing and repeat-code quirks correctly, so use it rather than reinventing pulse-timing logic. Energy-saving LED and CFL bulbs, and some other electronics, can emit enough stray IR flicker to cause false triggers or missed codes, so keep the receiver away from direct line-of-sight to such lighting where possible. And the receiver's dome should face the remote directly - being tucked inside an enclosure or behind tinted plastic can noticeably cut effective range even when the wiring and code are correct.