Codey OnlineBiblioteka komponentów Arduino i ESP32 › Human Presence Sensor LD2410C
Human Presence Sensor LD2410C
Czujniki

Human Presence Sensor LD2410C

Human Presence Sensor LD2410C 24GHz

Szerokość: 21.2 mm

Pinout — Human Presence Sensor LD2410C

Pin Sygnał Opis
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.

Przykładowy schemat połączeń — Human Presence Sensor LD2410C

Z Do Przewód
board:5V x1:VCC red
board:GND x1:GND black
board:D2 x1:OUT green

Przykładowy kod Arduino — Human Presence Sensor LD2410C

Ten przykład został napisany i sprawdzony kompilacją dla arduino-uno. Codey Online dostosuje go do każdej innej obsługiwanej płytki.

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

Podobne komponenty

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

3.5 inch TFT LCD Shield

3.5 inch TFT LCD Shield

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Zbuduj swój projekt Arduino lub ESP32 z pomocą AI

Opisz, co chcesz zbudować. Codey Online napisze kod, narysuje schemat połączeń, skompiluje projekt i wgra go na płytkę bezpośrednio z przeglądarki.

Zacznij za darmo