ESP32 LD2412 Human Presence Sensor

LD2412 Human Presence Sensor image

LD2412

Protocol: UART

Overview

The LD2412 is a wide-angle 24GHz mmWave radar sensor that detects human presence via FMCW. It supports both UART and digital output and is ideal for real-time occupancy monitoring in smart environments.

About LD2412 Human Presence Sensor

The HLK-LD2412 is a 24GHz FMCW radar sensor designed for human presence detection with a wide sensing angle of ±75° and a range up to 9 meters. It offers both UART communication and a digital output signal, and supports flexible power supply options (3.3V or 5V). This makes it highly adaptable for smart home, automation, and occupancy detection use cases.

Where to Buy

LD2412 Human Presence Sensor

Starting from

$7 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 baud), Digital OUT
Detection Range Up to 9 meters
Detection Field ±75°
Power Supply 3.3V or 5V DC
Output UART, GPIO
Resolution Configurable zones via UART
Operating Temperature -20°C to +85°C
Dimensions 20mm × 20mm
Pin Width 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 LD2412 module features the following pins:

  • OUT – Digital presence detection output. Goes HIGH when presence is detected.
  • TX – UART transmit pin (connect to RX on ESP32).
  • RX – UART receive pin (connect to TX on ESP32).
  • 5V – Power input (use either 5V or 3V3).
  • 3V3 – Power input for 3.3V systems (do not power both 5V and 3V3 at the same time).
  • GND – Ground pin, connect to ESP32 GND.

Logic levels are 3.3V. Digital OUT is also 3.3V compatible with ESP32.

Wiring with ESP32

Wiring LD2412 to ESP32 via UART (recommended UART2):

  • 5V (or 3V3) → 5V or 3.3V on ESP32 (choose one).
  • GND → GND on ESP32.
  • TX → GPIO16 (ESP32 RX).
  • RX → GPIO17 (ESP32 TX).
  • OUT (optional) → GPIO18 for presence interrupt pin.

Ensure UART baud rate is set to 115200. Use 3.3V logic levels only.

Troubleshooting Guide

Common Issues

🛑 No UART Response

⚠️ Digital OUT Stuck LOW

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

Code Examples

Arduino Example

C++
🏠

ESPHome Example

YAML
🛠️

PlatformIO Example

C++
🐍

MicroPython Example

Python

Conclusion

The ESP32 LD2412 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.