Use this script to measure water level with a A121 radar sensor (https://www.waveshare.com/a121-range-sensor.htm) in conjunction with a esp32 Board running tasmota.
- flash i2c_distance_detector.bin into the A121-stm board
- edit A121_tasmota.be with your own values
static A121_ADDRESS = 0x52
static A121_BUSYPIN = 18
static A121_WAKEUPPIN = 17 # not used
static A121_min_depth = 500.0 # entspricht dem Abstand Abstand des Sensors bei maximaler Wasserhöhe
static A121_max_depth = 3500.0 # Messwert wenn Tank leer ist
static A121_LITER_PER_MM = 1.2 # conversion factor
- flash a esp32 board with tasmota https://tasmota.github.io/docs/ (use a version with berry script enabled)
- upload this script to the esp32 board
- connect I²C SDA and SCL pins of the A121 sensor to the corresponding pins on the esp32 board
- connect VCC of the A121 sensor to the 5V pin of the esp32 board
- connect GND of the A121-GND to the GND pin of the esp32 board
This script is heavily inspired by acconeer A121_Distance_Detector.py
see also: