Skip to content
Go back

HLK-LD2410 mmWave Presence Sensor with Home Assistant

Published:  at  11:00 AM

What the HLK-LD2410 is

The HLK-LD2410 is a presence sensor based on mmWave radar. Unlike a PIR, which mainly detects changes in infrared radiation, it can keep detecting a person who is sitting still inside its coverage zone. That makes it useful for lighting, climate control and automations where a one-off movement isn’t enough.

It isn’t a magic sensor: furniture, walls, orientation, fans and moving objects can change the result. The installation and the distance configuration matter as much as the module.

What you need

The module uses UART communication for its configuration and its readings. Check the exact version, because there are variants with Bluetooth and revisions with wiring differences. Don’t use another model’s diagram without checking the silkscreen.

Basic wiring to the ESP32

The usual connection needs power, ground and two UART lines:

HLK-LD2410ESP32Function
VCCCompatible supplyPower for the module
GNDGNDCommon reference
TXESP32 RXData from the sensor to the microcontroller
RXESP32 TXConfiguration from the microcontroller

The specific GPIOs depend on your board. Avoid the boot pins and the ones used by the USB-serial adapter. The supply must follow the module datasheet and the UART signals must share the ground reference.

UART wiring diagram from the HLK-LD2410 to the ESP32 with TX and RX crossed
On UART, the sensor TX goes to the ESP32 RX and RX goes to TX.

Configuration with ESPHome

ESPHome has components for several LD2410 versions. A rough structure is:

uart:
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 256000

ld2410:

binary_sensor:
  - platform: ld2410
    has_target:
      name: "Presence detected"
    has_moving_target:
      name: "Movement detected"
    has_still_target:
      name: "Still presence"

Adapt the pins, the speed and the names to the module and ESPHome version. Don’t copy the baud_rate value without checking your component’s documentation. Compile first, connect the module and review the log before adding automations.

Presence vs movement

The most important difference is that the sensor can expose separate states:

For a hallway light, movement is usually enough. To keep a bathroom light on while someone stays still, presence can be more useful. Set an off delay and an exit condition to avoid rapid switching when the reading fluctuates.

If all you need is movement detection, a PIR HC-SR501 is simpler and cheaper.

Tuning the zones and the distance

Start with a conservative distance and increase it little by little. If you cover the whole room on the first try, it’ll be hard to tell which wall or object is causing false positives. Test while sitting, while standing and outside the zone you want.

Don’t place the radar behind metal or pointing straight at an area with fans, curtains or moving surfaces. Document the position and the values you set so you can reproduce the setup later.

Common errors

Privacy and security

The LD2410 detects presence, it doesn’t identify faces or record video. Even so, an automation that infers occupancy of a room is sensitive information. Keep Home Assistant inside the protected network, use unique passwords and don’t expose its dashboard directly to the internet.

External sources

Next step

The homeiotguide editorial team

Editorial lead: Néstor Espuch


Suggest changes
Share this article on:

Previous article
PIR HC-SR501 Sensor: Datasheet and Wiring
Next article
BME280 Sensor: Datasheet, I2C Wiring and Calibration