Skip to content

Water level monitor using open-source microcontrollers (Arduino, ESP8266, ESP32) and ultrasonic sensors HC-SR04 / JSN-SR04T / or TOF laser sensors VL53L1X / VL53L0X. Arduino Core & ESP-IDF implementations. For ESP32 available also with FreeRTOS. ESP8266 and ESP32 support for Ultra Low Power deep sleep app. ESP32 available with PHY Ethernet LAN8720

License

Notifications You must be signed in to change notification settings

martinius96/hladinomer-studna-scripty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’§ Water Level Monitor - Arduino / ESP8266 / ESP32

This repository contains software implementations for water level monitoring using microcontrollers such as Arduino (ATmega328P/ATmega2560), ESP8266, and ESP32. It supports a variety of ultrasonic, ToF laser sensors to measure water levels in wells, tanks, and other water sources. The project includes data transmission via Ethernet, WiFi, and IoT technologies such as Sigfox and LoRa / LoRaWAN.

The firmware is designed to be highly flexible, supporting different microcontroller functions, including Ultra-Low-Power (ULP) modes, Remote Over-The-Air (OTA) updates, and real-time operating systems like FreeRTOS for ESP32. This makes it suitable for both small-scale DIY projects and industrial IoT water monitoring solutions.

πŸš€ Key Features

  • πŸ’§ Real-Time Monitoring: Ultrasonic sensors measure water levels continuously.
  • πŸ–₯ Web Interface: Real-time graphs, history, and alerts.
  • πŸ”Œ Multiple Connectivity: Ethernet, WiFi, Sigfox, LoRa.
  • πŸ”‹ Ultra-Low Power: Deep sleep for ESP32/ESP8266.
  • πŸ”„ OTA Updates: Easy remote firmware upgrade.
  • πŸ•Ή FreeRTOS Support: Advanced ESP32 projects.

Supported Sensors:

  • Ultrasonic Sensors: e.g., HC-SR04, JSN-SR04T, IOE-SR0X, and others.
  • Laser: e.g., VL53L1X (TOF400C), VL53L0X (TOF200C).
  • Other: Required to do your own firmware, or set callback in case of industrial sensors

Supported Data Transmission Protocols:

  • Ethernet, WiFi, Sigfox, LoRa.
  • HTTP and HTTPS support for secure web connections.
  • Integration with MySQL databases for storing water level data.

Web Interface Features:

  • Real-Time Data Visualization: View water levels, trends, and volume calculations in an easy-to-understand format.
  • Historical Data: Access past records, minimum/maximum values, and trends over time.
  • Graphical Data Representation: Visualize water levels over the past 24 hours, 7 days, and 30 days.
  • Multilingual Support: Available in English, German, Russian, and Slovak.

Important Note:
The test web interface currently supports HTTP protocol only. HTTPS configurations are available in example code but will not work with the current web interface.

Getting Started:

To start using the Water Level Monitor project, follow these steps:

  1. Clone this repository or download the code.
  2. Install required libraries in Arduino IDE (/src/ folder).
  3. Upload the sketch to your microcontroller (choose between Offline Tester or Online Sketch).
  4. If using a web interface:
    • Import the .sql table into your MySQL database.
    • Update connect.php with your MySQL access credentials and API key for authentication.
  5. Set the depth and diameter of your well in the web interface settings.
  6. Upload the generated sketch to your microcontroller, ensuring the API key is included.

For OTA updates, ensure your microcontroller is configured with WiFi or Ethernet connectivity.

Supported Microcontroller Operation Modes:

Microcontroller Offline Tester StandBy Deep Sleep StandBy + OTA FreeRTOS
Arduino + Ethernet βœ… βœ… ❌ ❌ ❌
ESP8266 βœ… βœ… βœ… βœ… ❌
ESP32 βœ… βœ… βœ… βœ… βœ…
ESP32 + PHY βœ… βœ… βœ… βœ… βœ…

Obtaining Root CA certificate (For ESP32 / ESP8266 - HTTPS) - OpenSSL tool

  • openssl s_client -showcerts -verify 5 -connect example.com:443 < /dev/null

Supported Hardware for Water Level Monitoring

The Water Level Monitor project is compatible with a wide range of hardware setups, including popular microcontrollers and sensors for measuring water levels in wells, tanks, and other water bodies. Below are the supported hardware configurations and wiring diagrams to help you get started.

1. Water Level Monitor - Open-Source Hardware Setup

ESP32-C6 + VL53L1X/TOF400C laser sensor ESP32-C6 + HC-SR04 ultrasonic sensor

Water Level Monitor - Web Application Screenshots

Check out the key features of the Water Level Monitor web app that allows you to visualize and analyze the water level data in real time.

1. Real-Time Water Level Overview

Monitor water levels and volume in real time with easy-to-read visualizations. Watmonitor - Realtime dashboard

2. Historical Datas + Gauge graphs

View the difference in water levels over time with a comprehensive table of recorded data and minimal / maximal values recorded Watmonitor - Historical data

3. Graphs

Advanced graph visualisations with possiblity to export graph in .csv, .svg, .png Watmonitor - ApexCharts

4. Source code generator

In-built source code generator for ESP32 (automatically calculated traces based on dir depth) Watmonitor - source code generator

5. QR scanner

QR scanner that can visualise the latest data by scanning QR code Watmonitor - QR scanner

5. Augmented reality

AR visualisation of the latest data as dashboard when QR code scanned Watmonitor - Augmented reality image

About

Water level monitor using open-source microcontrollers (Arduino, ESP8266, ESP32) and ultrasonic sensors HC-SR04 / JSN-SR04T / or TOF laser sensors VL53L1X / VL53L0X. Arduino Core & ESP-IDF implementations. For ESP32 available also with FreeRTOS. ESP8266 and ESP32 support for Ultra Low Power deep sleep app. ESP32 available with PHY Ethernet LAN8720

Topics

Resources

License

Stars

Watchers

Forks