How to work with HLK-LD1115H and Wemos D1 Mini for Human Presence Detection

I have a HLK-LD1115H and a Wemos D1 Mini that I am trying to set up for mmWave Presense Detection like this (mmWave Presence Detection - ESPHome style - Share your Projects! - Home Assistant Community (home-assistant.io)) as one of my first more advanced projects using EspHome.

  • When logging the UART interaction I do see mov_ and occ_ values when moving in front of the sensor and when nothing is moving in front of the sensor.
  • I’m not sure how to use the Vo, sensor output pin and if it provides anything useful. I thought it would be similar to the DFRobot chip and output true/false depending on if motion is detected.
  • If the Vo pin doesn’t provide anything useful, I still need to figure out how to translate the mov_ and occ_ values to a binary sensor for use in home assistant automations.

Here is the sensor schematic for the HLK-LD1115H.

Here is the additional documentation on the HLK-LD1115H.

Here is my yaml code:

esphome:
  name: human-presense

esp8266:
  board: d1_mini

# Enable logging
logger:
  level: VERY_VERBOSE
  baud_rate: 0

# Enable Home Assistant API
api:

uart:
  id: uart_bus
  tx_pin: GPIO4
  rx_pin: GPIO5
  baud_rate: 115200
  debug:
    direction: BOTH
    dummy_receiver: true
    after:
      delimiter: "\n"
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);
      
binary_sensor:
- platform: gpio
  name: mmwave_in_bedroom
  pin:
    number: D6
    mode:
      input: true
      pullup: false

ota:
  password: otaPassword

wifi:
  ssid: SsidName
  password: SsidPassword

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Human-Presense Fallback Hotspot"
    password: "hotSpotPassword"

captive_portal:

Here’s how I wired it up:

10 Likes

Have you broken out the multi-meter and checked Vo to see what voltage is reported with and without motion/presence?

I now have a multimeter. I’m not 100% sure how to test the pin. Would I just put the multimeter on DC voltage and then put the common on the wemos d1 mini’s ground and then the red tester on the GPIO pin and then simulate motion?

Ok that worked, when there is movement, the voltage reads 3.0v. When there is no movement, the pin reads 0.

That’s good to hear, sounds like it works as expected.

I still don’t have the esphome configuration setup correctly though. I tried to use a binary_sensor like this, but it just always stays on.

binary_sensor:
- platform: gpio
  name: mmwave_in_bedroom
  pin:
    number: GPIO16

I think the next logical step in testing would be;

  • disconnect everything from GPIO16 and confirm state
  • apply 3-3.3V to GPIO16 from a DC PSU and confirm state

Use option mode:INPUT_PULLDOWN

binary_sensor:
  - platform: gpio
    name: mmwave_in_bedroom
    pin:
      number: GPIO16
      mode: INPUT_PULLDOWN

Tired this, no luck. The binary sensor always stays off.

Here is mine reporting both presence and occupancy.
I use only UART.

Hi, I use this config and works for me, try changing the port and config:

binary_sensor:
- platform: gpio
  name: occup_cozinha
  pin:
    number: GPIO17
    mode:
      input: true
      pulldown: true

Great work !

Some time need to power down the radar or plug out the Tx Cable, or ESP32 might boot fail.

2 Likes

Here is the config I’m using in the last week. If you put in right position works every time.

I get this error

ERROR Error while reading config: Invalid YAML syntax:

while parsing a block mapping
in “/config/esphome/esphome-web-d25724.yaml”, line 154, column 3:
- platform: gpio
^
expected , but found ‘’
in “/config/esphome/esphome-web-d25724.yaml”, line 159, column 5:
mode:
^

Edit: number: ${LD1115H_INPUT_PIN} has extra indent

binary_sensor:
- platform: gpio
  name: occup_${location}
  device_class: occupancy
  pin:
      number: ${LD1115H_INPUT_PIN}
    mode:
      input: true
      pulldown: true

I can get yours running for a few seconds then the esp32 will hang

Edit:
If i don’t open the web server or put my hand to close to the sensor it doesn’t hang the esp32 anymore.

To avoid esp32 hangs try removing this options:

logger:
  level: VERY_VERBOSE
  baud_rate: 0

Hello. Can you please share the whole datasheet for the sensor? I hope what is in the photo is not the whole document. I have the sensor working and outputting data right now but I want to make it configurable via ESPHome. Now I am sending commands and nothing changes.

1 Like

Hi Vladimir,

I’ve also requested the “datasheet” from the supplier. You can find it here

1 Like

I’m so glad I found this thread! I’ve also ordered the HiLink HLK0LD1115H as a substitute to the DFrobot-variant. I had some trouble hooking everything up, but using this thread helped me a lot.

I’ll come back if I get some of the solution above working :slight_smile: