Measure water level remotely using ESP32

ESP32 19-12-24
17 0

Tutorial Plan

1- Water measurement objective

2- How does ESP32 card measure water level ?

3- Materials Needed

4- System wiring diagram

5- Programming ESP32 with Micropython

6- Develop a mobile application to receive a message from ESP32

 

 

Water measurement objective

The objective of water measurement is to quantify the volume, flow rate, or quality of water for specific purposes. These objectives can vary depending on the context, such as agriculture, environmental monitoring, industrial processes, or water resource management. Common objectives include:

1- Resource Management:

Monitoring water supply in reservoirs, rivers, or aquifers.

Ensuring sustainable usage of water resources.

2- Irrigation Efficiency:

Measuring water delivered to fields to optimize crop irrigation.

Reducing water wastage and improving agricultural productivity.

3- Environmental Protection:

Monitoring river flows and water levels to prevent flooding.

Assessing water quality to detect pollution or ecological changes.

4- Industrial Processes:

Measuring water consumption in manufacturing.

Monitoring water flow for process optimization.

5- Billing and Regulation:

Ensuring accurate metering for water usage billing in residential, commercial, or industrial sectors.

Enforcing regulatory compliance for water extraction or discharge.

6- Flood and Drought Management:

Monitoring water levels to predict and mitigate floods.

Assessing water availability during droughts.

7- Research and Development:

Supporting scientific studies on hydrology, climate change, or water ecosystems.

Evaluating the efficiency of water conservation techniques or technologies.

 

How does ESP32 card measure water level ?

Using an ESP32 microcontroller to measure water level with simple components like wires, resistors, and a bottle involves creating a basic water-level sensor system. The system measures water level based on electrical conductivity and communicates the data via Bluetooth to an app created in MIT App Inventor.

Working Principle

Water Conductivity: Water conducts electricity, so when the water level touches a wire probe, it completes the circuit.

Voltage Divider: By using resistors, the ESP32 reads the varying voltage levels corresponding to different water heights.

Bluetooth Communication: The ESP32 sends water level data to the app via Bluetooth.

 

Materials Needed

ESP32 Microcontroller

 

Role: Acts as the brain of the system. It reads the input from the water-level probes (wires) and communicates the data to a mobile app via Bluetooth.

Wires (Probes)

Fils de connexion

Role: Serve as water-level sensors inside the bottle.

Working Principle:

Water completes the circuit when it touches a wire, allowing a small current to flow, which changes the voltage at the input pin.

The voltage level corresponds to the height of water in the bottle.

Resistors

quatre résistances

Role:

Protect the ESP32 by limiting the current flow in the circuit.

Create a voltage divider circuit for stable and measurable signals.

Bottle

Role:

Acts as the water container for the measurement system.

Provides a controlled environment to test water-level detection.

Helps simulate real-world water-level monitoring scenarios.

 

System wiring diagram

First We drill 5 holes in the bottle. Then we fix a connection wire in each hole.

Then we connect:

1- the lowest jumper wire to the 3.3V pin of ESP32

2- the 2nd wire connecting to pin D33 of ESP32

3- the 3rd wire to pin D32 of ESP32

4- the 4th wire to pin D35 of ESP32

5- the 5th jumper wire to pin D34 of ESP32

 

Programming ESP32 with Micropython

Here are the micropython programs that can detect the level of water filled in the bottle and send this information to the Smartphone via Bluetooth.

1- Flash your ESP32 with MicroPython using this file esp32-20210902-v1.17.bin.

2- import this two libraries : ble_uart_peripheral.pyble_advertising.pyfor communication to Smartphone.

This code continuously reads the analog signals from the input pins, converts the voltage levels into water height values and sends the water level data via Bluetooth.

 

Develop a mobile application to receive a message from ESP32

Design the Interface:

1- Create sliders, labels, or progress bars to show water levels.

2- Add a "Connect" button to establish Bluetooth communication.

Here is the Designer part of the application with App Inventor :

Programming the application with App Inventor:

a- Use the available blocks in App Inventor to establish a Bluetooth connection with the ESP32.

- Starting with Android 12, Bluetooth permissions have been enhanced to improve security and user data protection. This is why we must declare the authorizations that your application needs in the AndroidManifest.xml file. For Bluetooth, you'll need to include ACCESS_FINE_LOCATION, BLUETOOTH_SCAN, and possibly BLUETOOTH_CONNECT permissions, depending on the features you're using.

b- Use these programming blocks to connect the smartphone to the ESP32 board via Bluetooth:

c- Use these programming blocks to Continuously receive data and parse the water levels.

Download project Download apk file

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info