Water level

Overview #

Level sensors are used to detect the level of substances that can flow. Such substances include liquids, granular material and can also be used to measure powdered substances.

Level sensors are widely used industrially, as level acts as an important monitoring parameter. These are low-cost easy-to-use sensor. The water level sensor module has a series of parallel exposed traces to measure droplets/water volume in order to determine the water level which is directly proportional to the output to an analog signal.

Here is a probe type water level sensor. Point Probe sensors are mostly Capacitive type or Resistive. It measures change in the value of capacitance when the sensor is dipped into the liquid. The change corresponds to level variation.


The same code can be used for a rain drop sensor as well, as the principle is similar. If the board has water or another fluid covering all the wire, then it will output a maximum analog value reading. Since analog values read by an Arduino range from 0 (lowest reading) to 1023 (highest reading), a board completely submerged with a liquid will have a reading of 1023 by an Arduino and if it is not submerged into liquid, then a near 0 reading is obtained.


Documentation for the water level sensor is available here

Connecting to Arduino #


Code example #

 * Water level sensor tester
 * measuring the capacitance of water and hence the water level.
int sensorPin = A0; 
int sensorValue = 0;
void setup() {
void loop() {
 sensorValue = analogRead(sensorPin); 
 Serial.print("Sensor = " ); 
The raw source of the sketch example is visible here.


2018 - Muhammad Ehsan, Mamour Diop & Congduc Pham