The Flood Sensor is a device designed to detect the presence of water and alert users to potential flooding. This sensor is commonly used in basements, bathrooms, kitchens, and other areas prone to water damage. By providing early warnings, it helps prevent extensive damage and costly repairs.
Parameter | Value |
---|---|
Operating Voltage | 3.3V - 5V |
Operating Current | < 20mA |
Detection Area | 38mm x 38mm |
Output Type | Digital (High/Low) |
Response Time | < 500ms |
Operating Temperature | -10°C to 50°C |
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V - 5V) |
2 | GND | Ground |
3 | DO | Digital Output (High when water detected, Low otherwise) |
Power the Sensor:
Connect the Output:
Example Circuit:
// Define the pin connected to the DO pin of the flood sensor
const int floodSensorPin = 2;
// Define the pin connected to the onboard LED
const int ledPin = 13;
void setup() {
// Initialize the serial communication
Serial.begin(9600);
// Set the flood sensor pin as input
pinMode(floodSensorPin, INPUT);
// Set the LED pin as output
pinMode(ledPin, OUTPUT);
}
void loop() {
// Read the state of the flood sensor
int sensorState = digitalRead(floodSensorPin);
// If water is detected
if (sensorState == HIGH) {
// Turn on the LED
digitalWrite(ledPin, HIGH);
// Print a message to the serial monitor
Serial.println("Water detected!");
} else {
// Turn off the LED
digitalWrite(ledPin, LOW);
// Print a message to the serial monitor
Serial.println("No water detected.");
}
// Wait for 500 milliseconds before the next loop
delay(500);
}
False Positives:
No Detection:
Erratic Behavior:
By following this documentation, users can effectively integrate and utilize the Flood Sensor in their projects, ensuring timely alerts and preventing potential water damage.