Codey Online › Biblioteca de componentes Arduino y ESP32 › IR Receiver (VS1838B)
IR Receiver (VS1838B)
Sensores

IR Receiver (VS1838B)

El VS1838B es un módulo receptor IR que detecta señales infrarrojas moduladas de control remoto y entrega una señal digital en OUT. Normalmente se conecta a VCC, GND y a un GPIO del microcontrolador para leer comandos IR.

Ancho: 8.6 mm

Pinout — IR Receiver (VS1838B)

Pin Señal Descripción
OUT digital Demodulated IR receiver output — connect to a microcontroller digital input
GND ground Ground reference for the IR receiver module
VCC power Positive supply for the IR receiver, typically 3.3V or 5V

Esquema de cableado de ejemplo — IR Receiver (VS1838B)

Desde Hasta Cable
board:5V x1:VCC red
board:GND x1:GND black
board:D2 x1:OUT green

Código Arduino de ejemplo — IR Receiver (VS1838B)

Este ejemplo se escribió y verificó por compilación para arduino-uno. Codey Online lo adapta a cualquier otra placa compatible.

// Canonical beginner example for the VS1838B IR Receiver
// Wiring:
// - VCC -> 5V
// - GND -> GND
// - OUT -> D2

#include <IRremote.hpp>

constexpr uint8_t IR_RECEIVE_PIN = 2;

void setup() {
  Serial.begin(115200);
  while (!Serial) {
    ;
  }

  IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);

  Serial.println(F("VS1838B IR Receiver example"));
  Serial.println(F("Point a TV remote at the receiver and press buttons."));
  Serial.println(F("Decoded IR data will appear here."));
}

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

Componentes relacionados

PIR Sensor HC-SR501

PIR Sensor HC-SR501

HW-201 Infrared Obstacle Avoidance Module

HW-201 Infrared Obstacle Avoidance Module

GPS NEO-6M

GPS NEO-6M

HC-SR501 PIR Motion Sensor

HC-SR501 PIR Motion Sensor

Crea tu proyecto de Arduino o ESP32 con IA

Describe lo que quieres construir. Codey Online escribe el codigo, dibuja el esquema de conexiones, lo compila y graba tu placa directamente desde el navegador.

Empieza gratis