The Internet of Things is here . . .

. . . 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 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:

  1. sensors that measure water level,
  2. microcontrollers (with WiFi access!) that monitor these sensors,
  3. websites that accept and process data from these microcontrollers,
  4. 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!!!

Implementation was a lot easier to do than I expected and the cost  was lower than I expected, thanks to ebay, banggood and aliexpress. Delivery times can be very long.

I am considering productizing/commercializing my system with perhaps additional capabilities:

  1. Battery backup (although the router must then have battery backup as well),
  2. A ‘heartbeat’ mechanism so that a text message is sent if the microcontroller stops sending data to the ThingSpeak channel.
  3. 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).



7 thoughts on “The Internet of Things is here . . .”

  1. Internet + time = “How did I ever hold down a full time job?”

    You are on to something here. The other sensors you mention at the end (electrical failure and falling temps – likely arising from an electrical failure) will have proven useful prior to arriving at the scene of an imminent flood beckoned by your battery backed up sensor and wifi only to find that your sump is of no use sans power. You’ll have to go old school here I’m afraid: generator.

    I have not mastered the configuration of my new wifi based freeze alarm for Vermont – or at least I have not been able to trigger a promised test message/email. Compensation for help in that dept. would be free food and accommodation.

    Nice graphics btw!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s