

The WATER SENSOR 2 is a device designed to detect the presence of water. It is commonly used in applications such as leak detection, water level monitoring, and environmental sensing. This sensor is ideal for projects requiring real-time water detection and is compatible with microcontrollers like Arduino, Raspberry Pi, and other development boards.








| Pin Name | Description |
|---|---|
| VCC | Power supply input (3.3V to 5V). Connect to the 3.3V or 5V pin of your MCU. |
| GND | Ground connection. Connect to the GND pin of your MCU. |
| Signal | Outputs the sensor reading. Can be connected to an analog or digital pin. |
Wiring the Sensor:
Reading the Output:
Example Circuit:
// WATER SENSOR 2 Example Code for Arduino UNO
// This code reads both the analog and digital outputs of the sensor
// and prints the results to the Serial Monitor.
const int analogPin = A0; // Analog pin connected to the Signal pin
const int digitalPin = 2; // Digital pin connected to the Signal pin
void setup() {
pinMode(digitalPin, INPUT); // Set digital pin as input
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int analogValue = analogRead(analogPin); // Read analog value
int digitalValue = digitalRead(digitalPin); // Read digital value
// Print the sensor readings to the Serial Monitor
Serial.print("Analog Value: ");
Serial.print(analogValue); // Analog value indicates water level
Serial.print(" | Digital Value: ");
Serial.println(digitalValue); // Digital value indicates water presence
delay(500); // Wait for 500ms before the next reading
}
No Output from the Sensor:
Inconsistent Readings:
Corrosion on the Sensor:
Digital Output Always HIGH or LOW:
Can the WATER SENSOR 2 detect the exact water level?
Is the sensor waterproof?
Can I use this sensor with a 3.3V microcontroller?
What is the maximum water depth the sensor can detect?