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.



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.

I am kicking around an idea for a cell phone based water sample spectrometer

It would be used for testing the water in my aquaponics system. I am not sure that the stuff I want to test is even detectable with the hardware I am going to use, but working out the mechanics is what’s challenging for me at the moment. The genisis for this idea is at

The process is to use the LED flash of a smartphone camera, a bit of a CDr or DVDr as a diffraction gradient, the camera, and the processing power on the phone. You measure distilled water, and then the sample and compare the two to see the differences.

The drawings are a quick render of the OpenScad file. The half-circle is a pivot that will hold the diffraction gradient so I can play with angles. I also need to add a spot for the test tube somewhere along the thin light slot.

The whole thing will be parametric, and customizable to any given smart phone.

Well, this is the plan. I am going to sleep on it a night, see what I dream up on it, and maybe send it to my printer tomorrow.

In album




3d printer ideas for custom aquaponics fittings

I am seriously excited about getting my 3d printer. It’s been a week since I ordered it, so 1-2 more weeks according to the confirmation email I got.

The printer can print in ABS. This can be a stinky plastic to print, but I’ve plans for making a fume hood for the printer that vents outside through the basement window. ABS is considered a food safe plastic, which means it should be safe to use in my aquariums.

I could do things like print out custom aquarium decorations, which I am likely to do. However, I am really excited about the prospects of printing out custom aquaponics fittings.

There are a couple of ‘fiddly bits’ in aquaponics, such as the bell siphon. When they work, they work great, but they can be a serious PITA to get that stage. There are people who have done a lot of original research on how to make the siphons start and stop easier such as Affnan. However, he has access to parts I can’t get locally. Now I will be able to print them out for myself!

Another item I would be able to print would be a tipper. It’s best explained in the video here.

I can print out a tipper that is shaped exactly to the space that is needed to fit into the grow bed. If I need a long, narrow unit, I can print that, a short squat one, I can do that too.

I can print out meshed safety cages to keep baby fishes out of the siphons at will. No more needing to attack PVC with a drill to poor effect!

I am terribly excited about all of this..

Aquaponics Store Idea

I’ve been looking at all the empty storefronts on main street Dundee on my way to work lately. I’ve been imagining having my own store front in one of those.

I’d sell Aquaponics stuff.

Ready made sets from tiny little things for apartment kitchens to fairly large backyard setups. I’d sell all the various parts, plumbing, bulkhead seals, containers, lights, whatnot. I’d carry some fish –  a few hardy ornimentals and some the pets stores don’t stock well locally and also the ‘eater’ fish such as tilapia, perch, etc. I’d also have a bunch of plants and seeds. Ones that grow well in AP systems that will give people the instant gratification of pretty plants now, and the economy of starting from seed.

I think a big thing I’d sell is pre-cycled media. One of the hardest parts of getting aquaponics up and running is getting the system ‘cycled’ – have the beneficial bacteria colonies all grown and doing their thing.

If people bought a ready to run kit from me, they’d get the booklet I’m writing, the tank(s), grow beds, cycled media, a few live plants, a dose of organic fertilizer to feed the cycled media, and a coupon for the balance of their plants and fish. The coupon effective date will be based on the system size so that the system will be correctly cycled when they go to add fish.

You see, I’d be setting people up for success, not to sell crap they don’t need (like 3-4 sets of fish). The only time I want to see them again is to redeem their fish/plant coupons, to get more parts for more systems (it’s addicting!) and when they bring their friends in to get their friends hooked on the hobby.


I’d make Aquaponics stuff.

I’d sell sets and kits that I’ve assembled. I’d make a bunch of the various bits and bobs that are needed, like the tank top stands to hold the grow beds, bell siphons, etc.. I’d give the plans away for free.

I’d have a 3d printer so I can make custom clips, fittings, and so forth.

I’d have a small ‘workshop’ with a few basic tools such as a PVC pipe cutter, reamers, drill press with bits, etc. so people who don’t have some of these specialty tools can use them at the store to make things they way they need them.


I’ve a few ideas on how I want to lay out the store.

