Description
Water/Liquid Level Detection Sensor Module is very easy to use. Simply, If the board has water or another fluid covering all the wire, then it will output a maximum analog value reading. Hence, 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. If the board is halfway covered, the Arduino will read a reading of about 512. Accordingly, if the board is 1/4 covered by a liquid, then the Arduino will read about 256. And if no liquid is on it at all, then you will obtain a near 0 reading.
Water/Liquid Level Detection Sensor Module Operation Code
/*Code for Liquid Level Sensor Circuit Built with an Arduino*/ const int sensorPin= 0; //sensor pin connected to analog pin A0 int liquid_level; void setup() { Serial.begin(9600); //sets the baud rate for data transfer in bits/second pinMode(sensorPin, INPUT);//the liquid level sensor will be an input to the arduino } void loop() { liquid_level= analogRead(sensorPin); //arduino reads the value from the liquid level sensor Serial.println(liquid_level);//prints out liquid level sensor reading delay(100);//delays 100ms }