Light, distance and motion
LD2410 radar with ESP32
A PIR sensor sees movement, so it switches off the lights on someone reading a book. The LD2410 is a millimetre-wave radar that also picks up a person sitting still, which is why it has become popular for room presence. On a wall panel it can also wake the screen when someone walks up.
It has two ways to connect. The easy one is the OUT pin: high when someone is there, low when not. That is one wire and one digitalRead, which is what the example does. The UART gives more, with distances and gate settings, but it runs at 256000 baud, so use hardware serial pins and cross TX and RX. Forum threads on this sensor mostly come down to three things: crossed lines, wrong baud rate and weak power. Some users had to feed it from a separate 5 V supply, not the board's 5V pin.
Do not mix up the names. An LD2420 is a different board, and one user needed 115200 baud on it. A fan, a curtain moving in warm air, or a pet can all count as presence, so expect some tuning, and radar passes through thin walls and plastic, so it may see the next room. ESPHome exposes the gate settings. Its example uses 6 m as a maximum distance, but check the manual for your version. Keep it away from the display's power section and mount it where it faces the room. On many display boards the spare UART is already in use. LCD Ultra Pro can read a hardware pin, so the OUT signal can drive a rule without code.

Specifications
| Type | mmWave presence radar |
|---|---|
| Supply | 5 V, may need its own supply |
| Simple output | OUT pin, high when present |
| UART | 256000 baud, no parity, 1 stop bit |
| Detects | Moving and still people |
Power and logic levels
3.3 V: safe to connect directly
| Supply | 5 V |
|---|---|
| Signal level | 3.3 V on UART and OUT |
| On an ESP32 | Hi-Link lists 3.3 V IO. Allow 200 mA on the 5 V supply. |
ESP32 pins, including those on a display board's connectors, work at 3.3 V and are not 5 V tolerant. Modules differ, so if in doubt, measure the signal before you connect it.
Wiring
| LD2410 radar | Connect to | Note |
|---|---|---|
| VCC | 5V | Use a separate 5 V if unstable |
| GND | GND | |
| OUT | GPIO 5 | Presence signal |
Arduino code
const int OUT_PIN = 5;
int last = -1;
void setup() {
Serial.begin(115200);
pinMode(OUT_PIN, INPUT);
}
void loop() {
int now = digitalRead(OUT_PIN);
if (now != last) {
last = now;
Serial.println(now ? "Someone is here" : "Room is empty");
}
delay(100);
}
No extra library needed. Compiled for ESP32-S3 with arduino-esp32 3.x. Not yet tested by us on a physical sensor. Change the pins to match your board.
On a display
In LCD Ultra Pro a rule can read a hardware pin as 0 or 1, so the OUT signal can change a screen or a label without code.
Design a display for LD2410 radarBoards with a ready connector
Only boards whose connectors we have surveyed. Others may still work on free GPIOs.
| Elecrow CrowPanel ESP32 HMI 2.4" | UART1 port: TX 17, RX 16 |
| Elecrow CrowPanel ESP32 HMI 2.8" | UART1 port: TX 17, RX 16 |
| Elecrow CrowPanel ESP32 HMI 3.5" | UART0 port: TX 1, RX 3Shared with the USB-C serial port — the serial monitor and uploads use it too |
| Elecrow CrowPanel ESP32-S3 HMI 4.3" | UART1 port: TX 17, RX 18 |
| Elecrow CrowPanel ESP32-S3 HMI 5.0" | UART0 port: TX 43, RX 44Shared with the USB-C serial port — the serial monitor and uploads use it too |
| Elecrow CrowPanel ESP32-S3 HMI 7.0" | UART0 port: TX 43, RX 44Shared with the USB-C serial port — the serial monitor and uploads use it too |
| Makerfabs MaTouch ESP32-S3 Rotary IPS 2.1 Round | Mabee UART (J2): TX 43, RX 44UART0 — the serial output goes here unless it is moved to the USB port |
| Sunton ESP32-2432S028R 2.8" | Serial header (P1): TX 1, RX 3Shared with the USB-UART bridge — the serial monitor and uploads use it too |
| Sunton ESP32-4827S043R/C 4.3" | UART header (P1): TX 43, RX 44Shared with the USB-UART bridge — the serial monitor and uploads use it too |
| Sunton ESP32-8048S043C 4.3" | UART header (P1): TX 43, RX 44Shared with the USB-UART bridge — the serial monitor and uploads use it too |
| Sunton ESP32-8048S050C 5.0" | UART header (P1): TX 43, RX 44Shared with the USB-UART bridge — the serial monitor and uploads use it too |
| Sunton ESP32-8048S070C 7.0" | UART header (P1): TX 43, RX 44Shared with the USB-UART bridge — the serial monitor and uploads use it too |
| Waveshare ESP32-S3 Touch LCD 2.1" round | 12-pin header: TX 43, RX 44The header also carries USB D- / D+ (GPIO 19 / 20) and the I2C bus (GPIO 15 / 7) — GPIO 0 is the BOOT button (keep it high at power-up) |
| Waveshare ESP32-S3 Touch LCD 2.8" | 12-pin header: TX 43, RX 44The header also carries USB D- / D+ (GPIO 19 / 20) and the I2C bus (GPIO 11 / 10) |
| Waveshare ESP32-S3 Touch LCD 2.8" Type B | 2x12 pin header: TX 43, RX 44The header also carries USB D- / D+ (GPIO 19 / 20) and the I2C bus (GPIO 15 / 7) — GPIO 0 is the BOOT button (keep it high at power-up) |
| Waveshare ESP32-S3-Touch-LCD-2.8C | 12-pin header: TX 43, RX 44The header also carries USB D- / D+ (GPIO 19 / 20) and the I2C bus (GPIO 15 / 7) — GPIO 0 is the BOOT button (keep it high at power-up) |
| Waveshare ESP32-S3-LCD-7B | UART2 connector (H3): TX 43, RX 44Only when switch SW1 selects UART2 — shared with the USB-to-UART port |
Good to know
- UART runs at 256000 baud.
- Weak 5 V causes odd behaviour.
- Fans and pets can trigger it.
- LD2410, LD2420 and LD2450 are different.
What it is good for
- Waking a wall panel
- Room presence
- Lighting control
FAQ
LD2410 or PIR?
The LD2410 detects still people. A PIR needs movement.
Why are my values unknown?
Check crossed TX and RX, 256000 baud and the 5 V supply.
Why does it trigger in an empty room?
Moving objects or the next room. Tune the gates.
Sources
Related parts
Use this information at your own risk. It is for general guidance only: the example code compiles, but it has not been tested on every part, and modules differ between sellers. Check the manufacturer's data before you build. Product names belong to their owners, and LCD Ultra Pro is not affiliated with them. See our Terms.