Hello community,
I’m trying to get a waterproof ultrasonic sensor working with ESPHome on an M5Stack Nano C6 (ESP32-C6).
Hardware:
- M5Stack Nano C6
- Waterproof ultrasonic sensor sold as A02YYUW UART
- Marking on sensor: A0221AU
- Connected via Grove connector
ESPHome configuration:
uart:
id: a02_uart
tx_pin: GPIO1
rx_pin: GPIO2
baud_rate: 9600
debug:
direction: RX
dummy_receiver: true
sensor:
- platform: a02yyuw
uart_id: a02_uart
name: "Waterput Afstand"
The sensor entity is created correctly but always remains: ‘unknown’
What I’ve already tested
1. Standard configuration
UART debug output:
00:00:00:00:00:00:00:00
00:00:00:01:00:00:00:00
00:00:00:00:00:00:00:00
No valid frames detected.
2. Logger disabled on serial
Based on some ESP32-C6 forum posts, I tried:
logger:
baud_rate: 0
Result:
- No change
- Sensor still reports
nan - UART still mostly shows zeros
3. Removed A02YYUW sensor component completely
To rule out ESPHome parsing issues, left only UART debug active.
Result:
Still no valid UART frames.
4. RX inversion
Tried:
rx_pin:
number: GPIO2
inverted: true
This changed the UART output dramatically.
Instead of all zeros, I started getting:
FF:F0:F0:F0:E0:F0...
However, these still don’t look like valid A02YYUW frames.
I never see repeating structures such as: “FF xx xx checksum” which is what the A02YYUW protocol documentation suggests.
5. Swapped RX/TX pins
Changed to:
tx_pin: GPIO2
rx_pin: GPIO1
Result:
No UART activity at all.
This suggests the original direction is probably correct.
Question
Has anyone successfully used an A0221AU / A02YYUW sensor with an ESP32-C6?
Could this be:
- A clone using a different UART protocol?
- An inverted signal output?
- A Grove pinout mismatch?
- A sensor hardware fault?
- Some ESP32-C6 UART compatibility issue?
Any ideas on additional tests would be appreciated.


