Facebooktwittergoogle_plusredditpinterestlinkedinmailFacebooktwittergoogle_plusredditpinterestlinkedinmail

I have a sump pump in my basement that doesn’t run very often. I wanted to be able to get a notification when it did run and a notification in the event of a water leak, which might indicate that the pump isn’t functioning properly. Detecting water was relatively simple, but trying to figure out when the pump runs was a little more challenging. I looked into a vibration sensor since the pipes would vibrate very lightly when it came one, but the sensor just wasn’t sensitive enough. I also considered measuring the amount of sound, but I thought that might cause some false positives when the kids were in the basement playing.

So I decided to use a Split Core Transformer to measure current. This works well for me because the sump pump would be the only thing on that circuit, and any increase in current flow would mean that the pump was running.

Here is a list of things you will need for this project (It may look like a lot, but much of it is very inexpensive):

Software Requirements:

The first thing is to wire up the electronics. When I got the SCT, I cut the 3.5mm connector off it, but later realized that I should have kept it on, and used a female 3.5mm connector. Polarity does matter for the SCT, so if it doesn’t give you a good reading one way, just swap the wires. Polarity doesn’t matter for the water sensor. In addition to the schematic, you can also refer to the gallery of my images for this project.

Sump Pump Schematic

I used this site along with this site to figure out the schematic for the SCT. I wish I could explain better exactly what it is doing, but unfortunately I don’t understand it well enough to do that. Feel free to comment if you can offer up any knowledge on how this works.  

You will want to put the SCT around a single wire on the circuit. I just opened up the outlet that the pump is plugged into, and clamped the SCT around the white wire, and closed it up. It fit well in the electrical box for me, but if you have an outlet further downstream, it may be a little cramped in there.

There are more pictures in the Gallery for this project showing the wiring and the SCT.

Once you have it wired up, you can load the code below onto it. This code includes the web based OTA firmware updater, Wifi Manager, and the RemoteDebug library from my previous post. It also makes use of the EmonLib library, which takes the data from the SCT and converts it into usable ‘energy’ data. In our case, we are just getting the current that was calculated by the SCT. One thing to keep in mind, is that the current measurement that it is outputting is not exact, and not really even close, but it jumps up enough for me to know that the sump pump is definitely on. With that said, I think it might be possible that the I could take the measurement, and multiply it by around 3 to get the exact measurement. I need to test it out using my Kill A Watt meter to determine that, and I will update this post if I ever get around to that.

Once the ESP/Wemos is loaded with the code, it will send an MQTT message anytime the state of water sensor changes or the current measurement is greater than 1 (It’s typically around 0, and shoots up to around 2.7 and stays there for a few minutes). It also sends an MQTT message regardless of any state changes.

Once you have done that, you can configure Home Assistant using the code below. Of course, you can feel free to use whatever you are used to in order to grab the data from your MQTT broker. You will need to edit the ‘service: notify.telegramBot’ lines to point to whichever notification service you are using.

What this does is send you a notification any time water is detected or the sump pump runs. It limits the notifications for the pump to just one a minute since the pump won’t run more often than that. It also limits the water notifications to once every 15 minutes. It will keep notifying you until water is no longer detected.

This was my toughest project with the Wemos so far so I’m hoping it’s able to help others. If you have any questions or any advice to offer feel free to post a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *