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

I have a chance to let the sensor sit with no one in the room (over night) There were a couple of false positive triggers. Anyone experience any false positive?

This is what I came up with. There will be no case as it will be inside an AC cable trough. The loose wires you see will be for DHT22 temp sensor.

Updates: Made some changes to my setup. I have added a photocell light sensor to the esp8266.

@chrisgozd92 - just got one of these to test.

Do you have more datasheet info? The one posted in the OP is missing some parameters and I wonder what they are…

[16:51:56][D][uart_debug:158]: >>> "get_all\n"
[16:51:56][D][uart_debug:158]: <<< "th1 is 130\r\n" 
[16:51:56][D][uart_debug:158]: <<< "th2 is 250\r\n" 
[16:51:56][D][uart_debug:158]: <<< "th3 is 1500\r\n"
[16:51:56][D][uart_debug:158]: <<< "ind_min is 2\r\n"
[16:51:56][D][uart_debug:158]: <<< "ind_max is 32\r\n"
[16:51:56][D][uart_debug:158]: <<< "mov_sn is 3\r\n"
[16:51:56][D][uart_debug:158]: <<< "occ_sn is 5\r\n"
[16:51:56][D][uart_debug:158]: <<< "dtime is 5000 mS\r\n"

Was going to take a stab at building a parser to keep delay/sensitivity/etc settings in sync.

So I don’t know what they all do…

…or what their value ranges are…

…but they sync

After playing around w/ this sensor for a very short period of time, I have a few observations that would benefit others confirming/challenging.

HLK-LD1115H Behavioral Observations

  • the “movement” vs “occupancy/presence” delineation is curious yet harmless as far as I can tell. The benefit of it appears to be the ability to “tune” each detection threshold individually.
  • the detection thresholds appear to be in some form of SNR (signal-to-noise ratio) where higher is better. The con of this is that we don’t have distance or sensitivity. A large target far away is likely the same SNR as a small target up close :confused:
  • the unknown th3 appears to impact th2/occ
  • it is unclear what target index min/max has on detection
  • settings are performed live which is nice compared to Leapmmw sensors
  • there is no way to disable the mov/occ uart output which is very noisy!
  • the sensor allows you to set SNR values “incorrectly”.
    ** eg th1 higher than th2
    ** th1/mov should be a lower SNR than th2/occ in order for the labels to “make sense”

Side-by-side

I temporarily installed the 1115H beside a DFRobot overnight; they appear roughly the same. If not a little more sensitive. Cats are hard to detect. But there isn’t a baseline here so “grain of salt” warning applies.

Settings Update

I heard back from HLK who provided a few more tidbits on info. Such as the max value setting for th1, th2 and th3 is 65536. And that th3 is for “the long distance” setting which is anything over 12M.

Additionally, the ind_min/max “are for engineering” and that you shouldn’t change it… :wink:

2 Likes

Guys, I almost broke down and cry after spending couple of days setting up the device. I tested all settings using my pc usb as power. Never did it once failed. After I got it all working, I proceed to solder the wires and tear down my old setup and replace it with this new one. When I went to power the ESP8266, it didn’t get a signal or connection. HA shows grey entities. Tried a few other outlets and usb cables. No go. I plug it back in to the pc usb and it came up quick fast. So the device isn’t getting enough power some how using other usb power adapters which is very odd. First time I experience after having quite of few esp devices.

I thought back a few months where user tom_l had posted his quick fix of adding 2 capacitors to a esp device he had wifi issues. I did the same with another esp of mine, but it didn’t help with the wifi issue. I added the capacitors to my current project and the connection came up. R-E-L-I-E-F.

This is what I did. Added 2 capacitors (0.1uF 50V + 220uF 16V) to the gnd and power of the esp8266.

3 Likes

Does anyone knows if binary_sensor.esp_radar_occupancy_or_movement triggers to movement if humans are not moving/sleeping? I am trying to see if I can use this entity as a presence detection if someone or no one is home. It seems to work if humans is in the same room as the radar, but if in another room, it stays at clear.

It can work, just modify the TH1 and TH2 and Clearance Time by your environment.

I have tried. But isn’t TH1 just for the movement entity and the TH2 just for the occupancy entity?
I played around with the TH2, but it isn’t accurate for me. Not sure if it is detecting my neighbors on both side of the walls. I just have one of the radar and is placed in the opposite end of the main entrance door. What is your TH2 settings just to give me a rough idea.

