Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Water Level Detection with Buzzer and LED Indicator

View and Edit Project In Cirkit DesignerImage of Arduino UNO Water Level Detection with Buzzer and LED Indicator

Circuit Documentation

Summary of the Circuit

This circuit is designed to monitor the water level using a water level sensor and provide visual and audible alerts when the water reaches a certain level. The core of the circuit is an Arduino UNO microcontroller, which reads the sensor data and controls a buzzer and an LED based on the water level. The buzzer and LED are activated when the water level is high, indicating a potential overflow condition.

Component List

Arduino UNO

Buzzer

Water Level Sensor

LED: Two Pin (red)

Comments

Wiring Details

Arduino UNO

Buzzer

Water Level Sensor

LED: Two Pin (red)

Documented Code

// Define the pins for the water sensor, buzzer, and LED
const int waterSensorPin = 12;
const int buzzerPin = 10;
const int ledPin = 10;

void setup() {
  // Initialize the water sensor pin as input
  pinMode(waterSensorPin, INPUT);
  
  // Initialize the buzzer and LED pins as outputs
  pinMode(buzzerPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // Read the water sensor value
  int sensorValue = digitalRead(waterSensorPin);
  
  // If water is detected, turn on the buzzer and LED
  if (sensorValue == HIGH) {
    digitalWrite(buzzerPin, HIGH);
    digitalWrite(ledPin, HIGH);
  } else {
    // If water is not detected, turn off the buzzer and LED
    digitalWrite(buzzerPin, LOW);
    digitalWrite(ledPin, LOW);
  }
  
  // Wait for 100 milliseconds before reading the sensor again
  delay(100);
}

Note: The code provided controls both the buzzer and the LED using the same pin (D10). This is likely an error, as they should be controlled independently. The code should be revised to use separate pins for the buzzer and the LED.