SKU: OT1021 Numer artykułu: OT1021 EAN: 8721244302904
LD2410C to zaawansowany czujnik obecności, który wykrywa ruch człowieka za pomocą 24 GHz FMCW radaru fal milimetrowych. W przeciwieństwie do tradycyjnych czujników PIR, ten moduł działa poprzez mikrofale i efekt Dopplera, dzięki czemu może wykrywać ruch przez niemal wszystkie materiały, z wyjątkiem metalu.
LD2410C oferuje niezawodne i elastyczne rozwiązanie do wykrywania obecności człowieka, nawet w wymagających środowiskach. Dzięki łatwej integracji i rozbudowanym możliwościom konfiguracji ten czujnik nadaje się do różnych inteligentnych zastosowań bez potrzeby posiadania zaawansowanej wiedzy programistycznej.
Tak podłączysz LD2410C 24GHz moduł czujnika obecności człowieka do Arduino UNO lub ESP32, z przykładowym szkicem, który możesz od razu wgrać.
Ten projekt wykrywa obecność człowieka za pomocą cyfrowego pinu wyjściowego czujnika radarowego mmWave LD2410C 24GHz. Gdy zostanie wykryty ruch lub nieruchoma obecność, wbudowana dioda LED zapala się, a status jest wyświetlany w Serial Monitor.
/*
* ==================================================================
* 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
Ten układ odczytuje w czasie rzeczywistym dane radarowe mmWave z czujnika LD2410C przez UART, używając ESP32 Serial2. Dzielnik napięcia z rezystorów (1kΩ / 2kΩ) bezpiecznie obniża wyjście TX 5V czujnika do 3.3V dla pinu RX2 ESP32. Obecność, nieruchome cele i poruszające się cele są wyświetlane w Serial Monitor.
/*
* ==================================================================
* 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