Hi guys, im having a really bad time here with the A02YYUW PWM Version.
Tried ultrasonic platform, the a02 platform but nothing seems to work properly.
Maybe is something with the pins that I couldnt figure it out, since im not an esp expert.
So I tried to associate things based on a LOT of codes I found.
uart:
rx_pin: GPIO1
tx_pin: GPIO3
baud_rate: 9600
sensor:
- platform: a02yyuw
id: a02yyuw_sensor
name: "Water level"
unit_of_measurement: 'm'
accuracy_decimals: 1
filters:
- multiply: 0.001
- throttle: 5s
- heartbeat: 5s
- quantile:
window_size: 7
send_every: 4
send_first_at: 3
quantile: .9
- debounce: 0.1s
The best result I got was the sensor sendin 0.26 every 5 seconds, but was the same result everytime.
If someone could help me 
Any chance you sorted this out? I am having the exact same issue–can’t get anything out of this sensor.
you need to get the UART version to work properly.
first time I had the PWM and couldnt get things done.
try this and use this code:
esphome:
name: water-level
friendly_name: Nível da Caixa
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
logger:
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
web_server:
captive_portal:
# # Example configuration entry
# dallas:
# - pin: GPIO3
uart:
rx_pin: 7
baud_rate: 9600
sensor:
- platform: a02yyuw
id: a02yyuw_sensor
name: "Water level"
unit_of_measurement: 'm'
accuracy_decimals: 4
filters:
- multiply: 0.001
- throttle: 5s
- heartbeat: 5s
# - quantile:
# window_size: 7
# send_every: 4
# send_first_at: 3
# quantile: .9
# - debounce: 0.1s
# - platform: dallas
# address: 0x1c0000031edd2a28
# name: "Temperatura Caixa de Água"
Thanks for replying. I believe I have the UART version, though if course it’s possible it’s a bad Amazon listing…but I am using it with code identical to yours and I get a reading but the reading never changes no matter what surface I point the sensor at.
Hi guys
It seems there are different models for the A02YYUW sensor, two of them using UART levels: ‘UART Auto’ and ‘UART Controlled’. In my case I have the UART Controlled model,
where Pin
#3 is a trigger input (not the Rx function of the UART sensor), so I just needed to define a pin (I choosed GPIO22) in ESP32 to drive the trigger:
uart:
rx_pin: GPIO23
baud_rate: 9600
debug:
output:
- platform: gpio
pin: GPIO22
id: output1
button:
- platform: output
name: "Trigger_Sensor_Depos_Agua"
output: output1
duration: 100ms
sensor:
- platform: a02yyuw
name: "Nivel_Dep_Agua_Raw"
unit_of_measurement: 'cm'
accuracy_decimals: 3
filters:
- multiply: 0.1