A Smarter Alternative to PIR for Presence Detection using the HLK-LD2402
When it comes to smart home automation, detecting presence accurately and reliably is a big deal — especially in areas like a garage, where false triggers or missed detections can become a daily annoyance.
After struggling with traditional PIR sensors — which either respond too slowly or fail to detect subtle movements — I decided to experiment with a mmWave solution: the HLK-LD2402.
This sensor is a compact, cost-effective 24GHz mmWave radar module that boasts impressive capabilities for human presence detection, including support for identifying stationary humans, distance measurement, and multi-zone detection. But as I quickly found out — getting it to work with ESPHome was a bit of a journey.
Why Choose mmWave Over PIR?
PIR (Passive Infrared) sensors work by detecting changes in infrared radiation caused by motion. They’re simple and inexpensive, but they have some well-known limitations:
- ❌ Poor at detecting stationary presence (e.g., someone sitting still in a chair or car)
- ❌ Sensitive to ambient temperature changes and direct sunlight
- ❌ Limited range and narrow field of view
The HLK-LD2402, by contrast, uses radar waves to detect even the slightest movements, making it ideal for spaces like garages, offices, or bedrooms, where subtle presence matters.
The Search for a Working ESPHome Integration
The HLK-LD2402 communicates over UART using a custom protocol. Unlike some other mmWave modules (like the LD2410 or LD2450), it doesn’t have official ESPHome support out of the box — so I had to get my hands dirty.
The datasheet (mostly in Chinese), wasn’t easy to parse, and community resources were limited. After a lot of time digging, I finally found a GitHub Repository with an ESPHome driver for the LD2402. Around the same time, Hi-Link generously shared:
- An English version of the manual
- A Windows-based configuration tool (in Chinese)
After some trial and error, I got the module successfully integrated into ESPHome. Here’s what I was able to extract from it:
- Presence detection (true/false)
- Distance to target
- Confidence level of the detection
- MicroMovement
Once integrated, the sensor became remarkably responsive, accurately detecting both moving and stationary presence.
🔧 Note: I’m still having issues getting the ESPHome logger to output debug data from the sensor. It’s not a dealbreaker, but it’s something to keep in mind.
I successfully interfaced with ESPHome and Home Assistant.
How I’m Planning on Using It
🚗 Garage Controller: Presence + Lighting
I’m currently building a Garage Door Controller (more on that in another post), and the HLK-LD2402 is a key component.
Instead of relying on a PIR sensor to detect motion (which often fails to detect someone quietly working in the garage), this mmWave module provides consistent, reliable presence detection.
Here’s how I’m planning on using it:
- Presence = True ➜ Turn on the lights, keep them on as long as someone is inside.
- Presence = False for 5+ minutes ➜ Automatically turn off the lights (adjustable timeout)
- Bonus: Use it as a safety check before closing the garage door.
- Extra: Can act as a security sensor to detect presence or movement when I’m away on vacation.
🛋 Room Sensor: Light + Climate Automation
I’m also designing a Room Sensor, and the HLK-LD2402 will play a big role here too.
The idea is to use the sensor to:
- Automatically manage lights in each room
- Control air conditioning and heating based on actual presence
- Potentially eliminate the need for physical light switches altogether
If the accuracy continues to hold up, it could transform the way I approach smart occupancy sensing in my home.
Final Thoughts
The HLK-LD2402 mmWave sensor is a fantastic option if you’re looking for accurate, reliable presence detection, especially in environments where PIR sensors fall short.
With some effort (and a bit of tinkering), it integrates well with ESPHome and opens the door to much smarter and context-aware automation.
In my Garage Controller project, it’s already improving safety, convenience, and energy savings. If you’re tired of waving your arms to keep the lights on — give mmWave sensing a try. You probably won’t go back.
Want to Try It Yourself?
If you’re building your own room or garage automation system and want help getting the HLK-LD2402 working in ESPHome, feel free to reach out or check out updates on my project over at homeautomations.xyz.

Leave a Reply