Sump Pump, Aquaponics & Aquarium water level monitoring

I seem to like flooding my basement… Usually by overfilling one of my aquariums, or intentionally putting 55 gallons of water in a 45 gallon aquarium. Sometimes, I overfill the swimming pool in the back yard.

So I decided to put together a monitoring system. It will monitor my sump pump, letting me know when it is getting used hard so I know to pay it more attention. It will monitor my Aquaponics grow bed, telling me when my flood and drain / ebb & flow grow bed isn’t functioning correctly. It will also monitor my fish tank water levels and let me know when the water is getting low, or more importantly when I am filling it and it gets to where it ought to be.

This is put together with Raspberry Pis. An older original B model for the fish tank because I have it and it’s close enough to Ethernet that I can run a wire to it. The Sump Pump is getting a Zero W as it is further away, and I needed to buy something and it was the cheapest option ($10).

I am measuring water height by 2 methods. An ultrasonic distance meter and a differential pressure setup.

I coded up the project a couple of different ways, learning as I went along. I ended up starting with the hardest methods first, and moving towards easier methods. Starting at OS level triggering of shell scripts, moving through python programming, and finally landed on Node Red. I am happy for the path I took as I now have a solid understanding of what a Raspberry Pi can do for me and how to control it at multiple levels. Node Red is how I will be building most of my projects going forward as it’s easier for the kids to understand.

Node Red

Node Red is a graphical programming environment that you use with a web browser. This means a quick tweak can be made from your cell phone! Not the best experience, a cell phone, but doable.

The core concept  of Node Red, is you drag ‘nodes’ or blocks onto your screen and set them up with the particular details that node needs. Configuration settings such as the specific pins on the raspberry pi you have a sensor plugged into, a login for an online service, etc.

You then connect the different ‘nodes’ together with lines, and the whole thing just starts working. Amazing, really.

You program a computer using the same methods you would use to explain a process to another person. Draw a bunch of boxes saying this box does this thing, and connect the various boxes together with lines showing how different events are chained together.

When you use the Node Red menu in the Raspberry Pi, it opens up a text window, with a bunch of stuff on the screen. In amongst that text, is instructions on how to set Node Red up to turn itself on automatically when the Pi starts. Now you have automatic monitoring even if the power goes out and comes back on.

Direct reading of water level via sonar

Ultrasonic distance meters turn to out to measure the distance to a water surface fairly well. The water needs to be reasonably flat & calm for it to work reliably.  The thing basically beeps at a high enough frequency that we can’t hear it, and listens to see how long until it hears it’s echo back. A little bit of math, which computers happen to be good at, and you have a distance measurement!

I picked up a bunch of HC-SR04 sensors for cheap from eBay.  You can get them from reputable sources for around $5 each.

The HC-SR04 sensor tutorial I followed when writing code is found at

If you want to learn about all of this, it is good to work through the tutorial. I ended up dropping the tutorial method and used Node Red.

HC-SR04 Node Red sensor, calibration, and logging flow.

Node Red needs an add-on node to ‘talk’ to the sensor. The one I found is . Install it according to the instructions, restart Node Red (or the Raspberry Pi if you haven’t figured out how to restart Node Red) and reload your browser window for it, and you can now start taking distance measurements.

Differential Pressure water level method

Have you ever noticed that if you hold your finger over the end of a straw, stick it in your glass, the water goes up the straw only a little bit? When you do that, you are increasing the air pressure inside the straw.

If you compare that air pressure inside the straw, to the air pressure outside the straw, you are working with differential pressure.  We can use this to simply see the cycle of water rising and falling, or calculate the actual height of the water inside the pipe. I don’t know what physics principle to use to do the math for calculating actual water height.

I used a BMP280 temperature and pressure sensor. The adafruit library didn’t work well for me. I did however find which worked well.

The Node Red library has a bug in it at the moment. When you try to use it with the BMP280 module, it crashes Node Red. If you see this happen, the fix is simple, you need to call in the bigNumbers.js library in the right spot.  Once you do this, things work correctly.

The BMP280 had some issues with longish wires. I ended up using some Cat5 with the tip from for how to pick the wires to get the best performance. This worked well, if a bit time consuming to pigtail the doubled up wires so I only had 1 wire to solder onto the printed circuit boards.

Seeing the data

I logged the data to using MQTT. The library I used is found at for coding things the hard way. Node Red has a built in MQTT node as well.

I used Adafruit’s IO tool because it’s cheap (free) and easy, and is great for learning how to do all of this. There are other options available from Amazon,  Azure, Google, IBM, and many many more. Adafruit’s tool is great to start out with.

Sensor readings in a Bell Auto Siphon Fail to Break mode
Sensor readings in a Bell Auto Siphon Fail to Break mode. The ‘gap’ in the middle of the chart is from the auto-siphon failing to break siphon. We see it in both the upper graph measuring the actual water height plus the lower graph measuring the pressure elevation in the stand pipe.



The RepRap revolution started 6 years ago, today.

6 years ago, today is when the first ‘child’ printer was created.

6 years ago, today, the RepRap revolution started.

