Circuits / Sensors
Rain alarm with an MH-RD module
Water bridges the comb, AO falls under Vref and DO goes low: the LED on the board lights and DO pulls the PNP's base down, which switches the buzzer on

Tap a part to see its voltages and currents. It is a model, not a measurement.
What do you need?
- Sensor module (LM393) MH-RDAliExpress Amazon
- Resistor 1 kΩAliExpress Amazon
- Bipolar transistor S8550AliExpress Amazon
- Buzzer TMB12A05AliExpress Amazon
- Jumper wires × 5AliExpress Amazon
- BreadboardAliExpress Amazon
The AliExpress links are affiliate links: if you buy through them ohmio.dev gets a commission, at no extra cost to you. Affiliate links
This page is a guide: the numbers come from a simulation, and real parts vary. Check your parts before you power the circuit. Safety and responsibility
How does a rain sensor sound an alarm?
The MH-RD board has a comb of copper tracks. When it is dry no current crosses between the tracks, and a drop that bridges them lets a little through. In the model a wet comb makes AO fall from 4.99 V to 1.67 V, under the trimmer's reference, so the comparator pulls DO from 5.00 V down to 0.41 V and the board's LED lights. Since DO goes low when it rains, a PNP S8550 is used: its emitter is on 5 V and its base goes through R1 (1 kΩ) to DO. With DO low, 3.8 mA leaves the base, the transistor saturates and 29.8 mA flows through the active buzzer, with 4.97 V across it. Dry, the buzzer has almost no current. A few small drops may not be enough: turn the trimmer to raise its reference voltage and make it more sensitive. Power the board only while you need it, because the current slowly eats the comb.
Values from the Protoboard ISO simulation: a model, not a bench measurement.
Hear about the next circuit
One email when a new circuit is out, about twice a month. Nothing else.