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.



Anybody else try the SOL Escape Bivy? I found one on clearance for $35 shipped and…

Anybody else try the SOL Escape Bivy? I found one on clearance for $35 shipped and thought I'd give it a try. $50 is too rich for my blood given the mixed reviews and stories how it's a tight fit. Only been wanting one for 2 years.

The features I liked in the ads are the unobtrusive green color, heat reflective construction, and waterproof while being breathable.

I ran it through it's paces as best as I can with the temps running around 0 outside.

Initial test. I filled the stuff sack with water. The sack is made of the same material, without the nicer seams. The water poured out the seems, but no seeping on the main material. Sticking your hand in the bag, you do feel the 'space blanket' effect with nearly instantly warmer hands.

First night I climbed in it in bed, and tossed my usual quilt and wool blanket over me and the bag. I felt decidedly warmer than usual even with lots of skin contact to the bag. In the morning there was no clamminess so the breath-ability claim is substantiated in my book. If it didn't breath, I should have been swimming like a fish.

For the 2nd night, I decided to 'camp out' in my basement with my oldest 2 girls. The basement runs mid 60s during the winter. I rigged up a pair of hammocks for my girls out of bed sheets and lots of blankets. 
I slept in a hammock and the bivy wearing sweatpants and a tshirt. I froze! My trip out in 3 degree weather and strong winds in  down bags had me less chilled (although much colder in spots) than 65 degrees with this bivy. 3 am, I folded and grabbed my light down jacket and wool hat. Covering my torso and arms and I slept great the rest of the night.

This again confirms what I've known for a while. Space blankets need space in order to work. This bag is SO tight on me that I doubt I can get my summer weight down bag and myself stuffed inside. Warm thin clothes is the best I can hope for.

I think I may modify the bag by adding a heavy space blanket diamond to the bottom. Slit the bag about 3 feet and tape in a diamond shaped patch maybe 6 inches wide. I am going to try to seal the stuff sack with some Gorilla brand clear repair tape to see how well it sticks and durability before I cut the bag.

This isn't a down bag, for sure. I don't foresee any use for this in cold weather. It is also not a comfortable bag. Given the size and weight, it will be my ultralight summer setup. I will be using this bag a lot I expect simply because it's so svelte. Cowboy camping in my future in this bag for sure!

Anybody else try this bag?

In album 2015-02-22

244 grams for a waterproof bivy/sleeping bag seems like a great way to go ultralight.

Shiny on the inside. Supposed to reflect radiant heat back at you. As long as you don’t touch it.

Overnight in the hammock hung in the basement, 63-65f, and I froze wearing sweatpants and a tshirt. 3am I had to get my down jacket and a wool hat, and then I was good the rest of the night.

Some nice details such as nice finished seems on the inside, and a dart at the end of the 1/4 length zipper. Six foot four 235lbs for 2 nights really pushes out on the bag and the seems only settled a little bit.

I rigged up a pair of bedsheet hammocks for the girls, tied off the treadmill. They enjoyed it OK. Not a fan of the hammock yet. Practicing camping with them so they do better when we go for real.

I finally got my Delta RepRap moving correctly

I've been fighting it for over a year. First it was a bad RAMPS board/pololu drivers. I replaced that with a SmoothieBoard (which is awesome by the way) and then it took me a month to figure out that my bed center, homing and gcode combo is causing the machine to calculate out-of-bounds which gives some VERY odd movement.

But now it moves right, with just a single config setting change in slic3r. Set the print center to 0,0 and not 100,100 like I do on my Cartesian printer.

So, now I get to re-wire the printer, as the printer has grown a foot taller over the last year. The existing wires are now too short.

Then, I get to make it print!

In album 2014-04-28

The extruder motor doesn’t move near as much as the effector does. I hope this will allow me to get better prints than if I had a long bowden tube or a heavy effector.

Looking down from the top. You can see that the effector moves much more than the extruder motor.

I was SO happy I got it to move right, that I just HAD to mount the extruder right away. With the printer running. I was THAT excited about it moving correctly that I didn’t even stop the test-print.

