Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino-Controlled Rain Sensor with Relay-Activated Water Pump

Image of Arduino-Controlled Rain Sensor with Relay-Activated Water Pump

Circuit Documentation

Summary of the Circuit

This circuit is designed to detect rain using a rain sensor and activate a mini diaphragm water pump through a relay module when rain is detected. The system is controlled by an Arduino UNO microcontroller, which monitors the digital output (DO) of the rain sensor and controls the relay module accordingly. The relay module switches the power supply from a 18650 Li-Ion battery to the water pump. The circuit is powered by the 5V output from the Arduino UNO, which also powers the rain sensor and the relay module.

Component List

RAIN SENSOR

  • Pins: AO (Analog Output), DO (Digital Output), GRD (Ground), VCC (Power Supply)
  • Description: A sensor that detects water presence by measuring the conductivity between the traces on the sensor board.

18650 Li-Ion Battery

  • Pins: Positive, Negative
  • Description: A rechargeable lithium-ion battery that provides power to the circuit.

Mini Diaphragm Water Pump

  • Pins: Positive (+), Negative (-)
  • Description: A pump that moves water when powered.

KY-019 Relay Module 1 Channel

  • Pins: S (Signal), 5V (Power Supply), GND (Ground), NC (Normally Closed), COM (Common), NO (Normally Open)
  • Description: An electromechanical switch that allows the Arduino to control high power devices like the water pump.

Arduino UNO

  • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5 (Analog Inputs), SCL, SDA, AREF, D0-D13 (Digital I/O)
  • Description: A microcontroller board based on the ATmega328P, used for controlling the logic of the circuit.

Wiring Details

RAIN SENSOR

  • AO: Not connected
  • DO: Connected to Arduino UNO Digital Pin D2
  • GRD: Connected to Arduino UNO Ground
  • VCC: Connected to Arduino UNO 5V

18650 Li-Ion Battery

  • Positive: Connected to KY-019 Relay Module Normally Open (NO) Pin
  • Negative: Connected to Mini Diaphragm Water Pump Negative (-) Pin

Mini Diaphragm Water Pump

  • Positive (+): Connected to KY-019 Relay Module Common (COM) Pin
  • Negative (-): Connected to 18650 Li-Ion Battery Negative

KY-019 Relay Module 1 Channel

  • S (Signal): Connected to Arduino UNO Digital Pin D3
  • 5V: Connected to Arduino UNO 5V
  • GND: Connected to Arduino UNO Ground
  • NC: Not connected
  • COM: Connected to Mini Diaphragm Water Pump Positive (+)
  • NO: Connected to 18650 Li-Ion Battery Positive

Arduino UNO

  • D2: Connected to RAIN SENSOR Digital Output (DO)
  • D3: Connected to KY-019 Relay Module Signal (S)
  • 5V: Connected to RAIN SENSOR VCC and KY-019 Relay Module 5V
  • GND: Connected to RAIN SENSOR GRD and KY-019 Relay Module GND
  • Other Pins: Unused in this circuit

Documented Code

Arduino UNO Code (sketch.ino)

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Note: The provided code is a template and does not contain any functional code to control the circuit. The user must implement the logic for reading the rain sensor and controlling the relay module.