Pedido antes de las 14:00 en día laborable = enviado el mismo día 30 días de desistimiento 1 año de garantía
← Volver al resumen

Al reproducirlo, se carga el vídeo de YouTube.

Esquema de conexión y ejemplo de código

Así conectas el Módulo sensor de presencia humana LD2410C 24GHz a un Arduino UNO o ESP32, con un sketch de ejemplo que puedes subir directamente.

Detección de presencia humana con LD2410C

Este proyecto detecta la presencia humana usando el pin de salida digital del sensor radar mmWave LD2410C de 24GHz. Cuando se detecta movimiento o presencia estática, el LED integrado se enciende y el estado se informa en el Monitor Serie.

Esquema de conexión: Módulo sensor de presencia humana LD2410C 24GHz en un Arduino UNO
Esquema de conexión · Haz clic para ampliar
Tabla de conexión: Módulo sensor de presencia humana LD2410C 24GHz en un Arduino UNO
Tabla de conexión · Haz clic para ampliar
Human_Presence_Detection_with_LD2410C.ino · compilado y probado
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Human Presence Detection with LD2410C
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : Human Presence Sensor LD2410C
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// LD2410C Human Presence Detection Example
// Reads the OUT pin to detect human presence

const int PRESENCE_PIN = 2;
const int LED_PIN = 13;

int lastState = -1;

void setup() {
  pinMode(PRESENCE_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);

  Serial.begin(115200);
  Serial.println(F("LD2410C Presence Sensor Ready"));
}

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

  // Update on state change
  if (currentState != lastState) {
    lastState = currentState;

    if (currentState == HIGH) {
      digitalWrite(LED_PIN, HIGH);
      Serial.println(F("Target detected: Presence confirmed!"));
    } else {
      digitalWrite(LED_PIN, LOW);
      Serial.println(F("No target detected."));
    }
  }

  delay(50);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Detección de presencia humana LD2410C

Este circuito lee datos de radar mmWave en tiempo real del sensor LD2410C por UART usando ESP32 Serial2. Un divisor de tensión con resistencias (1kΩ / 2kΩ) reduce de forma segura la salida TX de 5V del sensor a 3.3V para el pin RX2 del ESP32. La presencia, los objetivos estáticos y los objetivos en movimiento se muestran en el Serial Monitor.

Esquema de conexión: Módulo sensor de presencia humana LD2410C 24GHz en un ESP32 DevKit V1
Esquema de conexión · Haz clic para ampliar
Tabla de conexión: Módulo sensor de presencia humana LD2410C 24GHz en un ESP32 DevKit V1
Tabla de conexión · Haz clic para ampliar
LD2410C_Human_Presence_Detection.ino · compilado y probado
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : LD2410C Human Presence Detection
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : Human Presence Sensor LD2410C
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <ld2410.h>

ld2410 radar;
uint32_t lastPrint = 0;

void setup() {
  Serial.begin(115200);
  // LD2410C default baud rate is 256000 on Serial2 (RX: 16, TX: 17)
  Serial2.begin(256000, SERIAL_8N1, 16, 17);

  Serial.println("Connecting to LD2410C sensor...");
  if (radar.begin(Serial2)) {
    Serial.println("LD2410C sensor initialized successfully!");
  } else {
    Serial.println("Sensor initialization failed. Check wiring and power.");
  }
}

void loop() {
  radar.read();

  if (radar.isConnected() && (millis() - lastPrint > 500)) {
    lastPrint = millis();

    if (radar.presenceDetected()) {
      Serial.print("Presence: DETECTED | ");
      if (radar.movingTargetDetected()) {
        Serial.print("Moving Target: ");
        Serial.print(radar.movingTargetDistance());
        Serial.print(" cm | ");
      }
      if (radar.stationaryTargetDetected()) {
        Serial.print("Stationary Target: ");
        Serial.print(radar.stationaryTargetDistance());
        Serial.print(" cm");
      }
      Serial.println();
    } else {
      Serial.println("Presence: None");
    }
  }
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Vistos recientemente

Robotcube DIY Firefly Robot fotosensible sin batería

Robotcube DIY Firefly Robot fotosensible sin batería

€ 14,55
Acoplamiento para rueda 30 mm / 6 mm

Acoplamiento para rueda 30 mm / 6 mm

€ 2,00
Mini pantalla OLED azul de 0.96 inch 128x64 I2C

Mini pantalla OLED azul de 0.96 inch 128x64 I2C

€ 5,99