Skip to content

Extending LD2410 Human Presence Sensor Range with ESP32 for Home Automation

ld2410 + D1 mini esp32

The LD2410 human presence sensor is a remarkable device that offers exceptional sensitivity, capable of detecting even the slightest human movement. It works natively with Home Assistant over Bluetooth, but connected that way it have some drawbacks.

LD2410 Human Presence Sensor Bluetooth Limitations

The LD2410 is affordable, priced at under $4 dollars, and its user-friendly nature make it an ideal choice for creating effective presence-based home automation setups.

This is LD2410C with Bluetooth, but the other models will work fine as well. LD2410 Human Presence Sensor Bluetooth Limitations
This is LD2410C with Bluetooth, but the other models will work fine as well

In this guide, we will explore a clever solution to overcome potential Bluetooth coverage limitations using an ESP32 board as an intermediary. By utilizing the ESP32’s WiFi capabilities, we can extend the wireless coverage while preserving the benefits of the LD2410 sensor.

Hardware Requirements:

To embark on this DIY project, gather the following hardware components:

  • At least one LD2410 sensor (Bluetooth is not a must)
  • An ESP32 or ESP8266 board, such as the D1 Mini ESP32 or similar
  • A data Micro USB cable for powering the D1 Mini and uploading ESPHome software
  • Jumper / Dupont wires for connections (optionally a breadboard)
  • Soldering iron and tin wire (if needed)

Here are some affiliate links from where you can buy everything that is needed for this DIY project:

Software Requirements:

Ensure you have the following software tools:

  • Home Assistant with Add-on store. That is our central home automation hub
  • ESPHome Dashboard for installing and managing ESPHome devices

What if you don’t have Add-on store or Home Assistant?

To learn more about Home Assistant official installation types, add-on store, their pros & cons + 1 super simple way to get started on a PC -feel free to join my Webinar where I’ll talk exactly about that.

The Webinar is free and you can reserve your seat right now from my other website https://automatelike.pro/webinar

Wiring Setup:

Here’s how to connect the components:

  • Connect LD2410 VCC pin to D1 Mini ESP32 VCC pin
  • Connect LD2410 GND pin to D1 Mini ESP32 GND pin
  • Connect LD2410 RX pin to D1 Mini ESP32 TX pin
  • Connect LD2410 TX pin to D1 Mini ESP32 RX pin

Below you can find the same thing, but in more visual way

ESP32                 LD2410
5V ------------------ VCC
GND ----------------- GND
RX ------------------- Uart-Tx
TX ------------------- Uart-Rx

Even more visual here is the final result. The resulting connection looks like this:

Extending LD2410 Human Presence Sensor Range with ESP32 for Home Automation 1

Initial Configuration:

  1. Connect the D1 Mini using a Micro USB cable to your Home Assistant and ESPHome setup for initial ESPHome installation.
  2. Create a new ESPHome device in ESPHome Dashboard.
  3. Paste the provided ESPHome configuration YAML code into the device configuration – LINK
  4. Save and install the configuration to the device.
Extending LD2410 Human Presence Sensor Range with ESP32 for Home Automation 2

LD2410 & ESP32 Home Assistant Setup:

  • Once the device is installed and operational, you can move the D1 Mini 32 and LD2410 sensor to your desired locations, as long as they have USB power and WiFi coverage – they will work!
  • In Home Assistant Integrations section, the LD2410 sensor should be auto-discovered and ready for use.
Extending LD2410 Human Presence Sensor Range with ESP32 for Home Automation 3
  • You cn create custom home automations based on presence detection. For example, you can automatically turn on lights when human presence is detected.
Extending LD2410 Human Presence Sensor Range with ESP32 for Home Automation 4

What if you want to try LD2410 over Bluetooth?

If you want to ditch the ESP32 board and to use only the LD2410 over Bluetooth in your Home Assistant – no worries. Just check any of my previous articles:

