Instructables
loading
loading
Picture of Save your home with Arduino
IMG_0724.JPG
130719_0000.jpg
Just recently, there was a cold front that messed with power all over. There was a tornado watch in Canada, even. There were some really cool clouds, then some thunder, then a whole lot of lightning, thunder, and rain. Lots of rain and constant rumbling as the sky opened its stored water and charge. Just after a brown-out knocked out the TV and internet (it tripped a GFCI that I didn't see until the day after) I saw a leak in my basement.

It was no small dribble. It was a veritable deluge. (Click the video below to see the deluge.) That may be a bit of an exaggeration, but there was water coming into the house and unsteady power. I tried patching the leak with hydraulic cement, but it couldn't stop the flow because as the water stopped, it pooled up outside and built up pressure. (Instructable for basement repair pending?)

With a partially blocked flow running into the sump, I needed to know if the power died in the middle of the night because if the sump pump stopped, I'd need to empty it with buckets. The pipe into the sump was dumping a lot of water in addition to the leak. No fun, but better than flooding. Carefully directing the little river through the basement to the sump and jamming a bit more hydraulic cement in the crack, I went upstairs.

With the flow slowly breaking the patch I made, I quickly programmed an Arduino to beep when the power went out. It took like 10 minutes because I had to call my friend for the analogRead values. It's 0 to 1023 for voltages 0 to 5V. I know, I know, I could have found it in the examples, but I was without internet and I was desperate and not thinking clearly. I should probably get outside sometimes …

The Arduino never actually woke me in the middle of the night. The power stayed, but it was a lot of peace of mind.

And then the next day I found that the internet box where the fiber-optic comes in was plugged into a tripped GFCI. Oh, the embarrassment. I promptly got on the internet and made an instructable after checking my webcomics.

I didn't end up running wires down two flights of stairs to trigger an alarm when hypothetical flood water shorts some wires. I wanted to, but I just let the sump pump deal with it because it was late.

(I'm entering this in the Arduino contest because, wow, this was the most useful thing I did with it. Vote for me or whomever you think is cool. So me?)
(Too bad the battery-powered contest just ended. This would be pretty good for that, too.)
IMG_0722.MOV(402x714) 7 KB
 
Remove these adsRemove these ads by Signing Up

you would need a voltage regulator that outputs only 40ma, correct? Can you point me to the one you used? Thanks.

Abnormal Force (author)  mcollins455116 days ago

The current of the voltage regulator shouldn't matter. When you set the pin to input mode it gets switched to a high resistance inside the chip (I think it's like 1MOhm or something absurdly high, but don't quote me). Since current = voltage/resistance, the high resistance keeps the current low.

If you want to avoid frying the pin if it somehow gets set to ground, you can put a 220Ohm (or thereabouts) resistor between the regulator and the Arduino and the current will stay at 15mA.

http://www.adafruit.com/products/2165 or https://www.sparkfun.com/products/526 or pretty much any 3.3V regulator will do.

ahh. Thanks for explaining. Couldn't you also just use a 5v regulator since the pin accepts up to 5v? Thanks again.

Abnormal Force (author)  mcollins455115 days ago

I think I might have found 3.3V first in the big pile of electrical bits I have. 5V should also work.

rt11guru1 year ago
Besides having an alarm, you can also use it to test which outlets are on which circuit breaker. Plug it into an outlet, flip breakers until it yells and you've got your breaker matched to the outlet.
Abnormal Force (author)  rt11guru1 year ago
Ooh, I hadn't even thought of that. The speaker was pretty loud so you might hear it from across the house, too.