Course Content
IoT Engineering Course using ESP32 with 12 Real-World Projects

💧 Water Level Sensor – Complete Explanation

https://projects.arduinocontent.cc/cover-images/d4909f47-760e-4094-b5f9-40ba6a03ebd5.blob
https://img80003270.weyesimg.com/uploads/kaidi86.com/images/17020942737956.jpg?imageslim=
https://www.researchgate.net/publication/354766082/figure/fig2/AS%3A11431281158833400%401684245769296/Analog-water-level-sensor-placed-in-the-upper-and-lower-part-of-the-water-tank.png
4

📌 1️⃣ What is a Water Level Sensor?

A Water Level Sensor is an electronic device that detects the presence or level of water in a tank.

It works based on:

  • Electrical conductivity of water

  • Resistance change between exposed tracks

When water touches the sensing lines:

  • Current flows between traces

  • Output signal changes

  • ESP32 reads this change


📌 2️⃣ Types of Water Level Sensors

There are mainly 3 common types:

🔹 1. Conductive Type (Most common & cheap)

  • Uses exposed copper traces

  • Detects water by conductivity

  • Used in Arduino/ESP32 projects

🔹 2. Float Switch Type

  • Mechanical switch

  • ON/OFF only

  • Used in water tanks

🔹 3. Ultrasonic Sensor (Advanced)

  • Measures distance from top

  • Gives percentage level

  • More accurate

For your project:
👉 You are using Conductive Water Level Sensor


📌 3️⃣ Parts of Water Level Sensor Module

Most modules have:

Pin Function
VCC Power (3.3V or 5V)
GND Ground
AO Analog Output
DO Digital Output

📌 4️⃣ How It Works

Inside the sensor:

  • Multiple parallel copper traces

  • When dry → high resistance

  • When water touches → low resistance

  • Signal changes at output

If using:

🔹 Analog Output (AO)

  • Gives value from 0 to 4095 (ESP32)

  • Used for measuring level percentage

🔹 Digital Output (DO)

  • Only HIGH or LOW

  • Used for simple FULL / EMPTY detection


📌 5️⃣ Connection with ESP32

If using Analog Pin:

Sensor ESP32
VCC 3.3V
GND GND
AO GPIO 34 (ADC pin)

If using Digital Pin:

Sensor ESP32
VCC 3.3V
GND GND
DO Any Digital Pin

📌 6️⃣ Example Analog Reading Code (ESP32)

 
 
int waterPin = 34;
int waterValue;

void setup() {
Serial.begin(115200);
}

void loop() {
waterValue = analogRead(waterPin);
Serial.println(waterValue);
delay(1000);
}

 

If:

  • Low value → Tank Empty

  • High value → Tank Full


📌 7️⃣ Why It Is Important in Your Project

In your Smart Water Management System:

When sensor detects:

  • LOW water → Motor ON

  • FULL water → Warning + Motor OFF

It prevents:

  • Overflow

  • Dry running

  • Motor damage

  • Water waste


📌 8️⃣ Advantages

✔ Cheap
✔ Easy to use
✔ Simple wiring
✔ Good for small projects


📌 9️⃣ Disadvantages

⚠️ Copper traces can corrode over time
⚠️ Not very accurate
⚠️ Not good for long-term permanent installation


📌 🔟 Best Practice Tips (Important for Viva)

  • Always use 3.3V for ESP32

  • Don’t keep sensor powered continuously (reduce corrosion)

  • Place sensor vertically

  • Clean sensor monthly

  • For long-term use → Prefer Float or Ultrasonic


📌 Comparison (For Viva Explanation)

Feature Conductive Float Ultrasonic
Cost Low Medium High
Accuracy Medium Low High
Maintenance High Low Low
IoT Ready Yes Yes Yes

📌 Final Summary

The Water Level Sensor is a conductivity-based sensing device that detects water presence by measuring resistance change.

In your project, it acts as the main input device that:

  • Detects tank level

  • Sends signal to ESP32

  • Controls motor logic

It is a simple but powerful sensor for automation projects.

Scroll to Top