Water Level Sensor Module with Arduino

arduino logo

Welcome to the World of Sensors and Modules with Arduino!

The Water Level Sensor is an essential component for accurately monitoring liquid levels. Whether ensuring optimal water levels in industrial tanks, safeguarding home appliances, or supporting environmental monitoring, this sensor proves indispensable for efficient and reliable liquid level management. In this sensors and modules guide, we’ll explore its working principle, key features, applications, and how it can enhance your Arduino projects.

If you’re new to Arduino, why not take a look at our Getting Started with Arduino guides. These guides are designed for beginners to learn the fundamental basics of Arduino programming.

How the Water Level Sensor Works

The Sensor has 10 copper traces. These traces are not connected but once submerged into water they become connected. The traces form a variable resistor, the resistance varies depending on how submerged the sensor module becomes. The further the sensor is submerged into water the better the conductivity becomes giving a lower resistance. The less the sensor module is submerged, the less the conductivity, and higher the resistance.

Features and Specifications:
  • Operating Voltage: 3.3V ~ 5V
  • Operating Current: < 20mA
  • Advanced Sense-Tracing Technology: Utilizes a sophisticated array of 10 conductive traces to detect liquid levels with precision and responsiveness.
  • Output: Analog and Digital Signals.
  • Real-Time Liquid Level Monitoring: Delivers instant and real-time data on liquid levels, ensuring prompt response to changing conditions and enabling dynamic control mechanisms.
  • Responsive Conductivity Detection: The conductive traces respond to changes in liquid conductivity, offering a reliable method for accurate detection as water levels vary.
  • Calibrated Sensitivity Mapping: Calibrated to provide precise readings, the sensor maps the conductivity changes to specific water levels, delivering accurate measurements for informed decision-making.
  • Compatibility: This sensor is also compatible with other devices like the Raspberry Pi, ESP32, and ESP8266 etc…

Necessary Equipment:

  • Arduino board (e.g., Arduino Uno)
  • Water Level Sensor Module
  • Jumper wires
  • Breadboard (optional)

Pin Configuration

Wiring the Water Level Sensor to an Arduino is straightforward. The Water Level Sensor typically consists of 3 pins: 

  • S on the Water Level Sensor to Analog pin A0 on the Arduino.
  • + on the Water Level Sensor to 5V on the Arduino.
  • on the Water Level Sensor to GND on the Arduino.

Pin labels may vary.

Water Level Sensor with Arduino Diagram

Arduino Code Examples

Run the calibration code first to find the maximum value for the sensor being 100% submerged. Make a note of the maximum value when the traces are fully submerged. Make sure to only submerge the traces.
Calibration Code:
const int sensorPin = A0;  // Analog pin for sensor
int waterLevel;

void setup() {

void loop() {
  waterLevel = analogRead(sensorPin);

  Serial.print("Water Level: ");

  delay(1000);  // Adjust the delay as needed
Main Code:
After running the calibration code, and noting the maximum value, replace the value in the waterMax variable below to your new value.
const int sensorPin = A0;  // Analog pin for sensor
int waterLevel;
int waterMax = 700; // Edit this value to achieve 100% readings when sensor is fully submerged (0-1023)

void setup() {

void loop() {
  waterLevel = analogRead(sensorPin);

  // Adjust the map functions waterMax value above to match the behavior of your sensor
  int mappedLevel = map(waterLevel, 0, waterMax, 0, 100); 

  Serial.print("Water Level: ");

  delay(1000);  // Adjust the delay as needed

Breaking Down the Code

Pin and Variable Declarations
  • const int sensorPin = A0;

    • Defines a constant integer variable sensorPin and assigns it the value A0, representing the analog pin to which your water level sensor is connected.
  • int waterLevel;

    • Declares an integer variable waterLevel to store the analog reading from the water level sensor.
  • int waterMax = 700;

    • Sets an integer variable waterMax to a specific value (700 in this case), which is used to calibrate the maximum analog reading corresponding to 100% water level. You may need to adjust this value based on your sensor’s behavior.
Setup Function 
  • Serial.begin(9600); initializes serial communication at a baud rate of 9600, allowing you to send and receive data between your Arduino and a connected computer.
Loop Function
  • waterLevel = analogRead(sensorPin); reads the analog value from the water level sensor and stores it in the variable waterLevel.

  • int mappedLevel = map(waterLevel, 0, waterMax, 0, 100);

    • Uses the map function to convert the raw analog reading (waterLevel) to a percentage value (mappedLevel). This mapping is based on the defined waterMax value, which represents the maximum analog reading for 100% water level.
  • Serial.print("Water Level: ");, Serial.print(mappedLevel);, Serial.println("%");

    • Prints the water level information to the Serial Monitor, displaying the percentage of water level.
  • delay(1000);

    • Introduces a delay of 1000 milliseconds (1 second) between each iteration of the loop. You can adjust this delay based on your requirements.

The primary focus of this code is to read analog values from the water level sensor, map them to a percentage value, and output the result to the Serial Monitor for monitoring and calibration purposes. The waterMax variable plays a crucial role in calibrating the mapping to achieve accurate readings based on your specific sensor characteristics. Adjusting this value might help you fine-tune the mapping for more accurate results.

Applications and Usage Scenarios

Industrial Tanks and Reservoirs

Critical for monitoring and controlling liquid levels in industrial processes, preventing overflow or shortages.

Home Appliances

Ensures precise water levels in household appliances like washing machines, dishwashers, and water heaters, contributing to their optimal performance.


Supports efficient water management in irrigation systems, responding to soil moisture levels or reservoir capacities.

Environmental Monitoring

Deployed in weather stations and environmental monitoring systems to gauge water levels in natural bodies or collected rainfall.

Automated Pump Control

Interfaces with pumps to automate the control of water levels, ensuring a consistent and regulated flow.

Alarm Systems

Configurable for setting up alarms or notifications when liquid levels deviate from predefined ranges, providing timely alerts.

Data Logging and Analysis

Supports data logging, allowing for the tracking of liquid levels over time. Data analysis can reveal trends and patterns for informed decision-making.


In this sensors and modules guide, we explained the functionality of the Water Level Sensor, exploring its working principles, and demonstrating how to interface it with an Arduino for practical applications. The water level sensor stands as a pivotal tool for maintaining optimal liquid levels in a diverse range of applications. Its precision and adaptability contribute significantly to the seamless and efficient management of liquid resources, ensuring reliability across a spectrum of scenarios.

Discover the endless possibilities for Arduino projects with more of our Sensors and Modules guides.

Luke Barber

Hello, fellow tech enthusiasts! I'm Luke, a passionate learner and explorer in the vast realms of technology. Welcome to my digital space where I share the insights and adventures gained from my journey into the fascinating worlds of Arduino, Python, Linux, Ethical Hacking, and beyond. Armed with qualifications including CompTIA A+, Sec+, Cisco CCNA, Unix/Linux and Bash Shell Scripting, JavaScript Application Programming, Python Programming and Ethical Hacking, I thrive in the ever-evolving landscape of coding, computers, and networks. As a tech enthusiast, I'm on a mission to simplify the complexities of technology through my blogs, offering a glimpse into the marvels of Arduino, Python, Linux, and Ethical Hacking techniques. Whether you're a fellow coder or a curious mind, I invite you to join me on this journey of continuous learning and discovery.

Leave a Reply

Your email address will not be published. Required fields are marked *

Verified by MonsterInsights