Introduction: Water Level - Arduino / ESP + Ultrasonic
A water level monitor project is a type of project with recording and storing data that can be used for extended statistics of daily water level development. Thanks to this, it is possible to determine the months of the year when there is a lack of water in the wells and the opposite, when there is enough or even surplus water. The project can become the basis for another project - automatic irrigation controlled by a microcontroller. The project can also integrate advanced control of power elements - pumps, waterworks, solenoid valves, which can be watered garden and flower beds - to irrigate, or even pump water and use it as a useful flushing, washing. The project from the basic version used only logging data to the MySQL database at regular 5-minute intervals.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Ultransonic Hardware - HC-SR04 + Transfer Technology
To record the water level (but also the height of other quantities, such as snow, coal, wood) I used an affordable ultrasonic distance sensor HC-SR04, which is characterized by high reliability and ease of use and low consumption. It can measure 2-450 centimeters. It uses ultrasound at a frequency of 40kHz with a transmit pulse of 10 microseconds. Depending on the time since the reflected wave is received, the distance to the object from which the wave is reflected can be calculated by the formula. However, the surface is required to be perpendicular to the ultrasonic distance sensor for accuracy of measurement.
The description shows that it is possible to measure a well with a height of 450cm. The sensor is placed on the upper level, preferably in the center of the well. To make the measurements as accurate as possible, a total of 5 measurements are made and averaged. However, since the measurement result is rotated - the distance from the top and not the bottom is measured, it is necessary to subtract the result from the maximum height (450cm - or another for a shallower well) and create an absolute value. Thus we can determine the height of water in the well. If we know the diameter of the well and the height of the water column, we can also determine the liters of water to a reasonable degree.
Available transfer technology:
- Arduino + Ethernet (Wiznet W5100 / Wiznet W5500)
- ESP8266 (Wemos D1, Generic module, Wemos D1 mini, NodeMCU) - WiFi
- ESP32 (Generic, devkit v1-v4, Lolin32) - WiFi
- Sigfox Wisol - IoT (requires more initial configuration + HTTPS callback)
Step 2: Webapp, Schematics and Source Codes
Webapp source codes and codes for microcontrolers are available at: https://arduino.php5.sk/studna-voda.php?lang=en or firstname.lastname@example.org