ESP Projects

Build an mmWave presence sensor with the LD2410 and ESPHome

By Ross · Updated November 18, 2026

Disclosure: As an Amazon Associate I earn from qualifying purchases. Links to parts on this page are affiliate links, some through brand partnerships, so I may earn a commission at no extra cost to you. It never changes which parts I recommend.

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.

Cost
$12–18
Time
30 minutes
Difficulty
Beginner
Skills
4 jumper wires, no soldering

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.

Wiring diagram: Build an mmWave presence sensor with the LD2410 and ESPHome
Wiring diagram. Click to open full size.

The ESPHome config

Build this config in the generator Pick your board, adjust pins, and copy a ready-to-flash config with fresh keys.

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.

Choosing the temperature sensor

The BME280 in the parts list is a fine start, but it tends to read a degree or two warm in a small box: the chip heats itself a little, and the ESP32 and radar heat the air around it. If the temperature drives anything, like a heater or a fan, a Sensirion SHT3x sensor is the more accurate choice. Sensirion rates the SHT31 at ±0.2 °C and ±2 % humidity typical, and the SHT35 at ±0.1 °C and ±1.5 %.

  • SHT31-D temperature and humidity sensor
    SHT31-D temperature and humidity sensorView on AmazonIllustration
  • SHT35 temperature and humidity sensor (higher accuracy)
    SHT35 temperature and humidity sensor (higher accuracy)View on AmazonIllustration

Either one wires exactly like the BME280: VIN to 3.3 V, GND to GND, SDA to GPIO21, SCL to GPIO22. It has no pressure reading, so swap the BME280 block in the config for this:

i2c:
  sda: GPIO21
  scl: GPIO22

sensor:
  - platform: sht3xd
    address: 0x44
    update_interval: 30s
    temperature:
      name: "Room temperature"
    humidity:
      name: "Room humidity"

Whichever sensor you use, mount it below the ESP32, or outside the box on short leads, so the board's heat rises away from it. If the ADDR pin is tied high, the address is 0x45 instead.

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.

A real build: shop presence sensor

Working LD2410C presence sensor: an ESP-32S NodeMCU board wired with jumper wires to an HLK-LD2410C radar and a BME280 sensor
The working shop sensor: an ESP-32S NodeMCU board, the HLK-LD2410C radar and a BME280, joined with female-to-female jumper wires. Click for full size.

This is the guide's build, running in a workshop. It uses the parts list above: the board is an ESP-32S NodeMCU, one of the common 30-pin ESP32 DevKit boards, wired to an HLK-LD2410C and a BME280 with jumper wires and no soldering. Its job is simple: switch on a smart power strip outlet when someone is in the shop, and switch it off a minute after the shop empties. The BME280's temperature and humidity go on a Home Assistant dashboard card.

The problem it hit: the room next door

The shop shares a wall with an apartment, about 6–8 ft (2–2.5 m) from the sensor, and out of the box the radar picked up people moving on the other side. That's the drywall problem described above, and the fix is the same: cut the range so the radar stops short of the wall. At 0.75 m per gate, 2 m is gate 2, so set both max distance gates to 2 and check again; if it still sees through the wall, lower them by one. Then raise the movement thresholds on the farthest gate that's left if anything still leaks through.

The automation

One automation handles both directions. Change the two entity IDs to match your sensor and outlet:

alias: Shop outlet follows presence
mode: restart
triggers:
  - trigger: state
    entity_id: binary_sensor.shop_presence_sensor_presence
    to: "on"
    id: occupied
  - trigger: state
    entity_id: binary_sensor.shop_presence_sensor_presence
    to: "off"
    for: "00:01:00"
    id: empty
actions:
  - choose:
      - conditions:
          - condition: trigger
            id: occupied
        sequence:
          - action: switch.turn_on
            target:
              entity_id: switch.shop_power_strip_socket_1
      - conditions:
          - condition: trigger
            id: empty
        sequence:
          - action: switch.turn_off
            target:
              entity_id: switch.shop_power_strip_socket_1

The one-minute delay is short because it's an outlet, not lights: there's no harm in it switching off quickly, and the radar's own timeout already covers moments of sitting still. For lights in a room you sit in, two minutes or more is kinder.

For the dashboard, add an Entities card with the temperature and humidity sensors, or two Sensor cards if you want the history graph.

Frequently asked questions

What's the difference between an mmWave presence sensor and a PIR sensor?

A PIR sensor only notices movement, so it loses you once you sit still. A 24 GHz mmWave radar like the LD2410 picks up the small movement of breathing, so it keeps reporting that someone is in the room.

Why does my LD2410 detect presence in an empty room?

Usually something in the room is moving, such as a fan, curtains or plants in the airflow, or the sensitivity is too high for the far gates. Lower the energy thresholds on the gates that trigger, or shorten the maximum distance.

Does the LD2410 work with ESPHome?

Yes. ESPHome has a built-in ld2410 component that reports presence, moving and still targets, distances and per-gate energy, and lets you tune the gates from Home Assistant.

Can an mmWave radar see through walls?

It passes through plastic and thin drywall, so it can pick up movement in the next room if it's pointed that way. It doesn't pass through metal, so don't mount it in a metal box.

Troubleshooting

SymptomLikely cause and fix
All sensor values show UnknownTX and RX are swapped, or the baud rate is wrong. The LD2410 talks at 256000 baud by default.
Values stop updating after a whileUsually power. Feed the radar from 5 V, not 3.3 V, and keep the jumper wires short.
Presence stays on in an empty roomIt is seeing a fan, curtain, or the room next door. Lower the far gates' still thresholds, or cut the max distance.
Presence drops while someone sits stillStill thresholds are too high for those gates. Turn on engineering mode, watch the still energy while you sit, and set the gate just below it.
Bluetooth app can't find itBluetooth may have been turned off in the config. Turn it back on from the switch ESPHome exposes.