RepRaps, or Reproducing Rapid Prototypers are 3d printers that are designed in such a way that you can use one to make a copy of itself. The goal is to be able to use ‘stuff’ that is easily available locally. Today, I could make one using parts bought from Radio Shack, Home Depot, Walmart, and junk inkjet printers sitting in people’s closets, and my existing 3d printer. It’s easier and cheaper to order parts of ebay, but I can cobble one together after a couple hour bike ride.

The hardware is open source –  that means I can download, view, edit, and distribute my changes to the machine for free & legally.

The software is open source – that means I can download, view, edit, and distribute my changes to the software for free & legally.

There are thousands of people who are actively making tweaks and adjustments to the printers & software every single day. Thousands of people who are making these 3d printers better, every day, just for the fun of it.

6 years ago today, the first RepRap begat the 2nd RepRap and the world changed forever.

My college, MSOE, had the largest Rapid Prototyping lab in the world at that time if memory serves correctly. They had millions of dollars in equipment. I remember walking past the glassed windowed RPC and looking at the cool stuff they where making there. Engines for GM, hands for NASA to fit gloves, skulls to solve murder mysteries.

2 years ago, I got my first RepRap for as much money as the TV in my living room – I ordered a kit of parts, and built it over the course of 2 days with help from strangers who where also putting their printers together at the same time.

6 years ago today, RepRaps started a revolution that made 3d printers accessible to me, in my home. My children will grow up never not knowing having having easy access to 3d printers. In their home. My dad remembers when he got indoor plumbing growing up, I remember when our house got it’s own phone number and not a shared number with several of the neighbors. My kids will never not remember a 3d printer or two in their house. This blows my mind. The paradigm shift in their thought processes is revolutionary –

I’ve come up with a few ideas of my own – hybrid drivelines, hooking up my printer to my fish tank, and a temp monitoring idea across the printer as a hole.

The people who have made the RepRap revolution possible deserve much gratitude. I’ve been able to meet in person many of the ‘key’ people who have made RepRaps possible – the (re)designers of the hardware, the (re)designers of the firmware, the (re)designers of the electronics.

Today, today is Mr. Bowyer’s day. Thank you. We will probably never meet in person, but you have changed my life & my children’s life. For that, Thank you.

I think I invented something

A laminar flow pipe reducer for a pump housing. At least, a little bit of Google searching hasn't shown me another.

I am trying to find a cheaper way to heat the 75 gallon aquaponics system in the basement. It's really running closer to 125 gallons of water with a LOT of surface area. This bleeds heat quite quickly, so the electric submersion heaters are expensive to run and I simply don't have enough to keep up with the cold basement sucking the heat out of my tanks.

So, I did something stupid. I rigged up a water line to the furnace and water heater flue. This involved running about 25 feet of 1/4 inch tubing because that's all I had on hand that would go the distance. There are issues with copper being toxic to fish, and cooling the flue, causing Carbon Monoxide to fill the house. So this is not something you want to do yourself.

I needed more water flow. A 3/4 inch pond pump forced down to 1/4 hose just doesn't work very well. Too much restriction to get good flow.

I had to make a water tipper to help my grow bed siphon start and stop. This just fills up with water slowly and then dumps the water at once into the bed. The small water pulse surge is often enough to trigger a slow siphon.

This is fine and dandy, but I have a 3d printer. So I spent some time with a Fluid Dynamics textbook and openscad and came up with an adapter for running multiple hoses out of my pump – 

I think it's a first. I haven't found anybody else who made a laminar flow reducer for a pond pump. This thing induces laminar water flow through a series of small honeycomb shaped features inside the adapter.

It was very challenging for me to make, as my math skills aren't up to par. I kinda had to trial and error it instead of solving the problem with math.

In the end, it's designed to be printed, with a center support column running up the center to make the upper section easy to print.

The best part is that the goofy thing works!. I get the same water flow out of the heater line as before PLUS I get 2 additional water lines that are providing a significant additional water flow. I'd expect it to work poorly do to all the plastic that's in the water flow, but it seems to be efficient enough to overcome all the extra gunk in the way.

In album

Seriously stupid going on. Aquarium water heater off the furnace flue.

Water tipper mocked up with various bits to induce a water surge to trigger the bell siphon

Honeycomb feature inside the adapter to induce laminar flow.

3 different hoses come out of this one pump adapter.

I broke the first print in half to verify that it printed the way I wanted it to. (It’s my story, let me tell it the way I want to)

The pump running 3 separate hoses.

Tearing down a 75 gallon tank to clean up water

My Overflow box strikes again! This thing is the bane of my carpeting! This time, it caused a flood in a different way. The drain tubes fell out of the tank. They stayed put for over a month, then fell out twice within 6 hours. I don’t get it.

Trying to dry out under the tank. This didn’t work very well. I was told ‘the house stank’ so the tank has to move so the leak can be cleaned up properly.

This is the area where the tubes went. The hoses just slipped into the tank here between the filter and the side of the light hood. The tubes where long enough, it just seemed to work well.

My solution is to simple – put a long deck screw in so I can affix the tubes to the screw so they won’t fall out anymore.

The water left in the tank got put into 2 large totes and a 5 gallon bucket. The Oscars are in one of the tubs. Brother is checking out the fish here.

The tank is sitting on some saw horses so it’s out of the way. I moved the base aside just to get it out of the way. The tank can set on the saw horses just fine while the carpet dries.

The room gets a little bare with the tank missing.

The tank hopefully get all put back together tonight.