

The Water Level Sensor is a device designed to detect and measure the level of water in a tank, reservoir, or other container. It is commonly used in automation systems to monitor water levels and trigger actions such as turning pumps on or off, activating alarms, or sending data to a microcontroller for further processing. This sensor is simple to use, cost-effective, and widely employed in applications such as water management systems, irrigation systems, and home automation projects.








| Pin Name | Type | Description |
|---|---|---|
| VCC | Power | Connect to a 3.3V or 5V power supply. |
| GND | Ground | Connect to the ground of the power supply. |
| A0 | Analog Out | Outputs an analog voltage proportional to the water level detected. |
| D0 | Digital Out | Outputs a HIGH or LOW signal based on the water level threshold (adjustable). |
Below is an example of how to use the Water Level Sensor with an Arduino UNO to read both analog and digital outputs.
// Water Level Sensor Example with Arduino UNO
// Reads analog and digital outputs from the sensor and displays them on the Serial Monitor.
const int analogPin = A0; // Analog output pin of the sensor
const int digitalPin = 2; // Digital output pin of the sensor
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(digitalPin, INPUT); // Set digital pin as input
}
void loop() {
int analogValue = analogRead(analogPin); // Read analog value
int digitalValue = digitalRead(digitalPin); // Read digital value
// Print the readings to the Serial Monitor
Serial.print("Analog Value: ");
Serial.print(analogValue); // Display the analog value (0-1023)
Serial.print(" | Digital Value: ");
Serial.println(digitalValue); // Display the digital value (0 or 1)
delay(500); // Wait for 500ms before the next reading
}
No Output from the Sensor:
Inconsistent Analog Readings:
Digital Output Always HIGH or LOW:
Corrosion of Conductive Traces:
Q: Can this sensor detect non-water liquids?
A: The sensor is designed for water detection. It may work with other conductive liquids, but accuracy and longevity may vary.
Q: How deep can the sensor be submerged?
A: The sensor should only be submerged up to the conductive traces. Submerging the entire PCB may damage the sensor.
Q: Can I use this sensor with a 3.3V microcontroller?
A: Yes, the sensor operates at both 3.3V and 5V, making it compatible with most microcontrollers.
Q: How do I clean the sensor?
A: Gently wipe the conductive traces with a soft cloth and clean water. Avoid using abrasive materials.