Diy HomeAssistant motion and presence sensor (use LD2410b and esp32c3 with esphome)

By combining the ESP32C3 and the smart LD2410C to work together, and using the excellent and flexible ESPHome firmware, we can now make HomeAssistant easily sense the human body, and track distance and energy value changes easily through Bluetooth and the configuration APP (HLKRadarTool) combined with radar , allowing you to adjust the range of activities you want to perceive very flexibly and conveniently.

The product uses Type-C power supply, which is very convenient.

Using a well-designed 3D printed shell (designed by CSZ), it can be easily pasted on the wall, and the side with the Logo is facing the direction you want to sense. From then on, your HA can flexibly sense people coming and going up.

feature of product:

  • Using ESP32C3, it has better RF signal and better signal stability.
  • Well-tuned Esphome firmware, the signal is more stable, and it can make C3 work better.
  • Support serial network configuration (improv_serial)
  • Quickly access HomeAssistant, automatically scan for new devices, and add them quickly.
  • Get the brightness of daylight by reading the photoresistor on the radar.

Instructions:

  • After power on, use the default AP hotspot (SCREEK HUMAN-SENSOR) to configure the network. The default AP does not have a password, just connect directly.
  • After configuration, HomeAssistant in the same LAN can discover the device and complete the addition.
  • Use the mobile phone APP that comes with the radar to configure the APP parameters through Bluetooth.

We made extra kits besides our own use, so if you like our design, we can send it all over the world :slight_smile:

base yaml source:

esphome:
  name: screek-humen-dectet-1w
  comment: Screek Human Presence Sensor 24GHz PS-HPS
  friendly_name: Screek Human Presence Sensor
  name_add_mac_suffix: True
  platformio_options:
    board_build.flash_mode: dio
  project: 
    name: Screek.Human_Presence_Sensor
    version: 1W
  
esp32:
  board: esp32-c3-devkitm-1
  
improv_serial:
  

logger:


api:

ota:
  password: "OTA_PASSWORD"

wifi:
  power_save_mode: NONE
  # output_power: 20dB
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "SCREEK HUMAN-SENSOR"

captive_portal:

web_server:
  port: 80

binary_sensor:
  - platform: status
    name: Online
    id: ink_ha_connected
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target

sensor:
  - platform: template
    id: sys_esp_temperature
    name: ESP Temperature
    lambda: return temperatureRead();
    unit_of_measurement: °C
    device_class: TEMPERATURE
    update_interval: 30s
    entity_category: "diagnostic"
  - platform: uptime
    name: Uptime
    id: sys_uptime
    update_interval: 10s
  - platform: wifi_signal 
    name: RSSI
    id: wifi_signal_db
    update_interval: 1s
    entity_category: "diagnostic"
  - platform: template
    id: esp_memory
    icon: mdi:memory
    name: ESP Free Memory
    lambda: return heap_caps_get_free_size(MALLOC_CAP_INTERNAL) / 1024;
    unit_of_measurement: 'kB'
    state_class: measurement
    entity_category: "diagnostic"
  - platform: ld2410
    moving_distance:
      name : Moving Distance
      id: moving_distance
    still_distance:
      name: Still Distance
      id: still_distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: Detection Distance

light:
  # - platform: status_led
  #   name: sys_status
  #   pin: GPIO12
  #   internal: True
  #   restore_mode: ALWAYS_OFF
  # - platform: status_led
  #   name: sys_status
  #   pin: GPIO13
  #   internal: True
  #   restore_mode: ALWAYS_OFF

time:
  - platform: sntp
    id: time_now
    servers: 
      - ntp.aliyun.com      

