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

Arduino UNO-Based Rain and Water Detection System with Bluetooth Control

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Rain and Water Detection System with Bluetooth Control

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller, a Bluetooth HC-06 module, a Rain/Snow Sensor, a Water Sensor, and a red LED. The circuit is designed to read data from the rain/snow sensor and water sensor, control an LED based on sensor readings, and communicate via Bluetooth.

Component List

Arduino UNO

Bluetooth HC-06

Rain/Snow Sensor - Board

Water Sensor

LED: Two Pin (red)

Wiring Details

Arduino UNO

Bluetooth HC-06

Rain/Snow Sensor - Board

Water Sensor

LED: Two Pin (red)

Documented Code

int rainWaterSensorPin = A0;
int ledPin = 9;
int command = 0;

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
  Serial.println("Bluetooth is ready");
}

void loop() {
  if (Serial.available() > 0) {
    command = Serial.read();
  }

  if (command == '1') {
    digitalWrite(ledPin, HIGH);
  }
  else if (command == '0') {
    digitalWrite(ledPin, LOW);
  }

  int sensorValue = analogRead(rainWaterSensorPin);
  Serial.println(sensorValue);

  if (sensorValue < 500) {
    digitalWrite(ledPin, HIGH);
  } else {
    digitalWrite(ledPin, LOW);
  }

  delay(500);
}

This code initializes the rain/snow sensor on pin A0 and the LED on pin D9. It reads commands from the Bluetooth module to control the LED and also turns the LED on or off based on the sensor readings. The sensor value is printed to the serial monitor for debugging purposes.