. . . and robust enough for the DIY community.
My sump overflowed in the spring of 2016. I had replaced the old pedestal sump pump and hadn’t adequately secured the new one. It slipped out of place and suddenly I had two inches of water in my basement.
Afterwards I thought about how to reduce the chance of that happening again. A common solution is a backup sump pump, but that is only a partial solution; the main pump could fail and suddenly the back-up pump is the main pump and the risk of the basement flooding has increased without the homeowner’s awareness.
A more complete solution would also include a mechanism to continually monitor the water level in the sump and to generate a notification to the homeowner if the water level exceeds a specified threshold. There are commercial products available that do this but most are part of an expensive integrated system. I figured that I could do it more cheaply.
Spoiler: I could! Check out https://thingspeak.com/channels/404493. The water-level in my sump is now continually monitored and I receive a text message if it rises to within 10 centimeters of the top of the sump. This real-time chart displays the ‘freeboard’ of the sump (i.e. how much the water level is below the level of the basement floor).
The technology that I used is part of the Internet of Things. All the necessary pieces are available:
- sensors that measure water level,
- microcontrollers (with WiFi access!) that monitor these sensors,
- websites that accept and process data from these microcontrollers,
- websites that generate a notification if a user-specified trigger occurs.
Following is an overview of my journey from my original state of Sump Status Ignorance (SSI) to Sump Status Awareness (SSA).
Step 1 – Choose the sensor: To measure the water-level in the sump, I chose to use the HC-SR04P which uses ultrasonic ranging to determine the distance between the sensor and the reflector (in this case the water in the sump).
Step 2 – Choose the microcontroller technology: There was really only one option with WiFi capabilities; a development board with the ESP8266 microchip. I selected the Wemos NodeMcu because it can be programmed with the Arduino Integrated Development Environment (IDE).
Step 3 – Choose the data processing website: There are many choices (IFTTT, Losant, ThingSpeak, easyIoT, undoubtedly others). Any of them could have met my needs; I chose ThingSpeak because its design philosophy mirrored my own; the code in the microcontroller was minimal and the control logic is at the data processing website.
Step 4 – Choose the notification method: I chose to be notified with a text message through Twilio. The Twilio framework was very straightforward but integrating it with ThingSpeak (so that a ThingSpeak trigger causes Twilio to send a text message) was the most difficult element of the project.
Following is a system diagram of the monitoring system.
Every sixty seconds, the microcontroller transmits an ultrasonic pulse, measures the echo delay, and then sends an estimate of the water level via WiFi to my ThingSpeak channel. ThingSpeak plots the data and compares it to a threshold which, if exceeded, results in ThingSpeak triggering Twilio to send me a text message. Sweet!!!
I am considering productizing/commercializing my system with perhaps additional capabilities:
- Battery backup (although the router must then have battery backup as well),
- A ‘heartbeat’ mechanism so that a text message is sent if the microcontroller stops sending data to the ThingSpeak channel.
- Additional capabilities to make it more useful, such as a sensor to monitor the household’s connection to the electrical grid and another sensor to monitor ambient indoor temperature.
Drop me a line if you are interested. I’ll be happy to either point you in the right direction or build one for you (compensation to be determined).