Skip to content
Sensorsenvironmental

Rain Drop Detection Sensor Module

PCB-based rain and moisture detection board.

Wiring & code for

Rain Sensor practical reference

A conductive-trace PCB that detects rainfall or spilled liquid, commonly paired with servo-driven window/roof closers in weather projects. The sensing board is a grid of exposed parallel copper traces whose resistance drops sharply when bridged by water droplets, and a companion driver board (usually built around an LM393 comparator) converts that resistance change into both a digital threshold output and a proportional analog signal — a simple, low-cost way to detect the presence and rough intensity of rain or spilled liquid.

Key specifications

  • Sensor type: Conductive-trace rain/moisture sensing PCB with LM393 comparator driver board
  • Operating voltage: 3.3V–5V DC
  • Operating current: ~15-20 mA typical
  • Digital output (DO): Goes LOW when water bridges enough traces to cross the threshold set by the onboard potentiometer (HIGH when dry, on most boards)
  • Analog output (AO): Continuous voltage proportional to how much of the sensing grid is wetted — lower resistance (more water) gives a lower/higher voltage depending on wiring convention
  • Sensitivity adjustment: Onboard trimmer potentiometer sets the digital-output trigger threshold
  • Interface: 1 digital pin (threshold trigger) + 1 analog pin (intensity reading)
  • Durability note: Exposed copper traces will oxidize/corrode with repeated wetting over time — treat as a low-cost, semi-consumable sensor rather than a permanent outdoor fixture

Pinout and connection notes

Mount the sensing board at a slight tilt so water can run off rather than pool on the traces, which extends its usable life and reduces false lingering triggers after rain has stopped. Because the exposed copper traces corrode over repeated exposure to water, expect to eventually replace the sensing board itself in long-term outdoor installations, even though the separate driver board typically remains fine.

  • VCC: Power, 3.3–5V DC
  • GND: Ground
  • DO: Digital output — threshold-triggered rain/no-rain signal
  • AO: Analog output — proportional to how wet the sensing grid is

Integration checklist

  1. Confirm the exact part number and breakout-board revision.
  2. Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
  3. Check controller pin assignments and bus address or interface mode against the example code.
  4. Power up with external loads disconnected, then test signals before full integration.
  5. If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.

Troubleshooting and reproducibility

Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.

Board Integration

Library

None — built-in analogRead/digitalRead by —

No library needed; uses core Arduino functions only.

Wiring

Component pinArduino Uno pinNote
VCC5V
GNDGND
AOA0Lower value = more water on the plate.
DOD2Digital trip point, set by onboard potentiometer.

Swipe sideways to see every column →

C++
  • The exposed copper traces on the sensing plate corrode over time — fine for demos and short-term projects, not a durable outdoor install without conformal coating.
  • Lower AO values mean more water bridging the traces; a dry board reads close to the max (1023).
View full Arduino Uno guide