A01NYUB Ultrasonic Distance Sensor on Pi 5 Without Expansion Board
Donald.Jenkins 2026-09-21 15:45:35 27 Views0 Replies Hi everyone,
I’m trying to connect an A01NYUB Ultrasonic Distance Sensor directly to a Raspberry Pi 5, without using an expansion board.
The sensor communicates through UART at 9600 bps, and DFRobot provides Raspberry Pi documentation for it. However, I’ve seen reports of people getting “No data!” when using the DFRobot library. There also seem to be some differences between A01NYUB sensor versions and how they behave when connected directly to the Pi.
I’m particularly interested in:
Which GPIO pins are you using for UART on the Pi 5?
Did you need to enable a UART overlay or make any changes to config.txt?
Can the sensor be powered directly from the Pi’s 3.3V pin?
Is a voltage divider or logic-level shifter necessary?
Has anyone successfully read the sensor data using Python without an expansion board?
Did you use the DFRobot library, or a different UART driver?
I found this GitHub driver specifically written for connecting the A01NYUB directly to a Raspberry Pi:
https://github.com/FlueschPluesch/raspberry-pi-a01nyub-ultrasonic-distance-sensor-uart-driver

