HLK-LD1115H mmWave sensor with D1 Mini

Hi,

I’m trying to use a mmWave sensor with a D1 Mini and have done following so far:

esphome:
  name: test_board_2

esp8266:
  board: d1_mini


logger:
  level: DEBUG
  baud_rate: 0
wifi:
  ssid: !secret ssid
  password: !secret ssid_password
  fast_connect: true
api:
ota:
captive_portal:
switch:
  - platform: restart
    name:  Restart
    id: restart_device
binary_sensor:
  - platform: gpio
    name:  mmWave
    pin:
      number: GPIO16
      mode: INPUT_PULLDOWN
uart:
  id: UART_BUS
  tx_pin: RX
  rx_pin: TX
  baud_rate: 115200

The board boots up and recognized under ESPHome but the mmWave sensor is “on” all the times and I do not see any UART output either, here is log for reference:

[22:05:27][C][wifi:368]:   DNS2: 0.0.0.0
[22:05:27][C][logger:233]: Logger:
[22:05:27][C][logger:234]:   Level: DEBUG
[22:05:27][C][logger:235]:   Log Baud Rate: 0
[22:05:27][C][logger:236]:   Hardware UART: UART0
[22:05:27][C][uart.arduino_esp8266:102]: UART Bus:
[22:05:28][C][uart.arduino_esp8266:103]:   TX Pin: GPIO3
[22:05:28][C][uart.arduino_esp8266:104]:   RX Pin: GPIO1
[22:05:28][C][uart.arduino_esp8266:106]:   RX Buffer Size: 256
[22:05:28][C][uart.arduino_esp8266:108]:   Baud Rate: 115200 baud
[22:05:28][C][uart.arduino_esp8266:109]:   Data Bits: 8
[22:05:28][C][uart.arduino_esp8266:110]:   Parity: NONE
[22:05:28][C][uart.arduino_esp8266:111]:   Stop bits: 1
[22:05:28][C][uart.arduino_esp8266:115]:   Using software serial
[22:05:28][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'mmWave'
[22:05:28][C][gpio.binary_sensor:016]:   Pin: GPIO16
[22:05:28][C][restart:022]: Restart Switch 'Restart'
[22:05:28][C][restart:022]:   Icon: 'mdi:restart'
[22:05:28][C][captive_portal:088]: Captive Portal:
[22:05:28][C][mdns:084]: mDNS:
[22:05:28][C][mdns:085]:   Hostname: test_board_2
[22:05:28][C][ota:085]: Over-The-Air Updates:
[22:05:28][C][ota:086]:   Address: test_board_2.local:8266
[22:05:28][C][api:138]: API Server:
[22:05:28][C][api:139]:   Address: test_board_2.local:6053
[22:05:28][C][api:143]:   Using noise encryption: NO

The wiring is as follows:
VCC - 5V from power supply - 5V on D1
All GND connected
VO - GPIO16 (D0) on D1
URX - TX (D1 Mini)
UTX - RX (DI Mini)

Any pointers will be appreciated!

Looks like lots of useful information in this thread:-

https://community.home-assistant.io/t/how-to-work-with-hlk-ld1115h-and-wemos-d1-mini-for-human-presence-detection

Some good news, I stepped away to get a beer and seems like the sensor is not always “On” as I thought…well its a presence sensor so not sure what I was thinking!!!

Seems like UART pins are the way to calibrate its sensitivity and range which I am not able to do with my code and wiring.

So presence sensor is working and now its down to just the UART stuff!

I read the thread and tried incorporating some of the stuff but nothing is marked as a solution. Thanks for the pointers.

Just did another testing, connected the RX/TX and V0 pin of the mmWave board with a USB to serial converter (see pics below) and powered the mmWave separately on a breadboard with 5V power supply. The serial console of mmWave showed lot of output like “mov”, “occ” and lots of numbers. I’m guessing that it stands for “motion or movement” and “occupancy”.

ttl

So the mmWave is working fine and outputting data on the V0 port, so if anyone have any idea how to output the data from V0 on UART (D1 Mini), please send your pointers.

The LD1115H is tricky to work with, especially using stock settings. Configuring sensitivity is essential. Sadly there is no distance setting available.

Config code can be found in the mmWave Wars thread.

My confusion is that the LD1115H is producing output on its serial port (V0), I saw text (just like the one in the manual) come through when I connected LD1115H to the TTL adapter without D1 Mini.

mmWave

So why am I not able to get the same output in Home Assistant via D1, it seems like something I am doing incorrectly either in D1 wiring or ESPHome code.
Thoughts?

You must enable UART debugging if you want that output in the logs.

2 Likes

Excellent, worked like a charm :sunglasses: