LD2410 esphome tips

The Gate distances are based on the value you select for ‘distance resolution’. You can select either 0.2m or 0.75m. If 0.75m is selected, then each gate has a range of 0.75m with Gate 0 being at the sensor so is 0. Gate 1 will be 0 to 0.75m and Gate 2 will be 0.75 to 1.5m and so on with the max distance at Gate 8 being 6m.

Awesome, that helps a lot thanks :slight_smile:

So its optional and defaults to 75cm.

  • distance_resolution (Optional): Control the gates distance resolution. Can be 0.75m or 0.2m. Defaults to 0.75m. All options from Select.
1 Like

I have turned on Engg mode but I am still not able to see the readings/values. Any thoughts on how to troubleshoot?

Can you provide some more details on your setup? ie. the ESP board in use and your YAML config. Make sure when you post any code, it is in a preformatted text block to make it easier to read.
The sensor details in your screenshot above should work even if engineering mode is not enabled.

Sorry new to HA. Switching over from webcore/ST to HA.

I have the exact same setup as the link below except the ESP Code.

For ESP Code, I am using the one “Code for ESPHome 2023.8.1 and Up” from link below

Do you have the correct pins specified, and are they wired correctly–TX(ESP) to RX(LD2410) and RX(ESP) to TX(LD2410)?

Specifically, your link says

uart:
  id: ld2410_uart
  tx_pin: 17
  rx_pin: 16

So you have to adapt.

On an ESP32, the labelled TX is GPIO01, RX is GPIO03

This is how I have wired. I can turn on the bluetooth on the LD2410 and see that its working. But I see no data (all sensor values shows unknown) in HA.

When using Bluetooth, the ESP32 board is not being used at all expect for supplying power to the LD2410 board. For the ESP32 integration to work properly, the TX/RX pins must be connected correctly.

I had the same problem with my ESP32 board which looks to be the same as yours.
It seems with many ESP32 boards, the TX and RX (pins 1 & 3) cannot be used as it is reserved for internal use. I used Pin 16 for RX & 17 for TX on my ESP32 board and the data then sends correctly.
RX-TX-16-17

1 Like

What I said, exactly

image

Many ESP32 boards which have USB onboard have tx or rx pin unusable (i don’t remember which one anymore, it’s been a while since i found out this…). It’s held … low (or high…) by USB chip and this chip prevents other UART devices from functioning.
So, either use esp32 without usb or cut traces from esp to usb chip. Or, if it works, use other pins for rx/tx.

With most ESP32 boards, there are more than 1 UART available so using other pins like 16 & 17 works as I have a similar ESP32 D1 Mini board and Pin 16 & 17 is for UART2 and works well with the LD2410C that I have.

Not sure where that come from.
The only issue with using uart0 is with ESPhome serial logger.
If you don’t use it (and most don’t, they use wifi or usb), set

logger:
  baud_rate: 0
  
uart:
  id: ld2410_uart
  tx_pin: TX
  rx_pin: RX
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

If it helps, I’ve got LD2410(B & C) running successfully, NEITHER use the Tx and Rx on the controller. I have one running with ans ESP8266 and the other with a ESP32 C3 mini. Pins used on the C3

  uart_tx_pin: GPIO05
  uart_rx_pin: GPIO04

and on the D1 mini

  uart_tx_pin: GPIO15
  uart_rx_pin: GPIO13

From personal experience. I connected fingerprint sensor to tx and rx and it didn’t work (yes, logger via uart WAS disabled). Signal analyzer showed that one of those signals was “dead” (non responsive) for all but usb communication.
As i said - i don’t remember which one anymore, i’ve had major flood after that so i won’t be able to work with these boards for a while until i clean my mess…

On how many boards?
If one, it’s a bit statistically low to make it a generality :wink:

Three identical boards esp32 devkitc v4 (aliexpress), behaviour was the same. On one i did cut connection to usb chip (for test, to be sure) and uart started to work.
EDIT: i found my test yaml: rx pin is the one who doesn’t work. In fingerprint case that means that when send learn command sensor starts learn sequence, but never finishes it since it sends data to esp, but doesn’t get response since esp doesn’t receive that sent data. So i used tx and, say, gpio35 and it worked like a charm

1 Like

It worked. thanks.

1 Like

In some of our DIY ld2410 sensors, such as the 1u, 1w, etc., it’s always been the case that engineering mode is automatically turned on to get the light. (It’s an early version of the ld2410 library hack), we made thousands of them to share around the world, and in the overall scheme of things, the engineering mode has had no ill effects other than outputting a lot of redundant data and adding a few more tasks to the esp32 processing.

But on this new version of the library, I can imagine that doing so could lead to receiving a lot of unnecessary engineering data, which seems to be something to consider when not debugging - it’s best to rule out excessive logging of probe energy data for each segment.

1 Like

My guess is that it’s being taken up by modules such as the default logger, in our experience with c3 we found that one of the default uart’s was being used by esphome to output logs, and unless the uart port used by logger is adjusted, that port will be unavailable or will cause some sort of conflict.

We did a lot of testing on the c3 in order for that module without the serial chip to behave as close to having a serial chip:

  • Being able to output logs.
  • When plugged into the computer, the serial port will not wait for the driver to respond without starting it.

I have this mini d1 esp32 board and it would be really quite nice if they weren’t a bit bigger.

One thing I’m not happy with serial chips esp32 might be that their write speeds are generally slower at default settings.


HLK-LD2410C-24G
English support for hilink often seems to be a bit behind, this is from the Chinese support site.

Their characteristics seem to be exactly the same, hilink make ld2410c, probably just consider the 2.54mm row of pins easy to solder.
It came out much later and was often sold out in the beginning. When we were making the 1U, we were most nervous about grabbing a shipment back. ld2410b’s 1.27mm pinout added to the difficulty for those who wanted to solder their own wires.

But for now the ld2410c looks to be in stable production.