Codey Online › Libreria di componenti Arduino ed ESP32 › Human Presence Sensor LD2410C
Human Presence Sensor LD2410C
Sensori

Human Presence Sensor LD2410C

Human Presence Sensor LD2410C 24GHz

Larghezza: 21.2 mm

Pinout — Human Presence Sensor LD2410C

Pin Segnale Descrizione
TX TX UART transmit from LD2410C — connect to host MCU RX for sensor data/config.
RX RX UART receive to LD2410C — connect to host MCU TX for commands/config.
OUT digital Presence detection digital output indicating target/presence state.
GND ground Ground reference for power and UART/digital signals.
VCC power Module power input, typically 5V for the LD2410C sensor board.

Schema di cablaggio di esempio — Human Presence Sensor LD2410C

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

Codice Arduino di esempio — Human Presence Sensor LD2410C

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 LD2410C Human Presence Sensor
  - Reads the OUT pin as a digital presence signal
  - Prints the detected state to Serial Monitor

  Wiring:
  - LD2410C VCC -> Arduino 5V
  - LD2410C GND -> Arduino GND
  - LD2410C OUT -> Arduino D2
*/

const int PRESENCE_PIN = 2;

void setup() {
  pinMode(PRESENCE_PIN, INPUT);
  Serial.begin(115200);
  while (!Serial) {
    ;
  }

  Serial.println("LD2410C human presence sensor example");
  Serial.println("Waiting for presence changes...");
}

void loop() {
  int state = digitalRead(PRESENCE_PIN);

  if (state == HIGH) {
    Serial.println("Presence detected");
  } else {
    Serial.println("No presence detected");
  }

  delay(500);
}

Componenti correlati

Motion sensor with microwave radar RCWL-051

Motion sensor with microwave radar RCWL-051

Mini PIR

Mini PIR

PIR Sensor HC-SR501

PIR Sensor HC-SR501

HW-201 Infrared Obstacle Avoidance Module

HW-201 Infrared Obstacle Avoidance Module

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