How to use a Water Level Sensor Module with Arduino

Posted on by


Water Level Sensor Module for Arduino

Water Level Sensor Module for Arduino

Continuing with sensors that can be used in aquaponics, hydroponics systems or automatic outdoor plant care, we will explain how to use a water level sensor to control the amount of water we have in a tank. The same sensor can also be used to detect if it is raining.


This sensor is supplied to 5V or 3.3V on VCC and GND pins. The pin S will give us an analog value between VCC and GND. So we will use the S pin as analog input connecting Arduino, the value read will be higher depending on the sensor surface is covered with water. This is because the water acts as a conductor, given that the water we use in our deposits not be pure water (H2O), since if water is nonconductive. But rarely we will use this type of sensors to measure the water level in a tank of pure water.

Power supply 3,3V ~ 5V
Current < 20mA
Humidity sensitivity range 10% ~ 90%
Pinout +: VCC
-: GND
S: Analog output

Use as a level in a tank

To use it as level detector in a deposit have to install the sensor on the inside of the tank at the level where we want to control the water level. The sensor must be positioned so that parallel lines are perpendicular to the sensor water level. The pin S will give us a greater value as the sensor is immersed.

Use as rain detector

To detect whether it is raining with this sensor have to position it horizontally so that rain falling on the sensor, as raindrops fall on the sensor film of water on the surface will be formed by increasing the value of the pin S, this how we can deduce if it is raining.


In both cases we can use the same code, because it simply will be responsible for reading the analog value of S. pin up to us to interpret the measures we are taking.

const int analogInPin = A0; 

int sensorValue = 0;

void setup() {

void loop() {
 sensorValue = analogRead(analogInPin); 

 Serial.print("Sensor = " ); 

Comments are disabled