Well / cesspool level sensor with WM_Mini

26/04/2025

WM_Mini (Watmonitor Mini) is a small PCB measuring 30 x 28.6 mm. It has two mounting holes with a diameter of 3 mm, a communication bus with two data channels and 3V3 power supply. As well as a 2-pin interface for connecting an external 5V power supply for recharging the battery (external power supply, solar panel), while it can charge with a maximum current of 120 mA. It also contains a place for mounting any XIAO module from Seeed Studio, which have a predefined pinout and size.

Their size is practically one inch. The available source codes for ESP32 XIAO modules can be used to connect WM_Mini to the Watmonitor interface (web interface of the level meter). There is currently an example available in Watmonitor for ESP32-C6, which is also compatible with the XIAO module:

https://github.com/martinius96/hladinomer-studna-scripty/blob/master/examples/Hladinomer/HTTPS/C6_ULP/C6_ULP.ino

The primary use of the WM_Mini PCB is for proximity sensors with 3.3V operating and power logic. We can include ultrasonic distance sensors such as SEN0208 (JSN-SR04T), SEN-13959 (HC-SR04), DYP-ME007, SEN0352 (URM13) SEN0307 (URM09), SEN0313 (A01NYUB - be careful, the original connector is 2.0 mm pitch, PH type), SEN0311 (A02YYUW), 4007 (Adafruit), Parallax PING)))™ (POLOLU) and many others in 3 or 4-pin versions.

A 3-pin version is also possible. Parallax uses one pin for receiving and transmitting ultrasonic waves, so the GPIO orientation changes from output to input in software. The I2C interface on the PCB has pins located with an identical pinout as the HC-SR04 or JSN-SR04T, so they can be plugged directly into the bus or connected with a direct cable.

In addition to ultrasonic sensors, we must also mention laser ToF sensors. Recently, the VL53L0X, VL53L1X (and others) laser sensors from STMicroelectronics have been very popular. They are especially distinguished by their miniature dimensions (only a few millimeters), support for Fast Speed ​​I2C 400 kHz and savings in terms of consumption.

The sensors operate in the invisible spectrum of 940 nm, which is a safe class 1 laser and can perform dozens of measurements per second. It does not have a point beam, but it is half as small as ultrasonic sensors. It can also be used in applications where it can wake up the host processor through an interrupt and respond to the detection of a change in distance, especially in security applications.

These sensors can be found in the TOF050C, TOF200C, TOF400C modules. They differ in the maximum detectable distance of 50, 200 and 400 cm. The sensors will also find use in various navigation, autonomous and automation applications. These sensors do not have a 1:1 pinout like on the PCB and therefore need to be pinned as needed.

It is also possible to use any other peripheral that has a max. 2 data wires and 3.3V power supply. As for XIAO modules from Seeed Studio, we have a wide selection, which will depend on the available communication technology. As we mentioned, XIAO modules have identical pinout. This means that there is no risk of reversing the module's polarity. These modules differ primarily in the processor (MCU) they are equipped with. You will not be able to use various other technologies such as industrial sensors, differential pressure sensors, since many of them are built on 24V power supply, which the WM_Mini PCB does not allow, nor the XIAO module as such. Likewise, many peripherals are only 5V, which is also not compatible with this PCB.


Currently, XIAO modules contain one of the following MCUs and are manufactured in Seeed Studio:

  • ESP32-C6
  • ESP32-C3
  • ESP32-S3
  • nRF52840
  • RP2040
  • RP2350
  • SAMD21
  • RA4M1
  • MG24

For specific XIAO modules, we can distinguish between the standard and Sense versions of ESP32-S3, MG24 and nRF52840, which have some sensor equipment directly on their PCB. The versions with SAMD21, RP2040, RP2350, RA4M1 can be described as uninteresting for our purposes, since they do not have any wireless communication technology. The other mentioned processors offer at least WiFi or Bluetooth connectivity, or a combination of them, and also have, for example, special technologies under IEEE 802.15.4, or support for interesting IoT protocols.

If we focus directly on WiFi support, we will find the popular ESP32 microcontrollers here. MG24 (Multiprotocol Wireless SoC) does not directly support Wi-Fi as such, but it does support various IoT standards and technologies on the 2.4 GHz radio. Matter through Thread, Zigbee, Bluetooth is worth mentioning. Seeed Studio used local suppliers to design schemes and components (electronics), which makes these modules affordable. The main circuits related to battery management and voltage regulation fell on the products of SGMICRO, which is a reliable manufacturer of components not only for the automotive industry. Likewise, all XIAO modules are certified for the European and American markets.

On all of the aforementioned microcontroller architectures, you can make an application for a water level sensor in a tank, well, or cesspool. You can integrate all of these XIAO modules onto a simple WM_Mini interconnect PCB and, if they support WiFi, you can integrate them into 3rd party services or the Watmonitor interface from Your-IoT. The assembled PCB may look like this, for example. If the XIAO module is pin-soldered, it can be easily replaced with another one. This allows you to easily replace the component or replace it with a different version.