uart:
  id: uart1
  tx_pin: GPIO5
  rx_pin: GPIO4
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  timeout: 150s
  id: ld2410_radar
  # max_move_distance : 6m
  # max_still_distance: 0.75m
  # g0_move_threshold: 10
  # g0_still_threshold: 20
  # g1_move_threshold: 10
  # g1_still_threshold: 20
  # g2_move_threshold: 20
  # g2_still_threshold: 21
  # g3_move_threshold: 30
  # g3_still_threshold: 31
  # g4_move_threshold: 40
  # g4_still_threshold: 41
  # g5_move_threshold: 50
  # g5_still_threshold: 51
  # g6_move_threshold: 60
  # g6_still_threshold: 61
  # g7_move_threshold: 70
  # g7_still_threshold: 71
  # g8_move_threshold: 80
  # g8_still_threshold: 81

button:
  - platform: restart
    icon: mdi:power-cycle
    name: "ESP Reboot"
  - platform: factory_reset
    disabled_by_default: True
    name: Factory Reset
    id: factory_reset_all

and the 3d case stl file is here:
3d case

2 Likes

Your yaml for esphome is where?

Your 3d printer files are where?

Not trying to be impolite, but this is an open source community, not a marketplace :slight_smile:

Edit: thanks for fixing that.

i very sorry, i will post them by tomorrow!

the source and the case just upload!

This is amazing work! I’d like to try and build one before buying (no problem paying for good work!), but I don’t seem to be able to find the same form factor as pictured for the LD2410C. What am I missing?

Hi. Where does the yaml code describe brightness of daylight by reading the photoresistor on the radar?

Glad you like it! If these additional modifications need to be modified to the radar library, we will publish some of our modified codes for the library later, including removing some initialization codes, because it will overwrite the settings of the Bluetooth app every time.

This is the engineering mode that needs to open the radar, and also requires some connections to the library and protocol, and the firmware of the radar needs to be upgraded to 2.0. Later, we will update the code of a radar library we use ourselves. Please allow us to tidy up the code a little bit and remove the Chinese comments that may seem confusing.

It’s a recently released model and I don’t know if you can buy it on AliExpress. We can put some in there if needed. But I’m afraid we will not have a very cost-effective shipping fee, we are individual hobbyists and not a commercial organization, I am very sorry.

I looked for it, and this is the radar of the same model as ours:
https://www.aliexpress.us/item/3256804183158520.html?gatewayAdapt=glo2usa4itemAdapt&_randl_shipto=US

1 Like

Sorry, I found time to sort out the code and put it in github, please check it out, I hope it can help you.

Among them, you need to ensure that the firmware is above version 2.0. I have attached a picture to show how to identify the firmware version.

Hi.
How to resolve this yaml line?

external_components:

  • source: screek-mod-components

How do I put this folder inside ESP32. Or where should l put it?

just place in the same yaml file ,it should work!
ref:

I can see that your app is partly translated to English. The one i could find is solely in Chinese and that makes it rather hard to read and use. Do u have a download link to your app. Thanks for the help

You need change local on your phone in English.

2 Likes

The public information can be found here, the software supports English, but because part of the 2.0 firmware is an internal test, that is, it is not fully English civilized, and those settings are related to the light.

https://drive.google.com/drive/folders/1p4dhbEJA3YubyIjIIC7wwVsSo8x29Fq-?spm=a2g0o.detail.1000023.17.93465697yFwVxH

Hello.
There is a newer version HLKRadarTool 1.1.10 https://www.pgyer.com/Lq8p?spm=a2g0o.detail.1000023.17.3b3d31f9d94Xtl
Can you translate it?

A new version, do not know what new features have been added!

I’m using the ios version, I don’t know if it’s the same as this one. I’ll see if I can find an Android phone to look at the interface, and I think what I can do is probably make a simple schematic of the interface.
I will try it out.

We tested the app link you provided and found that the interface is almost the same as the old version. We provide a reference interface and some English translations in Chinese, hoping to help you:

https://ha.screek.tech/presence_sensor/hilink_app/#english-translation

We provide a simple translation for some of the strange square words in the newer firmware.

https://ha.screek.tech/presence_sensor/hilink_app/#english-translation

Thanks for that effort

I own Heiman human presence can I program it to that ? It is a ceiling mounted with direct AC power