After looking for how to configure the HLK-LD2410 and HLK-LD2420 presence detectors and seeing that there was little information, I started to carry out tests to try to configure them, from these tests I got these results:
I have managed to configure both, and if you look at the YAML files you will see that you have to change pins 20 and 21 depending on the sensor you are using, I don’t know if it is because of a bad definition of the pins on the boards I have or because they are poorly silkscreened, the fact is that they both work like this.
I have also made two sketches in Fritzing to put them into operation, the PCB has been designed, I currently have both of them working.
Both have a HLK-PM01 power supply of 5V and 0.6A and are powered at 220V alternating current, as I intend to place them attached to the ceilings I have and draw the power from these.
Since the 2025.7.2 update, ESPHOME stopped working if updated above that version of ESPHOME. For it to work, with versions equal to or higher than that, you have to change the pins to which the HLK-LD2024 is connected - tx_pin: GPIO07 and rx_pin: GPIO06. With the old configuration, it caused problems with the USB port.
I ran into the same problem with the LD2420 not initializing after flashing.
After a long wild goose chase, the thing that actually solved it was to assign the UART tx/rx pins to something other than the ESP32 pinout tx/rx pins.
uart:
id: ld_uart
# tx_pin: GPIO43 <-- DO NOT USE THESE DEFAULT PINS ON AN ESP32S3
# rx_pin: GPIO44 <-- DO NOT USE THESE DEFAULT PINS ON AN ESP32S3
tx_pin: GPIO08
rx_pin: GPIO09
baud_rate: 115200
parity: NONE
stop_bits: 1
Things that were suggested on this forum and Reddit that did not work:
Power cycling after flashing
Switching tx/rx cables
Setting baud: 0 for logging
Powering from a standalone power supply
Using the arduino framework instead of esp-idf
It was unclear to me that this would work, as in my case my ESP32S3 pinout doesn’t show that GPIO08/09 are UART pins. But as soon as I changed the pins to these unused ones, my LD2420 was able to communicate with my ESP32S3, and I was able to still use the logger.
It appears that you can choose any two unused GPIO pins and set them to tx/rx, but you cannot use the default tx/rx pins.