Alright, let me tell you about this “rain stoppage” thing I messed around with today. It was kinda fun, kinda frustrating, but hey, that’s how you learn, right?

So, it all started with me wanting to do something different. I was staring out the window, watching the rain, and thought, “What if I could, like, detect when it stops raining?” Sounds simple, right? Wrong!
First thing I did was Google around. I figured someone, somewhere, must have tried something similar. I stumbled across a bunch of weather API stuff, but that wasn’t what I wanted. I wanted to, ya know, sense the rain stopping, not just read about it. Plus those APIs usually have limits. So, I scratched that idea.
Then I thought, “Okay, what sensors do I have lying around?” I remembered this old soil moisture sensor I bought for a plant project that never happened. Figured, “Hey, rain is water, soil is soil… maybe?” It was a long shot, but worth a try.
I grabbed the sensor and hooked it up to my Arduino. I wrote a quick little script to just read the sensor value and print it to the serial monitor. Took maybe 10 minutes. Easy peasy.
Next, I stuck the sensor outside in the rain. The value went up, which was what I expected. It was getting wet! I let it sit there for a while, watching the serial monitor. The value stayed pretty high as long as it was raining. Cool, so far so good.

The tricky part was figuring out when the rain stopped. I couldn’t just look for the value to go to zero, because the sensor was still wet. It would take time to dry. I needed some kind of threshold, something that said, “Okay, the value is dropping fast enough that we can say it’s probably stopped raining.”
This is where I started experimenting. I had the Arduino take readings every few seconds. Then, I compared the current reading to the previous reading. If the difference was big enough, I figured it was stopping. I messed with different thresholds for, like, an hour. It was a lot of trial and error, mostly watching the rain and adjusting the numbers.
Here’s the basic code I ended up with (it’s not perfect, but it worked-ish):
- Read the sensor value.
- Compare it to the last sensor value.
- If the difference is greater than a set threshold, say “Rain Stopped!”.
- Update the “last sensor value” with the current sensor value.
- Wait a few seconds and repeat.
The biggest problem was the sensor drying unevenly. Sometimes a gust of wind would dry it out faster, and I’d get a false “Rain Stopped!” message. Other times, it would stay wet for ages, even after the rain had clearly stopped.
What I learned:
- Soil moisture sensors are NOT rain detectors. Duh.
- Thresholds are tricky.
- Real weather detection is more complicated than I thought.
Would I do it again? Probably not with a soil moisture sensor. But it was a fun way to spend an afternoon, and I learned a bit about how sensors work (and how they don’t work!). Maybe next time I’ll try something fancier, like a little rain gauge with a tipping bucket.
So, yeah, that’s the story of my “rain stoppage” experiment. It was a bit of a bust, but hey, that’s how you learn, right? Plus, I now know way more about soil moisture sensors than I ever wanted to.