Do not recommend using anyone else’s values. The best tuning is specific to your room, placement, intended targets and potential interference.

Best thing to do is actually observe the SNR for movement/occupancy in order to understand what target value might work for you.

If the target SNR values “dip below” the mov/occ setting, then the sensor reports no movement/occupancy. Therefore each target value must be lower that what you observe. And since distance and target size all influence the SNR, you can’t just paste in someone else’s number in order to avoid the necessary tuning work.

9B594567-9D94-47F3-BA7E-F3E46A1B4DC9

My current gut feeling is that the Hi-Link LD2410 will be a better sensor than the LD1115H for the simple fact that it offers distance configuration in addition to sensitivity adjustments. This greatly expands the placement opportunities; especially if your walls are thin :wink:

If you aren’t sure, test it! You have an interior wall you can access both sides of ? I hope you have bathroom!!

1 Like

@duceduc - here is an example of the challenges of the LD1115H.

Here is a screenshot of three sensors in a room with no people, but two fans :crazy_face:

Since the rooms is empty, I expect all sensor to be off. But they don’t start that way because fans…

With the LD2410 and DFRobot I can reduce the distance in order “exclude” the fans from the “search area” (placement strategy). Sadly the LD1115H does not support this to my knowledge. So for the LD1115H all I can do is reduce sensitivity.

For the DFRobot I can then test different sensitivity settings in order to determine what is appropriate (increased sensitivity).

For the LD2410 it provides an SNR report which make the sensitivity adjustments easier (increased sensitivity). The LD2410 is also very narrow so that helps here (to the detriment of other use-cases).

Here we have three sensors and an empty room;


Taking those settings, we test the hardest use-case; sleeping…

As you can see, the DFRobot and LD2410 did well. But there were a couple of false positives w/ the LD1115H. So not quite dialed in yet. Therein lays the challenge. Being able to configure it with enough sensitivity to capture the target use-case while not being so sensitive that is it “always on” because it is configured below the noise floor for the deployment.

3 Likes

I just received my LD1115H sensors, I was thinking of buying another LD2410, they impressed me with their size. I have questions: what code are you using for the LD2410? It probably won’t be the same as for the LD1115H or is it and something needs to be modified in the code?

Here ya go; https://github.com/rain931215/ESPHome-LD2410

2 Likes

Thank you very much for your quick reply, I appreciate it.
In the near future I will start working on the first sensors and see where I get to. :+1:

Interested to hear the results of your testing.

A few tidbit from emails w/ HLK about the LD1115H;

  • it does not support distance
  • th3 is “long range” so try setting this value really high
  • th1 is also very sensitive (up to 16M?) so try increasing this value (more movement needed to trigger)
  • mov_sn impacts sensitivity as well. I am working on figuring out if a low value is more sensitive. It seems this way.
  • likewise occ_sn impacts static senstivity and it seems a higher value (up to 16) is less sensitive.

More sleep testing tonight. I’ve ruled out the fans/AC using the following settings since the LD1115H stayed on most of the day. Testing these tonight

The HLK datasheets are very poor so I have been spamming them w/ questions and I am not sure they like that.

5 Likes

Hi, just to verify, is this the same LD2410 you are testing now?

This is from my local marketplace

So technically would you say this works better than LD115H and cheaper?

Btw, could you share your LD115H esp config?
When you mention adjustable distance, if my ceiling fan is around 8ft, i could just lower the detection distance below that to avoid picking up fan movement?

Can’t say better or worse quite yet. Still testing! I’ll summarize and post code when done. There is other code out there to get started.

LD1115H doesn’t have distance setting, only LD2410. Which is pretty coarse, 0.75M, give or take. If you get a 2410, get their USB dev board. Is has 1.27mm to 2.54 header spacing conversion built in.

Thanks, looking forward for that
Just noticed the distance setting in your screenshot, does it work something like this?

Did you mean for this one with the usb dev board?
image

The LD2410 max distance configurable is 6M, which I haven’t tested. But reducing does works. It is much narrower FOV so it is better at ‘targetted’ applications such as a desk or bed than a room.

I can’t find the dev board again. They didn’t have header cables in stock when I got mine. I’ll keep looking.

I see, so that’s the general difference

I’m trying out the esp config from here

The occupancy keeps changing to clearence eventhough i’m just sitting down so I’m still tuning th1 values