LD2410 esphome tips

hi, gus, it’s seems the new ld2412 will release soon:)

It’s possible, yaml is very strict about spaces, etc., and you might want to provide logs of what went wrong, it would be easier to troubleshoot based on those clues.

Good morning everyone, my sensor Ld2410C in the bathroom works well, the only problem is that it is active when the dryer is running.
On what parameters could I intervene? Thanks

While the dryer is running, you should enable Engineering Mode and that will provide you with the still and movement energy levels the LD2410 is detecting for each gate. You can use this information to then set the gate levels accordingly.
For example, if gate 4 is reading high levels due to the dryer, then you will need to adjust the gate 4 still and/or move levels until the LD2410 no longer detects it.

Hi good day everyone, I just built my first LD2410 sensor connected to wemos d1 mini esp8266 and Ive got some strange value. Some of gate energy randomly spike the value until above 100%. and thats cause many false binary presence detections. Can I ask your advice for my case?

I attached the clip and image. Thanks in advance

[EDITED] problm solved. the root cause is from uart logger and wifi improve serial line.
Thank you

https://youtube.com/shorts/-5i6D1Ss7ig?si=SHdMRskyDps7l0rG


I am currently running Esphome on a esp32dev board with an LD2410c connected via UART. I am also running bluetooth proxy on this board. My question is, in order to use the bluetooth on the LD2410c, would I need to enable Bluetooth in the settings? I understand that the esp32 board itself has bluetooth, but I am confused as to which it uses when the toggle is activated in my entity.

just wondering, why would you keep the 2410 connected via serial to a ESP if you can use it via BT? is there any needed function you can’t manage via BT?

One biiig cause: BT is too unreliable. connection is often terminated, unavailable… BT on LD2410 has extremely low range. I’ve had it connected with BT proxy 2m away and i’ve had dropouts.

makes sense :slight_smile:
maybe this is one of the reasons why HiLink added a dedicated antenna for BT in the LD2450 sensor… (indeed, i never had dropouts with this…)

Post your YAML.

Also YAML dependent. If you used the config’s floating around specifically for the LD2410C, then odds are it’s toggling the BT on the sensor.

1 Like

solved, the root cause is due to uart logger. thank you

does any one have a working yaml config for an LD2410 non-BLE that I can look at? I cant get it to show anything when trying to use it with an esp32-wroom-32D

having a tough time finding anything updated to use. any guideance would be greatly appreciated

ive had know problems using the default HERE

1 Like

I think maybe esp32 isn’t for me. Fought with it all day using default configs. I’m gonna call it and bow out.

How have you connected the LD2410 board to your ESP32-WROOM-32D board?
You need to connect GND, 5V, TX and RX and making sure that you cross the TX and RX from the LD2410 to the ESP32 board (ie. TX from the LD2410 goes to the RX on the ESP32 board and so on).

If your YAML UART config is like the following:

uart:
  id: ld2410_uart
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  uart_id: ld2410_uart
  id: ld2410_comp

Then you need to connect the TX pin from the LD2410 to the GPIO16 pin on your ESP32 board and the RX pin from the LD2410 to the GPIO17 pin on your ESP32 board.

Also make sure you are using the 5V pin and not the 3.3V pin. The LD2410 needs a good 5V power supply to work.

EDIT: I have narrowed the problem to the following:

The problem I am having is when I flash the ESP32 it is getting stuck here:

