• You've been granted Beta access to this site, allowing you to explore some of the new features while they're still under construction. More information can be found in the Beta forum.

IOT to monitor sump pump water level

BobS0327

Active Member
I have a sump pump installed in a home that operates intermittently throughout the day.  That is, it runs for about 45 seconds every 30 minutes each and every day.  This type operation usually causes a basic sump pump to burn out in about two years.  When it does burn out, the water level starts rising to the point where could possibly cause damage to a furnace if the sump pump failure is not detected in time.
 
So, now I want to build an IOT device that will detect a  high water situation indicating that the sump pump has failed.  The IOT device will then send me a text message indicating that immediate attention to the problem is needed.
 
I thought I would post this project to get other viewpoints.  The only requirement is that I use a Raspberry Pi solution since I am building a RPI HA system with redundant RPI's etc. and I have a lot of experience with the RPI's.
 
My initial solution would be to use a RPI zero W (WiFi capable) and attach a water sensor to the Pi zero http://kookye.com/2016/08/01/water-level-sensor/ I was thinking about using the MQTT M2M lightweight protocol for communications from the zero with water sensor to the HA RPI hub which in turn would send a text message to me indicating a potential issue.  I am leaning towards the MQTT protocol since it appears to be the most popular defacto standard for IOT but I'm open to other options.
 
I appreciate any input offered.
 

pete_c

Guru
Been tinkering here with original RPi's and RPi2's.
 
- a few years ago with original RPi had issues with the first used SD cards getting trashed after about 6 months of RWs.  I used only one type of SD card at the time - SanDisk
 
- Next generation of RPi2 went to the first fast microSD card from Samsung (EVO).  No issues with RW errors.  Only issue I had was that two cards locked themselves such that I could not update or write to the SD card.  It would appear to work fine and on reboot I was were I started before writing to the cards. 
 
Today one original RPi is running Wheezy with a new SanDisk card for my Lightning sensor board and doing well
 
Another RPi2 is running Wheezy with a new SanDisk card.  Originally testing it in the Attic here via a POE connection with temperatures going to 140 ° F.  This RPi2 originally ran Jessie Lite (Debian 8) which seemed less lite than old Wheezy (Debian 7). 
It has three hardware pieces.  Z-Wave GPIO, PiFace RTC and 9097 1-wire device.  It does Z-Wave and uses ser2net.  OWFS and Digitemp and as of yesterday doing 1-Wire xAP. 
 
It is also running MQTT.  Apache2 and Domoticz.  Mostly in learning mode relating to MQTT.  Set back here was using a Samsung EVO card which locked the write pieces to it such that I copied over much to a new microSD card.
 
Switched over to using the Pine64 2Gb RPi like device.  It is larger and has 2Gb of RAM and runs 64bit Linux.  Same pins as an RPi. 
It is running Homeseer lite in 64bit mode and doing well.
 
Stretch (Debian 9) is out and works in 32bit and 64bit mode with just about any CPU
 
I had an issue similar to yours with my sump pump.  It ran mostly 24/7 until it failed twice on me.  Concurrently had noticed that while the sump pump was pumping out fine it appeared to be recycling the water which went down to the drainage tiles.  Created a large French well which didn't work over time.
 
I rerouted the water some 300 feet to a low part of the property near a storm sewer and that took care of the pump running 24/7.  It took a week of digging which I did not do myself ($1000 or so). Only monitoring was using a powered water flood sensor connected to the OmniPro 2 panel.  Since reroute of sump water lines I do not and have not heard sump pump turning on much and no failures now in over 10 years.
 

BobS0327

Active Member
Yea, I've noted a few issues being discussed on a couple forums with extensive RW's to the SD card on RPI's. I personally have not experienced these issues probably because I have minimized my SD card RW's.  The SD card  only stores static configuration files which are rarely updated. Any voluminous dynamic data such as statistical analysis data  is stored on either a NAS or out in the cloud.  For example, data  collected from my irrigation system (moisture level, temp, humidity etc.) is stored out in the cloud.
 