Conclusion:

By leveraging the LD2410 human presence sensor’s sensitivity and combining it with the ESP32’s WiFi capabilities, you can create powerful and flexible home automation solutions. This DIY project offers an affordable way to overcome Bluetooth coverage limitations, extending your home automation possibilities.

Feel free to share your ideas and experiences in the comments section, contributing to a vibrant community of creative home automation enthusiasts.

For simple, but useful explanations of the most common Smart Home words and Acronym download this free Smart Home Glossary available as a PDF file – https://automatelike.pro/glossary

Stay tuned for more exciting projects!

I’m Kiril, and I look forward to seeing you in the next one. Goodbye!

23 thoughts on “Extending LD2410 Human Presence Sensor Range with ESP32 for Home Automation”

  1. hi.
    i m getting that error while compiling

    The ‘timeout’ option has been moved to the ‘timeout’ number component

    1. You can get the new ESPHome code from the same link in the article. Can you please try again now and let me know what is the result?

      1. Hi Kiril,

        I have been trying this code for two days now, i tried pasting the code, i noticed that your code is for a d1 mini. So i pasted from logger and kept my initial lines for the esp8266 and board esp01_1m. I get an error after install saying:

        Failed config

        i2c: [source /config/esphome/ld.yaml:42]

        ESP8266: Invalid pin number: 21.
        sda: 21

        ESP8266: Invalid pin number: 22.
        scl: 22
        scan: True
        id: bus_a

    1. You can get the new ESPHome code from the same link in the article. Can you please try again now and let me know what is the result?

      1. Getting this error now:

        Remote branch ld2410 not found in upstream origin. source: github://regevbr/esphome@ld2410 components: – ld2410

          1. I will fix the code these days, sorry for that but I’m preparing new videos & articles and I’m super busy ATM

  2. Hi Kiril,

    The LD2410 boards have arrived, I tried to build one with an ESP8266/ESP32 board. Is it normal that the LD2410 board becomes really hot?

    Also, the config YAML does not work! The “api:” is present twice in the config. If I fixed it I got the same error as John. Could you please try and fix it!

    Thanks a lot!

    1. I will fix the code these days, sorry for that but I’m preparing new videos & articles and I’m super busy ATM

  3. Hi Kiril,

    I’ve installed the ESP like the manual above but for some reason my sensors all display unknown. Tried to do the install all over but it will not show any data. All installation went well but I can;t figure out the problem

  4. Any chance someone can provide the proper yaml file for an ESP32C3? scl pin number is too high – only 21 pins and I’m not sure what the i2c section represents. Also should note that the yaml file needs modified to match your installation’s parameters (secret/OTA update password/SSID/etc).

  5. Works flawlessly ! amazing actually. Thank you very much for these clear explanations. Any chance to propose or recommend a suitable enclosure for such two boards ? or even a 3-D printer file ?

  6. hi Kiril,
    great project! I follow your guide and i made the sensor and it work great!! I have a question: if i want to install a Light sensor like BH1750 ( it’s some lines in the yaml) how i need to wiring it? thanks

  7. Hi,
    Do you have steps for Home Assistant installs that do not have the addin store? My Home Assistant instance is running on a VM of a dietpi image and i do not have a way to install supervisor or the addin store.

    Thanks

  8. I have this information on what I can do with it

    INFO ESPHome 2024.4.2
    INFO Reading configuration /config/esphome/esphome-test.yaml…
    WARNING GPIO2 is a strapping PIN and should only be used for I/O with care.
    Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
    See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
    INFO Starting log output from ld2410-esp32.local using esphome API
    WARNING Can’t connect to ESPHome API for ld2410-esp32.local: Error resolving IP address: [Errno -5] No address associated with hostname (APIConnectionError)
    INFO Trying to connect to ld2410-esp32.local in the background

Leave a Reply

Your email address will not be published. Required fields are marked *