General

A02YYUW distance sensor not working

userHead Mark.Olson 2026-06-12 05:26:03 219 Views1 Replies

I purchased the A02YYUW Waterproof Ultrasonic Sensor with the Intention of wiring It to an esp32 and Integrating with espHome/Home Assistant.  No matter what I try, though, I only check checksum errors In the espHome logs along with an occasional wild distance reading.  With the help of chatgpt, I have tried every permutation of wiring the blue and green wires to RX, TX, P16, and P17.  I have read all your documentation very carefully but nothing works.  Multiple AI models have told me after 6+ hours of troubleshooting that the sensor Is bad.  Chatgpt just said, "The ESP32 is receiving UART traffic, but the traffic is corrupt.  Conclusion: replace the sensor/harness. The ESP32, Wi-Fi, YAML, UART component, power level, and mode-line tests are no longer the likely cause."

 

I really really need this to work asap, but I hate to send it back without knowing the root cause problem.  Any ideas or suggestions?

 

Also I notice that the sensor itself is labeled “A0221AU” not “A02YYUW”.  Everything I read online suggests they are close cousins but there can be differences.  Do DFROBOT send me the wrong product?

 

Appreciate any thoughts or suggestions.  I've exhausted everything I can think of.

2026-06-12 14:35:12

The “A0221AU” marking may just be an internal marking/serial number, not necessarily the actual product model. 


For the checksum errors, I’d suggest testing the sensor outside of ESPHome/Home Assistant first with a basic UART test. Use the simplest wiring:​
• Sensor VCC → ESP32 3.3V or 5V​
• Sensor GND → ESP32 GND​
• Sensor TX → ESP32 RX​
• Sensor RX → leave unconnected first
Then check whether it outputs valid 4-byte frames at 9600 baud. Also make sure the RX pin in the test code matches the actual ESP32 pin connected to the sensor TX.​


It would help to share the ESP32 board model, full wiring photo, ESPHome YAML, test code if any, checksum error log, sensor power voltage, and photos of the packaging label/sensor marking.

userHeadPic Yx