As for programming XIAO modules, they all have support in Arduino Core. Some of them have support for PlatformIO, MicroPython, CircuitPython, or Zephyr. The least variability in programming languages ​​and development environments is with MG24 and RA4M1. Each module has its own specifics. For example, with ESP32-C6 it is possible to turn on an external antenna by combining GPIO, but again, for example, with nRF52840 this option is not available and you can only use it with an antenna on the PCB. But the essence remains the same and it is in the pinout, which allows you to use the hardware that you run on a certain architecture on another and you are sure that you will not need to change the pinout.

ESP32-C6 and MG24 are very interesting platforms for other supported network technologies and protocols. It is worth noting that the ESP32-C6 supports WiFi6 (2.4 GHz), including TWT technology for scheduled wake-up and communication over a WiFi network. However, this MCU is primarily aimed at smart home applications, especially because of its support for the Thread standard for wireless communication, which runs under IEEE 802.15.4, as well as the supported Zigbee. The CEO of Espressif is also happy to boast about the news, and the latest was the certification of the ESP32-C6 for Thread 1.4.0. (the latest Thread standard from September 2024).


Thread is closely related to the Matter protocol, which ESP32-C6 also supports, and this is the combination that will move the world of IoT, Smart Home. There are currently many examples with the Matter protocol that can be used directly in Arduino Core and ESP-IDF. Matter examples for ESP32 are currently tied to WiFi, not yet to Thread, but several examples for OpenThread are available. Soon we will also see support for ESP32-C5 with dual-band WiFi6 (2.4 + 5 GHz).

This will also allow you to integrate a level sensor into your smart home. Thanks to the support of the Matter protocol and Thread technology, you will be able to read data from the sensor through any supported application (SmartThings, Google Home, Alexa, Homekit, HomeAssistant). Currently, however, you need a hub for all examples, ESP32 will not work without a hub. The application will notify you of this fact directly during the commissioning process.

The MG24 is similar, with the difference that it does not support Wi-Fi in the true sense of the word, but it does support the Matter protocol and Thread, OpenThread technologies. However, we also find Bluetooth in version 5.3 here and it can also be an interesting hardware for IoT applications. Examples for Arduino Core for MG24 use Matter through the Thread network, not through WiFi as in the ESP32-C6. Thanks to the variability of the types of XIAO modules, you can now build a sensor node for monitoring the water level in a well, tank or cesspool with any technology that meets your requirements.

At the same time, you can connect it via WiFi with Watmonitor, specifically to ESP32-S3 (the good old Xtensa, it even has PSRAM, since it has been extended with a camera for real-time streaming), ESP32-C3 and ESP32-C6 already on the RISC-V architecture, or even to MG24, which has a really interesting consumption. These platforms also support Bluetooth in various versions, which can also be an interesting solution for remote water level reading. The WM_Mini PCB will be used mainly in various demonstration applications, where it will impress primarily with the size and variability of XIAO modules according to the requirements of a specific application, which may not be limited only to water level monitoring.

More about the Watmonitor project with the possibility of trying it with your hardware in full functionality at:

https://your-iot.github.io/Watmonitor/en/

Sample source codes for ESP32-WROOM-32 / ESP32-S / ESP32-C6 and others (ESP8266, Arduino) can be found at:

https://github.com/martinius96/hladinomer-studna-scripty/tree/master/examples/Hladinomer/HTTPS

The WM_DK1 PCB is also compatible with the Watmonitor interface and sample source codes, which differs only in the ESP32 module used. In this case, it is tied to the Lolin32 devkit (Wemos in version V 1.0.0), the classic ESP32-WROOM-32 on the Xtense LX6. It supports classic 2.4 GHz WiFi4. It contains a connector with pinout for ultrasonic distance sensors (identical to XIAO with 2.54 mm pitch). There is no option for external power supply, only via microUSB directly to the microcontroller.


© 2025 Arduino Blog - . All rights reserved - martinius96@gmail.com
Powered by Webnode Cookies
Create your website for free! This website was made with Webnode. Create your own for free today! Get started
Používame cookies, aby sme zaistili správne fungovanie a bezpečnosť našich stránok. Tým vám môžeme poskytnúť tú najlepšiu skúsenosť z ich návštevy.

Advanced settings

Tu môžete upraviť svoje preferencie ohľadom cookies. Nasledujúce kategórie môžete povoliť či zakázať a svoj výber uložiť.

Bez nevyhnutných cookies sa neobíde správne a bezpečné fungovanie našich stránok a registračný proces na nich.
Funkčné cookies ukladajú vaše preferencie a prispôsobia podľa nich naše stránky.
Výkonnostné cookies monitorujú výkon našich stránok.
Vďaka marketingovým cookies môžeme merať a analyzovať výkon nášho webu.