Looking down a pillar. I was hoping to see the carriage move up and down more and that the belt & spectra hybrid drive works well. But, this is what is shown. Instead, this shows that the extruder motor moves very little in relation to the effector.

It moves!
I ‘borrowed’ some of my wife’s hair bands and zip tied up the extruder so it balances on a short bowden tube.  I saw this at MRRF and liked it so much that I decided to buy a SeeMeCNC EZstruder even though I already had an extruder for this printer.

Portable RepRap for demonstrations

I recently attended the Midwest RepRap Fest (MRRF 2014). In talking to a few of the other attendees, I noticed a couple of themes. A lot of us do demonstrations of our printers and those who flew to the event didn’t have their printers along.

2 RepRaps and a ROMER laser scanner
This is what I brought to the event. 2 printers, a ROMER arm laser scanner, 2 computers, 3 tablets, my portable robot making fastener kit, some clothes, and a case of soda. Filled the back of trucklet right up.

This tells me that there is a need that has yet to be fulfilled. The hobby needs a small, portable printer.

Just push hard, it will fit, right?
I think having a 3d printer that can fit into a carry-on bag isn’t too much to ask.

OK, that would be a REALLY small printer, that can take a bit of abuse, being banged around inside a carry on bag.

Water Cooled Maker Gear Prusa Mendal RepRap with a tablet using GCodePrintr
This is my ‘small’ printer. That’s a 7 inch tablet running it in this photo.
RepRap in a case
I have this HUGE case that JUST fits my printer.

So, on the way home, I put some thought to the problem.

We need a printer that is:

  • Able to be held in one hand for demonstrations
  • Able to fit in carry on luggage for travel
  • Able to run while ‘unplugged’ if just for a short period of time
  • Visually interesting and has all the parts exposed so it’s easy to explain how it works


I picked up a SmoothieBoard at the show, so I want to run it off of this new-to-me board. It seems to be one of the larger boards, so other boards could be dropped in if desired. It has a built in microSD slot, so it can print without a controller. It also has lots of extra horsepower so it can do some crazy cool stuff.

Looking around, at MRRF, I saw the Tantalus. A nice, small, box printer, but not small enough. I also saw the Wally.

Then it hit me, what if I was to put a Wally inside a Tantalus. Shrunk down. The magic is that the Wally can extend outside of it’s containing ‘box’ while in use, but ‘park’ within the confines for safe traveling.

BOOM! I can print a larger print in a smaller space.

Wally at MRRF 2014
Meet Wally. So named because it’s a ‘wall’ printer, everything is built off of the back wall.

I think Wally is a slick printer. It’s built with plastic parts, common bolts, and not much else.


Wally's Z Stage
This the Z stage. It travels in an arc as it goes up and down. Crazy simple mechanically, and it makes my brain hurt doing the math on it even though I know it’s a simple offset.




A few minor tweaks and I think a Wally can be crammed into a small box. The Z can come out of the front view port while printing and the XY arms can extend out the sides while printing.

The Z arms need to be longer, poke through the back, and bolt on with the mounts towards the inside so we can get the max width print bed on the inside of the printer.

Everything needs to scale down a bit. From my reading, there needs to be a 7-10 ratio between the pulley on the motor to the big pulleys. There is also some ratio for the arm length to the big pulley size, but I don’t understand that yet.

All the motors should hang off the back I think, just so there is more viewing room inside the box.

I am thinking a 150mm square box would give me enough room to route wires cleanly off of a smoothieboard.

A small battery can sit under the print bed. I am thinking the power supply should be a generic laptop power supply. This keeps the printer smaller and lighter, not having to mount a power supply in it. This would also allow us to unplug the printer for short periods of time to walk around with it.

Mulling the idea around a little bit before I create a fork of Wally and start wrenching on the parts hard.

I think a lot of people will complain that it will be TOO small to be useful. It’s not intended on being an only printer, it’s a functional demonstration piece. Long (large) prints aren’t useful for demonstrations, it seems like they are only half-done when you want to pack up and leave. You want to be able to spit out a part in less than half an hour and have people hold it.