ESP Projects

Build an mmWave presence sensor with the LD2410 and ESPHome

A PIR sensor sees you walk in and then forgets you're there. A 24 GHz radar like the LD2410 picks up the tiny movement of breathing, so the lights stay on while you read. Here's how to build one for Home Assistant for under $10.

Parts

  • HLK-LD2410C radar module. Get the C version: it has standard 2.54 mm header pins. The original LD2410 uses a tiny 1.27 mm header that needs a special cable.
  • Any ESP32 board. A classic ESP32 DevKit makes wiring easiest because its second hardware UART is free.
  • Four female-to-female jumper wires and a USB power supply.
  • Optional: a BME280 for temperature and humidity in the same box.

Wiring

The radar needs 5 V power but talks at 3.3 V logic, so it connects straight to the ESP32 with no level shifter.

LD2410C pinESP32 DevKit pin
VCC (5V)VIN / 5V
GNDGND
TXGPIO16 (RX2)
RXGPIO17 (TX2)
OUTNot needed

TX goes to RX and RX goes to TX. Getting this backwards is the most common reason the sensor shows up in Home Assistant but never reports anything.

Don't power the radar from the 3.3 V pin. It draws enough current that it will brown out and give random readings.

The ESPHome config

The fastest route is the config generator: tick LD2410 mmWave presence and it fills in the UART settings, presence sensors and tuning controls. The part that matters looks like this:

uart:
  id: ld2410_uart
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  uart_id: ld2410_uart

binary_sensor:
  - platform: ld2410
    has_target:
      name: "Presence"
    has_moving_target:
      name: "Moving target"
    has_still_target:
      name: "Still target"

number:
  - platform: ld2410
    timeout:
      name: "Presence timeout"
    max_move_distance_gate:
      name: "Max move distance gate"
    max_still_distance_gate:
      name: "Max still distance gate"

The radar ships set to 256000 baud. Use a hardware UART for it — on a classic ESP32, GPIO16 and GPIO17 are UART2 and free by default.

How the radar sees a room

The LD2410 splits its range into gates, each 0.75 m deep by default. Gate 0 is right in front of the sensor; gate 8 ends about 6 m away. Each gate has two thresholds: one for movement and one for stillness. When the energy the radar measures in a gate rises above that gate's threshold, it reports a target.

Out of the box, every gate is fairly sensitive and the range is the full 6 m. In a small bedroom, that means the sensor happily watches the hallway through the drywall.

Tuning it so it stops lying

  1. Cut the range first. Measure from the sensor to the far wall and divide by 0.75. In a 3.5 m room, set both max distance gates to 5. This fixes most false triggers on its own.
  2. Turn on engineering mode. Add the engineering_mode switch and per-gate energy sensors (the generator's config can be extended with them; see the ESPHome LD2410 docs). With the room empty, watch which gates show energy — those are your fans, curtains and HVAC vents.
  3. Raise thresholds only on the noisy gates. Set those gates' thresholds about 10 points above the energy they show when the room is empty.
  4. Set a sensible timeout. The timeout is how long presence stays on after the last detection. 10–30 seconds works for lights; longer for climate control, where switching often wastes energy.

Because the thresholds are exposed as numbers in Home Assistant, you can tune them from your phone while standing in the room — no re-flashing.

Placement tips

  • Mount it at chest height or in a ceiling corner, pointing at where people actually sit or sleep.
  • Keep it out of the direct airflow of supply vents and ceiling fans. Moving air makes curtains and plants move, and the radar notices.
  • Radar passes through plastic and thin drywall but not metal. A 3D-printed or plastic case is fine; a metal box isn't.
  • Pair it with a PIR if you want lights to react instantly: the PIR catches the doorway entry, the radar holds presence once you're settled.

Using it in Home Assistant

Use the Presence sensor, not the moving or still sensors, as the trigger for automations. A simple and reliable pattern: turn lights on when Presence turns on, and off when Presence has been off for two minutes. The radar's own timeout plus the automation delay smooths over the moments when you're perfectly still.