Getting ld2410 working on a esp32-wroom-32 board

I’ve been trying for days now to get the ld2410 presence sensor to work with an esp32 board i purchased, an esp32-wroom-32. The result so far is that HA can connect to it through Esphome, but all values are “Unknown”.
I know about RX - TX & TX - RX, but my main problem is that i don’t really know what pin number belongs to which pin on the board. It TX and RX need to be a GPIO port, and the ground and 3V2 ones are obvious. But the schematic that i found for this board is unreadable to me.

On this schematic the GPIO25 maps to pin 14 for example, but…

on this schematic (from the same page as the first image) GPIO25 maps to pin 10. But i learned i can’t use pin 10, since that’s used by the flash interface.

Here’s an image of the actual ESP32.

So apart from my guess that this ESP32 board is probably best defined as:
board: esp32doit-devkit-v1

And that neither the:
framework: esp-idf

nor the:
framework: arduino

seem to fix the ‘unknow’ issue, i’m at a loss.

Who can tell me which physical pin (most start with a D) i need to connect the TX and RX?
And who can confirm that one of the above board & framework values should work?

Here as some details about the board from the aliexpress product page:
Ontwikkelingsbordmodel: ESP32-DevKitC-32
Module Model: ESP32-WROOM-32
Belangrijkste controle chip: ESP32-DOWDQ6-V3 dual-core 32bit mcu geïntegreerde wifi, bluetooth,
Geïntegreerde 520-kbsram, 448-kbrom16-kbsraminrtc
Externe opslag: 4mb
USB-driver chip: ch340c, met goede compatibiliteit van het systeem, hogere downloadsnelheid en meer stabiliteit. Ondersteuning vin externe brede spanning ingang 5-12v voeding (batterij versie maximaal 5.5v ingang) ondersteuning usb voeding, externe 3.3v voeding, en vin voeding drie soorten voeding voedingsmodus ontwikkeling board grootte: 52*28mm/gewicht ongeveer 9.5g
Ondersteuning arduinoide mixly, mind +, python en andere programmeersoftware

Thanks for reading and hope someone has the solution!

I think you are confused (and it certainly can be confusing). GPIO10 is connected to flash. see ESP32 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials

GPIO25 is (according to the schematic) connected to pin 10 on the board, that 10 refers to the 10th physical pin on the edge of the dev board.

What i hate most on these boards is this “extra” naming of pins (like D1, D2…) so that i must search like crazy which gpio is connected to each time… i tend to buy only boards which have gpio numbers printed, not “D” ones.
Aslo…i don’t understand why gpio10 etc…poins are available at all, since they are used for flash… just useless waste of pins and space.

But, to a problem: i’ve had similar board like this and one of RX/TX pins was … unusable (sorry, i don’t remember which one anymore…). Unusable in a term that only usb chip was able to use it, otherwise it was fixed to +3.3V and not usable for other peripherals (confirmed with oscilloscope). It seems that usb interface chip forces that pin to +V… (which shoudn’t be the case), so uart0 is unsuable in this case.
Since esp32 has multiple HW uart’s try to use another one.

1 Like

Thanks for that link, i missed that one in my search somehow. From what i understand, i should be able to use GPIO16 & GPIO17 for RX and TX. Somehow these two even correspond to the ‘D’ numbering on the board itself.
So… i connected the RX from the LD2410 to the GPIO17 and the RX from the LD2410 to the GPIO16 and put that in my yaml file:
tx_pin: 17
rx_pin: 16
baud_rate: 115200
data_bits: 8
stop_bits: 1
parity: NONE

I’ve tried these values using both framework: arduino and framework: esp-idf. Still just all unknown values, even if i enable engineering mode and manually set each of the following values in HA by hand (so much fun doing that for the n-th time…):
g0_move_threshold: 50
g0_still_threshold: 20
g1_move_threshold: 50
g1_still_threshold: 20
g2_move_threshold: 40
g2_still_threshold: 40
g3_move_threshold: 40
g3_still_threshold: 40
g4_move_threshold: 40
g4_still_threshold: 40
g5_move_threshold: 40
g5_still_threshold: 40
g6_move_threshold: 30
g6_still_threshold: 15
g7_move_threshold: 30
g7_still_threshold: 15
g8_move_threshold: 30
g8_still_threshold: 15

I’m at a complete loss. This SHOULD work, right?

Couldn’t agree more, why in the world would you design another numbering scheme (D) on top of the existing on (GPIO)? It’s not consumer-friendly, that’s for sure.

1 Like

Not to mention boards that have no schematic published, or wrong schematics. Same with sample code (looking at you ttgo)

Also it pays to remember that although the board maker may label the pins in a certain way, this is the actual truth

However, you can decide which pins are UART, I2C, SPI, PWM, etc – you just need to assign them in the code. This is possible due to the ESP32 chip’s multiplexing feature.

Drives me crazy too!

1 Like