Skip to content

Water level monitor using open-source microcontrollers (Arduino, ESP8266, ESP32) and ultrasonic sensors HC-SR04 / JSN-SR04T and similar with Trigger and Echo signals. 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 LAN8…

License

martinius96/hladinomer-studna-scripty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Water Level Monitor - Arduino / ESP / Sigfox / LoRa

Repository contains software implementations in Wiring language (Arduino Core) for AVR ATmega328P / ATmega2560 microcontrollers (Arduino Uno / Mega R3), ESP8266 and ESP32. Implementations allow the use of an ultrasonic distance sensor from the RCW series, US-XXX, IOE-SR0X, SR0X, HC-SR0X, HY-SRF0X, DYP-MEXXX, Parallax PING)))™ to record the water level (distance). Supported technologies for data transmission are: Ethernet / WiFi / IoT Sigfox / LoRa. Firmware is divided based on additional functions that microcontrollers support. Standard StandBy mode enables data transfer to the web interface and takes care of maintaining constant connectivity in the LAN network. Implementations with Remote Over-The-Air (OTA) firmware update support are available for the ESP8266 and ESP32 over a LAN with a network OTA port. Ultra-Low-Power (ULP) firmware for ESP microcontrollers is also available, which minimizes power consumption due to the microcontroller switching to Deep Sleep mode. Microcontroller wake-up is performed by a supported method (RTC Timer for ESP32, External Wake for ESP8266).


Firmware is available for ESP32 using the FreeRTOS real-time operating system. The implementation is available in Arduino Core, or in the ESP-IDF framework, corresponds to StandBy mode. Available firmware allows data transfer to a test web interface, where it is possible to record and visualize data on the water level in the well. Project's test web interface only supports the HTTP protocol, examples for HTTPS connections will not work! Web application is available in English, German, Russian and Slovak. Water Level Monitor project in the older version also exists with the extension of a rain gauge, which allows you to record the frequency of precipitation (the rain gauge project is not maintained). Extended project description: https://martinius96.github.io/hladinomer-studna-scripty/en/ Web interface for Water Level Monitor with the possibility of testing: http://arduino.clanweb.eu/studna_s_prekladom/?lang=en Web interface for Water Level Monitor + RG-11 rain gauge with the possibility of testing: http://arduino.clanweb.eu/studna/?lang=en

How to get web interface?

If you are interested in purchasing the web interface, contact: martinius96@gmail.com

  • It is possible to try the project with your hardware for free for any period of time on the test web interface

Starting the Water Level monitor project

  • The contents of the folder /src/ expand to C:/Users/[User]/Documents/Arduino/libraries
  • Upload the given program (off-line tester / on-line sketch) to the microcontroller for sending data to the web interface by POST method
  • In case of purchasing a project with a web interface -> import .sql table into MySQL database
  • In connect.php set the access data to the MySQL database, HTTP Auth data and API key for the microcontroller that will be authorized to write data
  • Set the depth and diameter of the well in the Settings section, including the name of the well / measuring point
  • Upload the program that will be generated after this step (with API key) to the microcontroller
  • Operation of the project with the possibility of cloning

Software implementations for transmission protocols according to microcontrollers:

Microcontroller HTTP HTTPS
Arduino + Ethernet ×
ESP8266
ESP32
ESP32 + PHY LAN8720

Supported operating modes of microcontroller operation in source codes:

Operating mode Offline Tester StandBy Deep Sleep StandBy + Over The Air (OTA) FreeRTOS
Microcontroller - - - - -
Arduino + Ethernet × × ×
ESP8266 ×
ESP32

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

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

Supported hardware

Water level monitor open-source hardware - well water level monitor Water level monitor - ESP32 + PHY Ethernet LAN8720 module, waterproof ultrasonic sensor JSN-SR04T

Wiring for microcontrollers + HC-SR04 / JSN-SR04T

Wiring diagram - level meter - sensor HC-SR04 / JSN-SR04T

Water level monitor - webapp screenshots

Level meter - Overview of the water level in the well and the volume of the well in real time Level meter - Table of difference records, historical data for the entire period of the well monitor Level meter - Alarm representation of maximum, minimum data Level meter - Graphical representation of measured data in 24 hours, 7 days, 30 days Level meter - ESP32 - ESP-IDF- FreeRTOS, HTTPS connectivity

Other water level sensors (requires own firmware)

  • Laser (LiDAR)- Garmin LIDAR-Lite v3HP / TFMini
  • Hydrostatic (submersible) - LMK307 / LMP305 / DPT200
  • Electrostatic (capacitive / inductive)
  • Pressure (differential / with compensating atmospheric pressure sensor)
  • Optical - GP2Y0A02YK0F
  • Mechanical (float)
  • Magnetic (Hall)
  • Microwave (radar) - CS476 / CS475A-L / SP69 / WLR 8/15/30
  • Ultrasonic - other type of output (UART, RS-232, current loop 4-20 mA, Modbus TCP / RTU, M-bus, RS-485, PROFINET, CAN, SDI, DQ ...)
  • Note: If the water level is recalculated from the bottom on the microcontroller side, it is necessary to set the well depth to 0 cm on the web interface.

Extended version of Water Level monitor project with Rain Gauge offers (NOT SUPPORTED):

  • Water level monitor features (above)
  • Data collection from Hydreon RG-11 rain gauge - reading in interruption with debouncing 15ms
  • Visualization in the web interface
  • Visualization extended by 30 days, 365 days
  • Graphic development of precipitation
  • Measurable total (sum) of precipitation in 2 hours, 24 hours, 7 days, 30 days, 365 days

Screenshots of Water level monitor project with Rain Gauge

Ultrasonic water level monitor with Rain Gauge Hydreon RG-11 - Dashboard Ultrasonic water level monitor with Rain Gauge Hydreon RG-11 - Historical datas Ultrasonic water level monitor with Rain Gauge Hydreon RG-11 - Graphical visualisation in time - water level Ultrasonic water level monitor with Rain Gauge Hydreon RG-11 - Graphical visualisation in time - rain

About

Water level monitor using open-source microcontrollers (Arduino, ESP8266, ESP32) and ultrasonic sensors HC-SR04 / JSN-SR04T and similar with Trigger and Echo signals. 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 LAN8…

Topics

Resources

License

Stars

Watchers

Forks