I’m currently trying to get the RD‑03D 24GHz radar module running on an ESP32, but I’m running into issues with the existing Arduino library and example sketches. The RD‑03D works fine on an Arduino Uno/Mega, but the same code does not behave correctly on the ESP32 (garbled UART data, incomplete frames, or no valid output).
Before I start rewriting the whole library, I wanted to ask the community:
Has anyone successfully used the RD‑03D with an ESP32?**
If yes, did you need to modify the library or the UART handling?
What changes are required in the library to make it ESP32‑compatible?**
For example:
different HardwareSerial handling
different readBytes() timing
disabling FIFO
adjusting frame parsing
using Serial1 instead of Serial2
or switching to a non‑blocking read loop
Does anyone have a working ESP32 sketch for the RD‑03D?**
Keeping in mind that I dont work with Arduino, rather I use the idf directly; so I cant comment on Arduino specifics.
If you are getting something on the UART, but its not what you expect, this sounds like something needs to be tweaked in the config for the UART, e.g. board/speed.
I would not assume any defaults and ensure you have setup the needed baud rates/start/stop/parity as well as ensure you are using the correct GPIO Pins. Im not a fan of calling them “Serial1 and Serial2” it does not really tell you what pins and if that is should be used. e.g. on most ESP32 boards UART0 is the program/debug port, so I would tend to stay away from that If I dont need to use it, then user UART1 and/or 2. But is Serial1 UART1 or UART0 on the ESP32?
My RD‑03D module (G331 marking under the AI‑Thinker logo) does not use the same header as the G502 version shown in the Core Electronics tutorial.
The library expects frames starting with:
0xAA 0xFF 0x03 0x00
But my module consistently sends:
0xAD 0xFF 0x03 0x00
So the parsing logic in the library never matches the actual data and no target is ever detected.
It’s not a wiring or baudrate issue – the protocol is simply different.
I switched to HardwareSerial on the ESP32 and wrote a small state‑machine parser that matches the 0xAD FF 03 00 header and reads the 24‑byte payload. With that, the sensor works reliably.
Just to be transparent: I’m still learning and I adapted the code together with help from Microsoft Copilot, so this is a collaborative effort rather than my own deep knowledge. Any corrections or insights are welcome.