mmWave Presence Detection - ESPHome style

I follow Andreas’s advice now and use his “priority #1” pins (~ 05:53 in vid).

Way fewer headaches and rooky pin schema mistakes since I’ve started doing that.

Hlktech / Hi-Link has a few 24G mmWave sensors:

Has anybody tried to work with them?

1 Like

We look forward to hearing your reports on the [insert random aliexpress sensor here] :slight_smile:

Hey,
i have HLK LD1115H working with my Wemos D1 mini.
It detects Movement and Presence, also doing it blazingly fast.

Can you tell us more about it?

The Hi-Link site has some detail but brings up a few more questions:

  • do you have a datasheet detailing the serial comms?
  • where do you have this deployed as the range looks somewhat limiting:
    “Antenna half power angle horizontal ±57°, vertical ±24°”
  • how accurate is the “static body detection coverage radius 2m” ? this would be a deal-breaker for me
  • does it output any additional information? (distance/direction/etc)
  • what configuration parameters does it accept?
  • what is the minimum hold/delay/latency for Occupied-to-Unoccupied?

We have learned from our SeeedStudio experience that the details can make or break a sensors use-case flexibility.

Disclaimer: I am a noob.

So I bought these sensors as DFrobot was soldout everywhere.

To answer all your questions:

  • Yes, I have a data sheet
  • It’s located in my bedroom and covers whole room. I guess you should read those abngles as 114° horizontal and 48° vertical.
  • As I have it working only for two days, I cannot talk about extensive results, but so far it detects static body accurately.
  • For outpu info and setting: see image attached

I hope someone with real programming skills could make it more adjustable, as I only managed to set it to report static body detection and movement, without any adjustments.

1 Like

Thanks for the details.

I think I follow now regarding the angles.

Have you tested static presence beyond 2M? I think that’s the biggest consideration.

For some reason I don’t see the datasheet available for download. Did you have to contact them? Can you share?

I just contacted them on AliExpress and they sent me the datasheet.

Additional info: i just have tested static presence. Up to 5m it detects presence with no issues so far. above that not so well.

I’m thinking of getting HLK-LD1115H too, mine sharing your code in ESPHome?

1 Like

I would also love to see sample esp home code when you have time to share.

1 Like

I’m getting “mov” and “occ” values through the debugger finally using the HLK-LD1115H. I tried to set up a binary_sensor like the DFRobot config here: ESPHome Config for DFRobot mmWave SEN0395 Sensor (github.com) but I can’t get it working yet.

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: D2

Since this is a different sensor, it likely requires a different solution.

Would recommend posting a separate thread including;

  • wiring diagram
  • sensor datasheet
  • yaml
  • testing results from GPIO w/ multimeter

Yes, me three. My current pir setup needs improvement.

Hi. Thanks for all the effort and assistance in this project. I’ve connected the dfrobot sensor with a d1mini esp32 board and everything works as expected. Unfortunately when I tried to turn off the blinking led on the sensor, the code seems to go through but the led still blinks. Is there some specific gpio pins i need to use for disabling the led. Below are the pins i’m using. Everything else is the same as your code. Thank you.

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

sensor:
  - platform: adc
    pin: GPIO35
    name: "Master Bedroom Illuminance"
    update_interval: 10s
    unit_of_measurement: lx
    attenuation: 11db
    filters:
      - lambda: |-
          return (x / 10000.0) * 2000000.0;

uart:
  id: uart_bus
  tx_pin: GPIO22
  rx_pin: GPIO21
  baud_rate: 115200
  debug:
    direction: BOTH
    dummy_receiver: true
    after:
      delimiter: "\n"
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);

Make sure you have the TX and RX pins the correct way would be my first guess

Hmm the TX pin on the sensor is connected to GPIO22 and RX pin is connected to GPIO21. Do i need to go with another GPIO pins?

You will want to make sure that it looks like: TX → RX & RX → TX

here is mine setup:

uart:
  id: uart_bus
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 115200
  stop_bits: 1
#  debug:


text_sensor:
- platform: custom
  lambda: |-
    auto my_custom_sensor = new UartReadLineSensor(id(uart_bus));
    App.register_component(my_custom_sensor);
    return {my_custom_sensor};
  text_sensors:
    id: "uart_readline"
    filters:
      - lambda: |-
         if(x=="mov") {
         id(mov_binary_sensor).publish_state(true);
         id(mov_binary_sensor).publish_state(false);
         }
         if(x=="occ") {
         id(occ_binary_sensor).publish_state(true);
         id(occ_binary_sensor).publish_state(false);
         }
         return x;

binary_sensor:
  - platform: template
    name: "Movement"
    id: mov_binary_sensor
    filters:
      - delayed_off: 2s
  - platform: template
    name: "Presence"
    id: occ_binary_sensor
    filters:
      - delayed_off: 2s
1 Like

Yep as @crlogic says you need to make sure you are not going RX > RX and TX > TX, they should be the other way around