ESP32 LD2461 Human Presence & Trajectory Radar Sensor
LD2461
Protocol: UART
Overview
The LD2461 is a high-precision 24GHz radar sensor capable of detecting multiple human targets and tracking their trajectories. It communicates via UART and is ideal for advanced presence detection applications.
Choose Your Platform
About LD2461 Human Presence & Trajectory Radar Sensor
The LD2461 is a 24GHz millimeter-wave radar sensor designed for advanced human presence detection and trajectory tracking. It features a 2T4R (2 transmit, 4 receive) antenna configuration, enabling it to detect up to 5 moving or stationary targets simultaneously. The sensor provides precise range and angle measurements, making it suitable for applications such as smart lighting, occupancy monitoring, and security systems. For more information, refer to the official datasheet: LD2461 Datasheet.
Technical Specifications
Where to Buy
Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.
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 LD2461 is a high-precision 24GHz radar module with multi-target tracking capabilities, designed to detect up to 5 human targets simultaneously. It uses a 2T4R antenna array and provides both positional and motion data via UART. The sensor exposes the following pins for connection:
VCC
– Power input. Connect to a regulated 5V supply. This pin powers the radar signal processor and onboard MCU. Stable voltage is critical to avoid data corruption or resets.GND
– Ground pin. Connect this to the ground rail of your microcontroller (ESP32) or power system to establish a shared reference for signals and voltage levels.TX
– UART transmit pin. This sends tracking data (position, speed, presence) from the LD2461 to the ESP32. Connect this to the ESP32’s RX pin (e.g., GPIO16).RX
– UART receive pin. This line receives commands or configuration data from the ESP32. Connect to TX on the ESP32 (e.g., GPIO17).OUT
– Optional digital output pin that toggles HIGH (typically 3.3V logic) when presence is detected. Can be used for quick interrupt-based presence notifications without parsing UART data.
Note: While the LD2461 is powered with 5V, its OUT
logic level is 3.3V and is safe to connect directly to ESP32 GPIOs.
Wiring with ESP32
To integrate the LD2461 radar sensor with an ESP32 using UART communication, wire the sensor as follows. This setup ensures accurate data transmission and real-time tracking capabilities:
VCC
(red wire) → 5V pin on ESP32. Use a stable and clean 5V supply to power the sensor.GND
(black wire) → GND on ESP32. A proper ground connection is essential for signal reference and power stability.TX
(green wire) → GPIO16 on ESP32 (UART RX). Allows the ESP32 to receive tracking data from the sensor.RX
(blue wire) → GPIO17 on ESP32 (UART TX). Enables the ESP32 to send configuration commands if needed.OUT
(yellow wire, optional) → GPIO18 on ESP32 if you plan to use a direct digital presence signal for interrupts or indicators.
Configuration Note: Set the UART baud rate to 256000
bps, no parity, and 1 stop bit. Verify in your firmware that UART2 (or the configured UART) is not in use by other components. Always double-check for secure connections, especially when running multi-target tracking at high data rates.
Troubleshooting Guide
Common Issues
🚫 No Data Received
Issue: The ESP32 receives no data from the sensor.
Ensure correct wiring: verify that TX and RX lines are properly connected, and confirm that the UART baud rate is set to 256000 bps. Also, ensure that the sensor is powered with a stable 5V supply.
❌ Presence Not Detected
Issue: The sensor does not detect presence even when someone is in range.
Check the sensor's field of view and ensure there are no obstructions. Verify that the sensor's configuration parameters are set correctly for the desired detection range and sensitivity.
⚠️ Intermittent Detection
Issue: Sensor intermittently detects presence or fails to maintain detection.
Ensure that the sensor is securely mounted and not subject to vibrations. Check for sources of interference in the environment that may affect radar performance.
🔌 UART Initialization Fails
Issue: UART component in ESPHome reports failure to initialize.
Verify that the UART pins specified in the configuration match the physical connections. Ensure that no other devices are using the same UART bus, and that the baud rate is correctly set to 256000 bps.
Debugging Tips
🔍 Serial Monitor
Use the Serial Monitor to check for error messages and verify the sensor's output. Add debug prints in your code to track the sensor's state.
⚡ Voltage Checks
Use a multimeter to verify voltage levels and check for continuity in your connections. Ensure the power supply is stable and within the sensor's requirements.
Code Examples
ESPHome Example
external_components:
- source:
type: git
url: https://github.com/Chreece/LD2461-ESPHome
refresh: 0s
uart:
id: uart_bus
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 256000
ld2461:
uart_id: uart_bus
sensor:
- platform: ld2461
x:
name: "Target X Position"
y:
name: "Target Y Position"
speed:
name: "Target Speed"
target_count:
name: "Target Count"
text_sensor:
- platform: ld2461
status:
name: "LD2461 Status"
As of now, there is no official ESPHome support for the LD2461 sensor. However, an external component has been developed to facilitate integration: Chreece/LD2461-ESPHome. This component is under development and may require manual configuration and testing.
MicroPython Example
from machine import UART
import time
# Initialize UART2 for LD2461 (TX=17, RX=16)
uart = UART(2, baudrate=256000, tx=17, rx=16)
buffer = b''
while True:
if uart.any():
buffer += uart.read()
if b'\n' in buffer:
lines = buffer.split(b'\n')
for line in lines[:-1]:
try:
print(line.decode('utf-8').strip())
except UnicodeDecodeError:
pass
buffer = lines[-1]
time.sleep(0.05)
A MicroPython implementation for the LD2461 sensor is available, developed by marconicivitavecchia. It provides basic functionality for interfacing the sensor with an ESP32 using MicroPython. For more details and code examples, refer to the GitHub repository: esp32-LD2461.
Conclusion
The ESP32 LD2461 Human Presence & Trajectory Radar Sensor is a powerful 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.