ESP32 LD2420 Human Presence Sensor

LD2420 Human Presence Sensor image

LD2420

Protocol: UART

Overview

The LD2420 is a mmWave radar sensor for motion, micro-motion, and presence detection. It supports UART communication and GPIO output, and integrates easily with ESPHome and Arduino platforms.

About LD2420 Human Presence Sensor

The LD2420 is a high-performance 24GHz mmWave radar sensor designed for human presence detection, capable of sensing motion, micro-motion, and stationary targets within a range of up to 8 meters. It features UART and GPIO outputs, operates at 3.3V, and is suitable for a wide range of smart home and automation applications. The sensor supports flexible configuration options via UART and is compatible with ESPHome and Arduino environments. For firmware versions below 1.5.3, the baud rate is 256000; for newer firmware, it's 115200. No MicroPython or ESP-IDF libraries are available yet.

Where to Buy

LD2420 Human Presence Sensor

Starting from

$8 per unit

Amazon com
Amazon.com Ships worldwide
View Price
Amazon de
Amazon.de Ships to EU
View Price
Aliexpress
AliExpress Best value
View Price

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specifications

Interface UART (115200 or 256000 baud)
Detection Range 0.3–8 meters
Detection Field ±60°
Power Supply 3.3V DC
Output UART, GPIO
Resolution Configurable gate zones
Operating Temperature -20°C to +85°C
Dimensions 20mm × 20mm
Pin Spacing 2.54mm

Pinout Configuration

The VCC pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND pin is the ground connection and must be connected to the ground of your ESP32.

The LD2420 is a versatile 24GHz mmWave radar sensor capable of detecting motion, micro-motion, and presence across configurable gate zones. Its pin layout is designed for straightforward UART communication with microcontrollers like the ESP32. The module includes the following pins:

  • VCC – Power input pin. Requires a regulated 3.3V DC source. Supplying a higher voltage may damage the sensor permanently.
  • GND – Ground reference. This pin must be connected to the ESP32 or host microcontroller's GND pin to ensure stable logic levels and power.
  • TX – UART transmit pin. Used to send radar data to the microcontroller. Connect this to the ESP32’s RX pin (e.g., GPIO16).
  • RX – UART receive pin. Used to receive configuration commands from the microcontroller. Connect this to the ESP32’s TX pin (e.g., GPIO17).
  • OUT – Optional digital output pin that goes HIGH (3.3V) when presence is detected. This pin can be used to trigger logic-level events or interrupts.

Note: The OUT signal operates at 3.3V logic, compatible with ESP32 I/O without the need for level shifting.

Wiring with ESP32

To connect the LD2420 sensor to an ESP32 using UART for real-time presence detection, wire the pins as follows. This configuration assumes use of UART2 on the ESP32:

  • VCC (red wire) → 3.3V on ESP32. Power input for the LD2420. Use a stable LDO or onboard 3.3V regulator output.
  • GND (black wire) → GND on ESP32. This is the ground connection shared with the ESP32 for consistent signal referencing.
  • TX (green wire) → GPIO16 (RX on ESP32). Allows the ESP32 to receive data packets such as distance, presence, and signal strength.
  • RX (blue wire) → GPIO17 (TX on ESP32). Allows the ESP32 to send configuration or command messages to the LD2420.
  • OUT (yellow wire, optional) → GPIO18 on ESP32. Use this if you want to act on a simple HIGH signal indicating presence, without parsing UART data.

Important: The correct baud rate must be chosen based on the sensor’s firmware version: 256000 for firmware <1.5.3, or 115200 for firmware ≥1.5.3. Be sure to match this in both hardware and ESPHome/Arduino configuration.

Troubleshooting Guide

Common Issues

📶 Baud Rate Mismatch

❌ No Presence Detection

⚠️ Intermittent Readings

🔌 ESPHome Entity Unavailable

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

Code Examples

Arduino Example

C++
🏠

ESPHome Example

YAML
🛠️

PlatformIO Example

C++
🐍

MicroPython Example

Python

Conclusion

The ESP32 LD2420 Human Presence Sensor is a powerful Human Presence sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.