Sump pump alarm

Sump pump alarm - beauty shot


My house is over 180 years old and is built into a hill. Consequently, drainage is a perpetual issue. One seals the stone foundation as well as one can, and French drains are de rigeur, but when it’s been raining steadily for days, the first line of defense is a reliable sump pump.

A quick description for those lucky enough to have never encountered a sump pump: you dig a hole in your basement where the water collects, line it with cement, and call it a ‘sump.’ You affix a pump in it, attached to a pipe or hose that leads out to the sidewalk, storm drain, neighbor’s basement, or other convenient dumping ground. The pump has a float attached to it, which connects to a simple sliding switch, causing the pump to turn on when the sump is full and turn off when it’s empty.

In theory, this allows you to sleep soundly during a rainstorm, knowing that your trusty sump pump is keeping your basement, and its contents, such as a modern furnace containing fragile electronics, dry.

In practice, Murphy presides. Apart from major failures, such as a city-wide power loss or the pump motor overheating and burning up, and the subtler ones, such as the water getting bored and flowing somewhere other than into your sump, one simple yet effective failure mode is for the ground-fault interrupt to trip.

On the off chance that you’ve read this far and don’t know what a ground-fault interrupt (GFI) is, it’s a protective device often built into electrical outlets located in damp areas, like bathrooms and basements. It’s like a circuit breaker, except that instead of cutting power when too much current is pulled, it cuts power when it detects “leakage current,” which might mean that an electric device has gotten wet. See Wikipedia for a nice explanation, which will also tell you that calling it a GFI is wrong, even though that is what everyone calls it.

In our case, the GFI does in fact trip every now and then. You’d expect it to be particularly likely to trip when the basement air is particularly wet, like, I don’t know, when it’s raining and water’s flowing steadily into the sump. And you would be right.

It’s a good thing that the GFI trips, of course; better that than having the pump get damaged, or a fire in the wiring. But, it does mean that if we’re not there to reset it, the sump stays silent and the water builds up.

The life companion knows I worry about this, and she had recently replaced the old sump pump with a new submersible one, which is supposed to be better because it’s effectively water-cooled. But the GFI had tripped a couple of times, and we hadn’t noticed it for… well, we don’t even know how long. And there was water. And so I worry. And so one evening she said “You know what you should make? An alarm that will tell us if the ground-fault trips on the sump pump.”


Well, I leapt into action. I mean, really leapt, for me - it was just nine days from design to installation.

It’s a simple concept: detect when the power is cut to an outlet (i.e., the one the pump’s plugged into), and sound an audible alarm. A few extra wrinkles because I think too much:

  • The alarm should be audible two floors up, so I can hear it from bed. The new pump is too quiet to hear from there, so I get no reassurance as I’m listening to the rain and trying to fall asleep…
  • The alarm should be distinctive. Is it a battery dying in a smoke alarm in the basement, or on the third floor? Is it the microwave saying my tea’s reheated? I don’t want to have to guess.
  • It’ll require a battery, and that’s OK, but I don’t want to have to change it more than once a year.
  • In case we’re away or otherwise miss hearing the alarm, it should be able to sound for at least a few days on a fresh battery.

All quite feasible.


Power-loss detection is done by a normally-closed relay, pulled open by the AC power. When power is lost, the relay closes, connecting a battery to a simple piezoelectric buzzer.

In order to extend battery life, the buzzer sounds periodically, not continuously. And in order to provide a distinctive sound, it plays a sequence of “notes” and “rests” (all at the same pitch, since stock buzzers with built-in drivers basically sound at just one frequency). So, a small microprocessor runs a program that controls the buzzer’s timing.

Additionally, it’s convenient to add a “snooze” button, that puts the alarm to sleep until the relay cycles again. This makes it easier to install and more pleasant to troubleshoot a power problem when the alarm is in place, as otherwise the alarm will sound repeatedly after the battery is connected. An alarm loud enough to be heard two floors away is rather painful to listen to when you’re standing next to it.


This is clearly not the world’s most sophisticated electronic device. The following circuit is sufficient:


A Zener diode limits the voltage applied to the microprocessor (IC1) from the 9V battery, and the microprocessor controls an NPN transistor to route current to the buzzer. The Sleep button is conencted directly to a microprocessor pin and ground, using the processor’s internal weak pull-up. My calculations indicate that it might be able to sound for 2-3 weeks, so we should at least get a few days out of it. And the battery is disconnected when it’s not sleeping or alarming, so I’m guessing it should last around its shelf life.

The C source is pretty standard PIC code. The alarm sequence I chose sounds like “Long, long, short short short,” which is approximately the rhythm of the phrase “ground fault interrupt.” PIC enthusiasts are welcome to the HEX file.

You can also peruse my self-indulgently complete construction photos, including an action shot.

A satisfying project.

SumpAlarm.c3.43 KB
SumpAlarm.hex984 bytes
sumpalarm-sound.mp352.59 KB