I've just started learning about MQTT.  So, it'll be a while before I actually implement it with this project.
 
The house I own is an older house, about 90 years old which has a creek running parallel to it.  The creek is about 5 feet away from the foundation. So, creek water seeps thru the foundation into the basement which in turn causes the sump pump to cycle on every so often to pump the water back out to the creek.  I don't believe there would be any inexpensive solution to this water problem.
 

znelbok

Active Member
<p>ESP8266 with MQTT</p>
<p>&nbsp;</p>
<p>Cheap as chips and while not a RPi it can still communicate to the Pi MQTT broker.&nbsp; Uses the Arduino IDE for configuration.</p>
<p>&nbsp;</p>
<p>Other option is OpenPLC.&nbsp; The RPi is a PLC (with ladder or structured text).&nbsp; An ESP8266 can be a wifi remote I/O or you can just use the IO on the RPi.&nbsp; Has a modbus interface but I believe that Modbus is available in node red and hence you can publish to MQTT (from memory).&nbsp; HTat being said, if you can handle the Modbus protocol directly in the HA software then you wont need node red or MQTT.</p>
 

cobra

Active Member
What do you presently do in case of power outages?
 
Any reason you don't want to use one of the commercial water sensors and make it a zone input to the OmniPro?
 
I ask, because I have a couple sump pumps that run in active sumps.  After my first dozen years of replacing pumps every 1-2 years at one house, I found that the pumps didn't burn out, rather the picked up small stones and jammed.  Wrapping the sump in waterproof window screen has kept that one alive for about 3 years now.  (I also use a pair of water sensors on that pump.  One lower and one higher so I can tell when/if it fails and how badly.  I get texts from the alarm system for zone warnings on those.)
 
In our newer house, I just added a backup water powered pump higher up in the sump pit.  That way it covers primary pump failure and power failure in one go.  I have a water sensor to install in between the pumps, but I've been too busy to get to it.
 

pete_c

Guru
Here utilize the GRI water sensors connected to the OmniPro panel and did an a la carte back up 12VDC pump.  All of this after I rerouted the water outside such that it rarely ever runs these days. 
 

BobS0327

Active Member
What do you presently do in case of power outages?
There is currently absolutely nothing in place to handle any type of power outage.  It's a secondary home that I will eventually upgrade with a Generac whole house automatic standby generator.   A UPS system will be in place to handle the latency between power loss and the backup generator kicking in.
 
Any reason you don't want to use one of the commercial water sensors and make it a zone input to the OmniPro?
I don't have an OmniPro installed in this secondary house.  The best price I could find for just the OP2 board alone is $956.00.  The price for a complete OP2 system is just way too high for older technology. Also, my personal experience with the lack of OP2 support from Leviton really discourages me from purchasing another OP2. Home security will be handled by a more cost effective controller. Possibly a Ademco/Honeywell controller which can be interfaced to a RPI. HA will be handled by a bank of hot swappable RPI's.  
 
My main home has a sump pump but has never been used in twenty years since the home is high and dry on a hill.  Thus, no need for a sensor at the sump pump.
 

pete_c

Guru
Personally (seen this before) I would make infrastructure changes outside or inside.
 
One peer with similar issues moved his home redoing the foundation in the vacation home in the woods.  Or move the creek.
 
Another nearby neighbor installed 4 sump pump wells in his basement.  (which to me was a lot).  Looks like the drain tiles piece of his infrastructure got skipped?
 
I mentioned earlier redoing drainage.  I also planted trees on elevated berms and redid top soil to move the water (during a rain storm) away from the house.  Baby steps here initially planting trees then over time installing the berms on a high part of the property redirecting the flow of rain water along the berm line and not to the back yard where it would turn in to a lake.  (all due to mickey mouse subdivision planning)
 