The weirdest part will that I will have irregular hours. I’d have a rolling 4 day schedule where I stayed open late one night a week, and by late, I mean 10-12pm or something like that. By rolling the 4 day late nights over a 5 day week, I would be open late at least once a given named day per month. A HDTV with a calendar, answering machine auto-attendant, and website would show the hours.

I’d have a few interactive displays where people can get their hands wet. Bell siphons are one of those things that are really hard to understand in their simplicity. There would be a  set up where you can try different sizes of bell siphons with different amounts of water flow.

The fish would have a full data sheet printed out in large print for each species including details on picking fish in good health. With life sized photos. Attached to the tank that the fish are actually in. There would be a date as to when the last shipment came in.

I’d have half a dozen TVs hooked up to computers with proximity sensors that would turn on when you stood in front of a display with lots of options. It would explain your choices to you, and things to consider for your purchase. Maybe I would have a kinect and make the displays interactive so somebody could get to the details they are interested in.

  • Explain lighting options – HID, florescent, LED, incandescent
  • Explain the biological processes going on
  • Explain water parameters and how things like PH affect plant nutrient uptake
  • Explain how some plants may work well in some systems and not others
  • Explore the different options for grow beds
  • Explore the different options for siphons

I’d have bins of plumbing fittings and small sections of pipe. I’d sell pipe by the inch. A lot of stuff needs short pieces of pipe, and it’s really annoying to put a 10′ section of pipe into a compact car when you only needed a few 6″ pieces.

There would be QRcodes EVERYWHERE. They would also link to real information! Screw the marketing BS that the vendors give me, I’m writing my own datasheets, instructions, pros & cons, etc. People can come in and self help while in the store if they want, or they can get assistance, and the store employee can show them the details on the tablet they are carrying around.


I’d hire a few part time people.

Each employee is in charge of 1 running display in the store. They also are given a small kit to take home as a hiring bonus and are expected to run it while they are employed. They get annual bonuses in stuff and samples and new products are seeded out to them. It’s important that they know their stuff, and how else to do that then with experience.

I am thinking a couple of little old ladies and some codgers who know the local gardening. I’d let them pick their schedules, and hire in to fill in any gaps. The stuff these people know is invaluable. I want access to it!

I’d hire some high-schoolers.  The local schools FFA chapter would be a good place to start, maybe 4H too. The energy that they bring is great. They pick up on new stuff very fast. That and somebody needs to get the stuff off the top shelf so old-man-rivers doesn’t break a hip.

I won’t be open on the weekend unless the employees wanted the hours. 2 employees can schedule the hours they want to be open on the weekends.


I’d sell stuff online.

I am a web-geek. I will sell stuff online. I think the cool thing I would offer though would be in-store pickup, even after hours. I’d have a set of PO boxes with codeable punch-code locks. I can place an order into a box and ‘ship’ the box number and access code. The person can come anytime and pick up the order, even if the store is closed.

I like catalogs that actually have information in them and not just a list of product numbers and pricing. The website wouldn’t be a list of products, it would be a treasure trove of information, tutorials, options, comparison lists that all allow you to buy the things being talked about.

The site would be based on ‘here’s the things you need and here’s how to do it. You can get the stuff locally or buy it from me online.



I’d work with the local schools to have an Aquaponics system in any classroom that wanted one. I’d work with the teachers & students on learning science and have them write ‘grant requests’, make/donate the parts that they need that they can’t otherwise source, and feature the results in the store. I’d totally love to see turtleponics!

I’d work with the local pet stores and plant nurseries to see if I can offer my customers coupons for their locations for stuff that I don’t carry.  The back of the couple would list a bunch of things that would work well in Aquaponics context, and the coupon is good for those items. Maybe I could get a display at their location and sell Ready-to-Run systems at their locations.

I’d be at the local ‘green’ expo and farmers markets.



I’d want a location where I could have a greenhouse. Lots of big greenhouses would be great, because then I would sell plants and produce, but even a small greenhouse or two would be great. I would show that you can grow in the winter here in Chicagoland.



This is all a pipe dream at the moment.

I can’t transition from what I am doing today into a store – I’d loose the house in the time it took to get the store pulling in foot traffic.