[18:54:19][D][esp32.preferences:114]: Saving 1 preferences to flash...
[18:54:19][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed

Its been there for 30 minutes and not showing any sign of completing. So looks like this is where my issue is. This board does not require me to press the boot button to flash it either. Looks like flashing the yaml without wifi breaks the wifi… cant win lol


Ive done that, im on pop-os and I have connection issues that seem to be intermittent getting the ESP32-WROOM-32D connected. When I flash it at first and connect it to wifi, it pulls an ip and works, if I do anything else, it loses wifi connection and I never see the LD2410 as something ESPHome can detect. It has a pinout like the following:

I noticed this is not a typical pinout for this board so I wonder if maybe I have an incompatible version. I got these from ali-express and the chipset isnt the same as what I see when looking at tutorials. Not sure if it matters or not.

This is the default config I am left with after flashing the ESP32 from web.esphome.io

substitutions:
  name: esphome-web-5e2fa4
  friendly_name: Den mmWave

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: '1.0'

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:

# Allow provisioning Wi-Fi via serial
improv_serial:

wifi:
  # Set up a wifi access point
  ap: {}

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp32.yaml@main
  import_full_config: true

# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
  authorizer: none

I pulled this config directly from the esp32 defaults used as suggested by @fugley from esphome.io.

uart:
  id: ld2410_uart
  tx_pin: 17
  rx_pin: 16
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  uart_id: ld2410_uart

number:
  - platform: ld2410
    timeout:
      name: timeout
    light_threshold:
      name: light threshold
    max_move_distance_gate:
      name: max move distance gate
    max_still_distance_gate:
      name: max still distance gate
    g0:
      move_threshold:
        name: g0 move threshold
      still_threshold:
        name: g0 still threshold
    g1:
      move_threshold:
        name: g1 move threshold
      still_threshold:
        name: g1 still threshold
    g2:
      move_threshold:
        name: g2 move threshold
      still_threshold:
        name: g2 still threshold
    g3:
      move_threshold:
        name: g3 move threshold
      still_threshold:
        name: g3 still threshold
    g4:
      move_threshold:
        name: g4 move threshold
      still_threshold:
        name: g4 still threshold
    g5:
      move_threshold:
        name: g5 move threshold
      still_threshold:
        name: g5 still threshold
    g6:
      move_threshold:
        name: g6 move threshold
      still_threshold:
        name: g6 still threshold
    g7:
      move_threshold:
        name: g7 move threshold
      still_threshold:
        name: g7 still threshold
    g8:
      move_threshold:
        name: g8 move threshold
      still_threshold:
        name: g8 still threshold

select:
  - platform: ld2410
    distance_resolution:
      name: "distance resolution"
    baud_rate:
      name: "baud rate"
    light_function:
      name: light function
    out_pin_level:
      name: out pin level

sensor:
  - platform: ld2410
    light:
      name: light
    moving_distance:
      name : Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: Detection Distance
    g0:
      move_energy:
        name: g0 move energy
      still_energy:
        name: g0 still energy
    g1:
      move_energy:
        name: g1 move energy
      still_energy:
        name: g1 still energy
    g2:
      move_energy:
        name: g2 move energy
      still_energy:
        name: g2 still energy
    g3:
      move_energy:
        name: g3 move energy
      still_energy:
        name: g3 still energy
    g4:
      move_energy:
        name: g4 move energy
      still_energy:
        name: g4 still energy
    g5:
      move_energy:
        name: g5 move energy
      still_energy:
        name: g5 still energy
    g6:
      move_energy:
        name: g6 move energy
      still_energy:
        name: g6 still energy
    g7:
      move_energy:
        name: g7 move energy
      still_energy:
        name: g7 still energy
    g8:
      move_energy:
        name: g8 move energy
      still_energy:
        name: g8 still energy

binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target
    out_pin_presence_status:
      name: out pin presence status

switch:
  - platform: ld2410
    engineering_mode:
      name: "engineering mode"
    bluetooth:
      name: "control bluetooth"

button:
  - platform: ld2410
    factory_reset:
      name: "factory reset"
    restart:
      name: "restart"
    query_params:
      name: query params

text_sensor:
  - platform: ld2410
    version:
      name: "firmware version"
    mac_address:
      name: "mac address"

This LD2410 is not the BLE model so if you see any issues with what I have, please let me know. I was just disgusted burning up an entire day on this and got nowhere lol

I was able to get one to work. by removing some lines that the LD2410 didnt need i suppose. The problem I am having is when I flash the ESP32 it is getting stuck here:

[18:54:19][D][esp32.preferences:114]: Saving 1 preferences to flash...
[18:54:19][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed

Its been there for 30 minutes and not showing any sign of completing. So looks like this is where my issue is.

Are there particular materials that MM Wave is reflective to or can be used to block?

Having a challenge where it’s triggering on movement on the other side of the wall.

I’m not quite sure if it’s reflecting off of my monitors and reading it or if it’s just reading it directly backwards.

What was the solution?

Looking at the picture of your ESP32 board, it looks like it has a USB-C port and it looks very similar to ones in the following thread which has issues with wifi and requires some tweaks to get them to work reliably.

@athua

Thanks for the reply. I dont think that my issue is with wireless connectivity though.

[06:42:23][C][wifi:408]:   Local MAC: A0:DD:6C:04:12:C0
[06:42:23][C][wifi:413]:   SSID: [redacted]
[06:42:23][C][wifi:416]:   IP Address: 192.168.20.171
[06:42:23][C][wifi:420]:   BSSID: [redacted]
[06:42:23][C][wifi:421]:   Hostname: 'esphome-web-0412c0'
[06:42:23][C][wifi:423]:   Signal strength: -48 dB ▂▄▆█
[06:42:23][C][wifi:427]:   Channel: 6
[06:42:23][C][wifi:428]:   Subnet: 255.255.255.0
[06:42:23][C][wifi:429]:   Gateway: 192.168.20.1
[06:42:23][C][wifi:430]:   DNS1: 192.168.1.51
[06:42:23][C][wifi:431]:   DNS2: 192.168.1.52
[06:42:23][C][logger:185]: Logger:
[06:42:23][C][logger:186]:   Level: DEBUG

My issue is with it writing to the flash it looks like:

[06:42:25][C][improv_serial:032]: Improv Serial:
[06:47:11][I][ota:117]: Boot seems successful, resetting boot loop counter.
[06:47:11][D][esp32.preferences:114]: Saving 1 preferences to flash...
[06:47:11][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed

it just sits at this point and never finishes