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

Arduino UNO Rain Detection System with LED Indicator and Buzzer Alert

View and Edit Project In Cirkit DesignerImage of Arduino UNO Rain Detection System with LED Indicator and Buzzer Alert

Circuit Documentation

Summary

This circuit is designed to interface an Arduino UNO with a YL-83 Rain Sensor, an LED, and a buzzer. The Arduino reads analog and digital signals from the rain sensor and controls the LED and buzzer based on the sensor readings. The circuit includes resistors to limit current to the LED and buzzer.

Component List

  1. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. YL-83 Rain Sensor - Detection Board

    • Description: A sensor board that detects rain.
    • Pins: POS, NEG
  3. YL-83 Rain Sensor - Control Board

    • Description: A control board for the YL-83 Rain Sensor.
    • Pins: VCC, GND, DO, AO, POS, NEG
  4. Resistor (330 Ohms)

    • Description: A resistor with a resistance of 330 Ohms.
    • Pins: pin1, pin2
  5. LED: Four Pin

    • Description: A four-pin LED with red, green, and blue cathodes and a common anode.
    • Pins: red cathode, common anode, green cathode, blue cathode
  6. Buzzer

    • Description: A simple buzzer.
    • Pins: PIN, GND

Wiring Details

Arduino UNO

YL-83 Rain Sensor - Detection Board

Resistor (330 Ohms)

LED: Four Pin

Buzzer

Documented Code

int sensor_A0 = A0; // conexión de A0 en el sensor a A0 en Arduino

int sensor_D0 = 2; // conexión de D0 en el sensor a la clavija 2 en Arduino

int valor_A0; // variable para el valor A0

int valor_D0; // variable para el valor A0

void setup() {
    Serial.begin(9600); // correr el monitor de serie
    pinMode(2, INPUT); // ajustando el pin 2 como entrada
}

void loop() {
    valor_A0 = analogRead(sensor_A0); // descargando valor desde A0
    valor_D0 = digitalRead(sensor_D0); // descargando valor de D0

    Serial.print("D0: "); // visualización en un monitor serial
    Serial.print(valor_D0);
    Serial.print(" -- A0: ");
    Serial.println(valor_A0);
    delay(200); // retraso entre lecturas consecutivas
}

This code initializes the Arduino to read analog and digital values from the YL-83 Rain Sensor and prints these values to the serial monitor. The setup function sets up the serial communication and configures the digital pin as an input. The loop function continuously reads the sensor values and prints them to the serial monitor with a delay of 200 milliseconds between readings.