A01NYUB Ultrasonic Distance Sensor on pi 5 without Expansion Board

userHead Jay.Be 2025-11-08 21:11:01 597 Views5 Replies

Hello,

I am trying to run the A01NYUB Ultrasonic Distance Sensor with my pi 5 directly (no Expansion Board).
I use the https://github.com/DFRobot/DFRobot_RaspberryPi_A02YYUW library.
Unfortunately, I only get “No data!”.

Any suggestions?

2025-11-09 22:19:49

The A01NYUB’s TX is 5 V logic. The Pi’s GPIO RX pin is 3.3 V tolerant only.
You must use a voltage divider (e.g., 4.7 kΩ + 10 kΩ) or a logic-level shifter on the TX line to avoid damaging the Pi.

userHeadPic ahsrab.rifat
Jay.Be wrote:

Thanks, I will look into this.

2025-11-10 02:45:58
Jay.Be wrote:

What happens if I connect the sensor to the PI's 3V power supply? Shouldn't it then work without resistors, since it runs on 3V?

2025-11-17 23:16:26
ahsrab.rifat wrote:

Only connecting VCC to 3V will not work. voltage divider between RX, TX lines are also essential. 

2025-11-18 01:59:24
Jay.Be wrote:

It actually works without voltage divider when connected to the standard 3V3 pin of the Raspberry Pi. However, you have to use the standard library from Raspberry Pi “https://projects.raspberrypi.org/en/projects/physical-computing/12” . The DFROBOT lib just still gives “No data!” for whatever reason.

2025-11-18 03:24:26
4 Replies