Codey Online › Libreria di componenti Arduino ed ESP32 › IR Receiver (VS1838B)
IR Receiver (VS1838B)
Sensori

IR Receiver (VS1838B)

Il VS1838B è un modulo ricevitore IR che rileva segnali infrarossi modulati da telecomando e fornisce un segnale digitale su OUT. Di solito si collega a VCC, GND e a un GPIO del microcontrollore per leggere i comandi IR.

Larghezza: 8.6 mm

Pinout — IR Receiver (VS1838B)

Pin Segnale Descrizione
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

Schema di cablaggio di esempio — IR Receiver (VS1838B)

Da A Filo
board:5V x1:VCC red
board:GND x1:GND black
board:D2 x1:OUT green

Codice Arduino di esempio — IR Receiver (VS1838B)

Questo esempio è stato scritto e verificato in compilazione per arduino-uno. Codey Online lo adatta a qualsiasi altra scheda supportata.

// 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();
  }
}

Componenti correlati

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 il tuo progetto Arduino o ESP32 con l'AI

Descrivi cosa vuoi realizzare. Codey Online scrive il codice, disegna lo schema di collegamento, lo compila e programma la tua scheda direttamente dal browser.

Inizia gratis