We purchased some POE boards and would like to try and see what we can do with them if we get the chance.
So after weeks of testing - the radar is not as precise as we would want it to be. It acts like a motion sensor, if you stop moving, in a lot of cases it stops detecting you.
I believe it can be solved and improved by implementing some smart logic, not really improving the hardware performance. That being said it requires somebody really smart, but I believe it can be done. What I have in mind is this functionality:
-
It’s not good at detecting static targets but it’s good at noticing them move. That’s why I think it should by default state the target is still let’s say next to the kitchen table because the radar didn’t see it move anywhere else.
-
If the target didn’t leave through a specific line then it is still in the area. So, if we know that there is a wall through which the target cannot leave, it should consider the target still present. Only if the target crosses the line where it’s possible to leave, then the target should be considered gone.
If designed with more care and more specific logic I believe we could make this radar a very reliable device. It just needs a skilled programmer to do that. It would be even cooler if one could use AI to learn how the targets move and be able to prevent false detection but I guess that’s another level.
Having a graphic interface that would do that would be a blessing. Maybe some of you are working on something like this already? If yes let me know, I would love to help somehow.
Hi athua,
how should I change your config.yaml to work on my ESP32 DEVKITV1?
https://it.aliexpress.com/item/1005005988314674.html?spm=a2g0o.order_list.order_list_main.110.3f593696Hm5xOt&gatewayAdapt=glo2ita
Hi,
For your board, I would use the following TX/RX pins to connect the LD2450 to utilise Uart2 of the board:
TX2 - GPIO17
RX2 - GPIO16
So change the UART yaml to the below:
uart:
id: uart_bus
tx_pin:
number: GPIO17
mode:
input: true
pullup: true
rx_pin:
number: GPIO16
mode:
input: true
pullup: true
And try changing the board type to:
esp32:
board: esp32dev
No way.
This is the connection I did
And this is the config file I used
esphome:
name: hlk-presence
friendly_name: hlk-presence
external_components:
- source:
type: git
url: https://github.com/uncle-yura/esphome-ld2450
ref: master
components: [ ld2450 ]
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
baud_rate: 0
api:
encryption:
key: "key"
ota:
password: "passw"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
captive_portal:
web_server:
port: 80
uart:
id: uart_bus
tx_pin:
number: GPIO17
mode:
input: true
pullup: true
rx_pin:
number: GPIO16
mode:
input: true
pullup: true
baud_rate: 256000
parity: NONE
stop_bits: 1
ld2450:
uart_id: uart_bus
update_interval: 1s
invert_y: false
invert_x: false
binary_sensor:
- platform: ld2450
has_target:
name: Presence
has_moving_target:
name: Moving Target
has_still_target:
name: Still Target
presence_regions:
- name: "Custom Presence Region 0"
region_id: presence_region_0
text_sensor:
- platform: ld2450
version:
name: "FW"
mac_address:
name: "MAC address"
button:
- platform: restart
name: "ESP Restart"
- platform: ld2450
factory_reset:
name: "Factory reset"
reboot:
name: "Reboot"
switch:
- platform: ld2450
single_target:
name: "Single target"
bluetooth:
name: "Bluetooth"
number:
- platform: ld2450
rotate:
restore_value: true
initial_value: 0
name: "Rotate angle"
presence_timeout:
name: "Presence timeout"
presence_regions:
- x0: 100
y0: 100
x1: 200
y1: 200
id: presence_region_0
entry_points:
- x: 0
y: 0
region_0:
x0:
name: R0X0
y0:
name: R0Y0
x1:
name: R0X1
y1:
name: R0Y1
region_1:
x0:
name: R1X0
y0:
name: R1Y0
x1:
name: R1X1
y1:
name: R1Y1
region_2:
x0:
name: R2X0
y0:
name: R2Y0
x1:
name: R2X1
y1:
name: R2Y1
select:
- platform: ld2450
baud_rate:
name: "Baud rate"
regions_type:
name: "Regions type"
sensor:
- platform: ld2450
target_count:
name: Target count
person_0:
position_x:
name: "P0X"
position_y:
name: "P0Y"
speed:
name: "S0"
resolution:
name: "R0"
person_1:
position_x:
name: "P1X"
position_y:
name: "P1Y"
speed:
name: "S1"
resolution:
name: "R1"
person_2:
position_x:
name: "P2X"
position_y:
name: "P2Y"
speed:
name: "S2"
resolution:
name: "R2"
but no positive signals
The starnge thing is that I was expecting the LD2450 to get warm while it remain quite cold.
What is wrong?
I believe the LD2450 board requires 5V and not 3.3V so its probably not powering up hence why it feels cold.
Have you tried connecting to the LD2450 via the HLKRadarTool app using Bluetooth? If you can connect and it has values then the board is working but if not, then its likely not getting enough power.
You should be able to get 5V from the VIN pin on the ESP32 board.
In fact the HLKRadarTool app is not see it.
I will follow your suggestion and let you know.
It works perfectly, thanks
Now I will start to play with it and, I’m sure, I will ask you help again
I am having problems with setting this up. I can see myself moving about in the HLKRadarTool, setup zones in the App and see me moving thru the zones. However in Home Assistant, I only see 3 detected (even though nothing is in the room) and cannot see presence detected in different zones. Here is my config:
Screek config doesn’t expose the ld2450 zones configured thru HLK app. You have to set them manually in HA device (zone X start/end, zone Y…) and so on for all zones
I did that as shown in the images above, but it is still not showing anybody in any of the zones, but says there are 3 objects detected at the top but nothing is moving in the room.
You should try screek map generator for better visualization.
120s timeout could be your “false presence” reason
So I installed the plotly graph visualization from above, but it shows nothing. Not even the 3 ghosts the sensor detects. However, I can still see myself walking around in the HLK Radar app, so I know it is working, just not in ESPHome.
@screek-workshop do you have an esphome yaml file so I can adopt the 2A into the esphome add-on? A basic framework with a packages:
section pointing to your esphome yaml on github seems to work for other devices.
Everything looks good from the setup, but the zout seems to be too large and covers everything. As suggested above, athua’s graphic code might be helpful to give you a dynamic view of what’s happening.
That’s a great idea, and a good option for other device adaptations, we’ll try to see. But for now for universal support I think uncle-yura’s library is the more elegant choice. Of course, it will probably require setting up regions in the app.
If we get a chance, we’ll try it out and separate out the processing logic to make the code cleaner without a separate library.
I am having a rough time getting the card to work, I am much newer and unsure of what to do, can you assist me?
I do have the esphome device reporting and it does detect me.
You need to update this part to your entity names:
sensor.screek_human_sensor_2a_34ec3c_target
Probably something like sensor.mud_sensor_mmwave, but look at one of your target entities to check.
I just got this set up and was doing the card. Getting a bunch of errors because apparently the sensors are mixed in name… some of them have “human” and some have “humen” in the entity names. Wtf?
It’s hard to see why humen’s project would still exist, but it’s recommended that you try using an online code production tool, in the final version, athua’s code is placed in an online generation tool, we unify them in a single variable, and their device names will be unique, and there shouldn’t be two possibilities.
This looks like it uses the uncle_yura library, and this card code in the image may not apply.