The water level meter project uses a web interface to visualize the measured data on the water level in the well, tank. The responsive web interface in the Bootstrap Bar template adapts to any screen on which the data is visualized. The data is readable on watches, smartphones, computers, Smart TVs and other devices. The web interface of the project uses a backend written in PHP, which processes incoming data supported by the POST request method, converts the measured temperature to the actual water level, calculates the well volume based on known data on depth and well diameter entered into the system by the user. The data is sent to a web server by a microcontroller, which performs measurements every 300 seconds - i. For 5 minutes, or in the case of transmission via the Sigfox IoT network, the data is sent every 11 minutes. Water level measurement is performed using ultrasonic sensors - HC-SR04, or its waterproof variant JSN-SR04T, or UART sensor URM07 (SKU SEN0153) - available only in a special version of the project Level meter. It can measure a distance of up to 750 cm, due to the large detection angle, it does not fit into a large number of wells ... The principle of measuring ultrasonic sensors is to send a Trigger signal with a length of 10μs (microseconds) and based on the time when the signal returns to the receiver - Echo it is possible to calculate the distance between the sensor and the level. An important parameter in both ultrasonic sensors is the beam width, in other words the detection characteristic. The HC-SR04 sensor has a 15 ° detection characteristic. The beam is relatively narrow and the sensor is also suitable for narrower wells and tanks, but it is not waterproof and has a high risk of corrosion (oxidation). The JSN-SR04T waterproof sensor has a detection characteristic of 60 to 75 °, which does not allow it to be used in narrow wells, as the beam expands greatly with distance and requires a well with a diameter of several units (6 meters at 4.5 well depth).
The web interface uses trigonometry to estimate the measurable maximum depth of the well at a known well diameter (another parameter for calculating the well volume). The web interface allows the user to calculate to what maximum depth of the well each of the sensors is suitable based on its characteristics. The project is so easy to use even for laymen who do not know which sensor is more suitable for application in their well. The microcontroller used also plays an important role in the system. The project used the Arduino (Uno) platform connected to an Ethernet module / shield from the Wiznet model W5100 and W5500 series, respectively, which provided HTTP connectivity and enabled the microcontroller to transfer data to a remote web interface on the Internet. As the level meter is an outdoor project, many users would also like the possibility of using a WiFi platform without having to pull Ethernet connectivity to the well. WiFi platforms from Espressif Systems - ESP8266 and ESP32, which are used in the project allow operation in various modes - StandBy, Deep Sleep (deep sleep with WiFi antenna off), StandBy + OTA - allows you to remotely upload to the board new firmware directly from the LAN Arduino IDE environment. For the Deep Sleep operating mode, there is a modified wiring diagram for the ESP8266 platform, which uses a signal that is fed to the RST to wake up the WAKE microcontroller. At the same time, this connection does not allow the program to be updated without disconnecting this jumper. For ESP32, the Deep Sleep mode is used using an RTC timer, which wakes up ESP after a certain time. Platforms can communicate with the web interface via HTTP, but also HTTPS protocol. The ESP8266 platform uses a fingeprint of the web server's public key in SHA1 format, but requires more frequent renewals, as they are valid for a maximum of one year or 2 years, respectively. The microcontroller from the ESP32 series uses the certificate of the root certification authority, which issued a certificate for the web server - the ROOT CA certificate in .pem format for the HTTPS connection. From the point of view of operation, this option is better, as the certificate of the certification authority is also valid for 20 years and no renewal of the certificate is necessary.
For locations where there is no coverage of the fixed Internet, it is also possible to use the IoT network Sigfox, which covers almost 90% of Slovakia, BTS broadcasting stations are located on TowerCom transmitters. This technology allows you to transmit small volumes of messages up to 12B in size. In the case of the Level meter project, the 4B water level value is sent. For a project extended by a rain gauge, the value 8B value is sent, which is formed by the height of the water level and the increment of precipitation. As Sigfox allows a maximum of 140 messages to be transmitted per day, the data transmission interval is extended to 11 minutes. In both cases, the message does not contain the full length that it can, i. 12B. Payload messages can also be supplemented with various system information, for example: GEO data (longitude / latitude), RSSI (Signal Strength), message number and others. The communication module that was used for the project is a Sigfox WISOL 868MHz UART modem. This modem communicates via AT commands via the UART interface, which is software emulated on microcontrollers. The communication will take over at a speed of 9600 baud / s. The WISOL modem is equipped with an integrated u.FL connector on the PCB module for antenna connection, which significantly reduces coverage even indoors / shaded outdoors. For successful data transmission, coverage by two, preferably three or more BTS stations is required for successful data transmission. The BTS sends the transmitted information to the Sigfox backend, where it is necessary to make a callback, which will start after receiving the data. The callback must make an HTTP or HTTPS request to the domain where the web application is running with the POST method and a suitably encoded payload that the web application backend expects.