cobra

Active Member
BobS0327 said:
There is currently absolutely nothing in place to handle any type of power outage.  It's a secondary home that I will eventually upgrade with a Generac whole house automatic standby generator.   A UPS system will be in place to handle the latency between power loss and the backup generator kicking in.
 
I wouldn't worry about UPS for sump pumps...  Just my thinking.  Most sump pumps draw a lot more power than a general UPS can provide.
 
I don't have an OmniPro installed in this secondary house.  The best price I could find for just the OP2 board alone is $956.00.  The price for a complete OP2 system is just way too high for older technology. Also, my personal experience with the lack of OP2 support from Leviton really discourages me from purchasing another OP2. Home security will be handled by a more cost effective controller. Possibly a Ademco/Honeywell controller which can be interfaced to a RPI. HA will be handled by a bank of hot swappable RPI's.  
 
My main home has a sump pump but has never been used in twenty years since the home is high and dry on a hill.  Thus, no need for a sensor at the sump pump.
Yeah, you hadn't mentioned what system was in this house. Any alarm system can monitor a water sensor if it supports simple zone sensors. The example I gave we had a Visonic PowerSeries with the cellular communicator option. It still had the best reporting I've found for simple zone troubles. Sends text straight from the SIM card number to numbers you specify.
 

linuxha

Active Member
I have a mix of things talking to MQTT (and I have TSL to a Cloud MQTT also). I like MQTT, understanding the retain option is important. But remember that MQTT is nothing more than a message router, a broker. Processing must be handled by other things.
 
I have various Linux servers, ESP8266's and a couple of Fubarinos (Arduino with a PIC32) with W5500 Ethernet modules all running MQTT.
 
I'm also running a lot more node-red and various shell scripts to manage and manipulate data and devices.
 
PS: I live on a swamp, no basements here.
 

BobS0327

Active Member
cobra said:
 
I wouldn't worry about UPS for sump pumps...  Just my thinking.  Most sump pumps draw a lot more power than a general UPS can provide.
 
My bad.  I should have been more specific in my previous post.  The UPS system would be used to provide continuous power to the RPI's until the generator kicks in to avoid any potential issues such as trashing the RPI OS. I won't be using a UPS for the sump pump since the backup generator would be sufficient to keep the pump running.  A approximate 6 second delay from the moment utility power goes out until the generator takes over wouldn't be of any concern as far as the sump pump is concerned.
 

BobS0327

Active Member
linuxha said:
I have a mix of things talking to MQTT (and I have TSL to a Cloud MQTT also). I like MQTT, understanding the retain option is important. But remember that MQTT is nothing more than a message router, a broker. Processing must be handled by other things.
 
I have various Linux servers, ESP8266's and a couple of Fubarinos (Arduino with a PIC32) with W5500 Ethernet modules all running MQTT.
 
I'm also running a lot more node-red and various shell scripts to manage and manipulate data and devices.
 
PS: I live on a swamp, no basements here.
I think using Mosquitto,ThingStudio and Node-red is a very interesting combination for implementing MQTT.  It appears that Mosquitto is the broker of choice for most folks.  ThingStudio would be the user interface with application and  Node-red would be used to wire it all together. 
 

JimS

Active Member
What happens when you aren't able to get there before the flooding starts or something goes wrong with sending you a signal?  Seems like a good first step would be a secondary pump positioned slightly above the first, possibly running from a battery or other alternate power source.
 

BobS0327

Active Member
JimS said:
What happens when you aren't able to get there before the flooding starts or something goes wrong with sending you a signal?  Seems like a good first step would be a secondary pump positioned slightly above the first, possibly running from a battery or other alternate power source.
The use of two sump pumps just never crossed my mind.  That is a good idea. I'll use the IOT device to monitor the primary sump pump and use the back up sump pump as "insurance".  Thanx.
 
Top