Ben Lobaugh Online

I think, therefore I am. I am, therefore I sail

How I made my first, CHEAP, aquarium sump

Sump filtration systems are popular amongst fish hobbyist, but in 33 years of fish keeping I have never had one on my tanks. My filter of choice is the good ‘ole under gravel. It can be a hotly debated method, but it has always served me well. Of course I have lived in places with good water straight out of the tap! Currently I am living in a real estate rehab house, and the water quality here is awful for fish. There are wild fluctuations in chemical composition, sometimes the chlorine is overwhelming. I do not trust it, and it has made keeping my tank level a chore.

As much as I like under gravel filters, I recognize their strengths and weaknesses- one weakness being the (slow) speed at which they can process the water. Larger established tanks can absorb spikes ok, but my little 30 gallon struggles under the load…. enter the sump filter.

Sumps can process the entirety of the tank’s water several times per hour, but they tend to be expensive if purchased from a fish store. When you break down their components, it turns out sumps are relatively inexpensive to build yourself.

Here are the major components:

  • Method of getting water out of the tank automatically
  • Filtration method to run the removed water through
  • Method of getting the water back into the tank

That’s it!

“But wait!”, you say, “It cannot be that easy!”

Really, the most difficult part of the project is getting the water out and back into the tank. I promise! The sump itself is simple. It consists of three parts:

  • Mechanical filtration
  • Biological filtration
  • Reservoir of cleaned water

Here is the big picture of my setup:

Getting water out of the tank utilizes a siphon and gravity- no electricity required. Just like the gravel vacuum you use when cleaning your tank. The water return is accomplished via an electric pump in the water reservoir, in this case, at the bottom of a 5 gallon bucket.

A cut away view of my sump looks like:

* The circles with an X in them are the biological filtration.

How does this work?

  • Water comes into the bucket
  • Then it is mechanically filtered via a layer of polyester
  • It tickles through the polyester into several layers of plastic pot scrubbies (yes, that you clean pans with!) that act as the biological filtration media. Bacteria loves to grow on this stuff!
  • Then falls into an empty space at the bottom of the buckets, the reservoir
  • Finally, an electric pump pumps it back into the tank

All told, this system cost less than $60 to build, vs hundreds to purchase from a pet store.

Here is a list of the components I used:

I put a ball valve on the water return line to be able to control the flow rate of water. I believe 250 – 300 gallons per hour is the current flow rate through this system. That means the entire tank water gets processed up to 10 times per hour! That is a lot of filtration….maybe a little overkill. Recommendations I saw around the web were around 5 times per hour as a minimum.

Overall a very simple project. The water clarity is outstanding and the fish are moving around happily. The main caveat here is that since this is a brand new sump it means it has to go through the whole cycling process. I am hoping it will be accelerated though since the tank as it was was cycled already. Some of that good bacteria should make its way into the sump to help prime it.

Have you built a sump before? What is your method?

If this post has inspired you to build one please drop a comment below. I would love to hear about your experience.

A couple great resources on the web for all things fish keeping

World’s cheapest standing desk

Standing desks are great to get you up from a sedentary chair, especially when you are at your desk all day. In my case, a standing desk is helpful to alleviate the pain of a back injury that I suffered in my teens.

I would like a sit/stand convertible desk, however those cost hundreds of dollars and I wanted to be a bit thrifty. This desk cost less than $20 to build. The top is reclaimed from an old shelf, and and I counted it as free.

I also wanted to be able to integrate my musical keyboard into the setup. It came out pretty well for $20!

How to use custom pivot tables in Laravel 6.x

Have you run into this before?

Your app’s database table structure is predefined and unalterable. There are lookup tables (called pivot table in Laravel) that create many to many relationships between tables using YOUR naming convention. It makes sense in the context of your application, but you quickly find out that Laravel’s relationship defaults do not match it well.

Lets take this scenario for example:

You have users who are part of organizations, and organizations can have groups in them, created by the users.

There are three primary tables:

  • users
  • organizations
  • groups

Additionally there is a lookup table called organization_groups. The lookup table contains not only the related id, but several other relevant data points, including a field called “created_by_user_id”.

This looks good in theory, however Laravel is going to require the pivot (lookup) table to be named groups_organizations out of the box. In your data structure it logically makes sense to have the table named organization_groups though. Luckily this is entirely possible, though the documentation on how to do it leaves a little to be desired.

Step One: The basic models

Let’s start out by creating the basic models. This can be easily done with Laravel’s artisan command

php artisan make:model Users
php artisan make:model Organizations
php artisan make:model Groups

It should be noted here that I used the build in Laravel users model that comes with the authentication mechanisms. I did not actually run the make:model command for that. You will not need to if you use Laravel’s users either.

Step Two: Related Groups to the Organizations model

This was the most annoying part to figure out, and the least well documented…..

When you load an organization you will be able to access all the groups via a class property. For example:

$org = Organization::find( $id );

$groups = $org->groups;

Laravel is doing some magic behind the scenes here- first, “groups” is not a property. When requested, Laravel checks to see if a corresponding method exists. In this case it looks for “public function groups()”. The method must return a relationship, such as “belongsToMany”.

By default, Laravel will use the “groups_organizations” table, but by messing with parameters I determined how to properly switch the table. Laravel does a lot of magic with parameters- depending on how many you use the meaning of the parameter changes. In our case it looks like

$this->belongsToMany( CLASS, TABLE, KEY-RELATING-THIS-MODEL, KEY-FOR-OTHER-MODEL )

which comes out to

$this->belongsToMany( Groups::class, ‘organization_groups’, ‘organization_id, ‘group_id’ )

Notice the keys are singular. Laravel is expecting them to be plural (like the table name I think) so have have to be explicitly specified here.

Here is the full code to create the relation. This code belongs in the Organizations model.

public function groups() {
   return $this->belongsToMany( Groups::class, ‘organization_groups’, ‘organization_id, ‘group_id’ );
}

Now we will be able to do things such as:

$org = Organizations::find( 42 );

foreach( $org->groups as $group ) {
    echo $group->name;
}

Step Three: Relate a User to the Group

Here each Group has a single User set in the “created_by_user_id” field.

Laravel’s many-to-one relationship used “hasOne”. In the Groups model class we add:

public function createdBy() {
    return $this->hasOne( User::class, 'id', 'created_by_user_id' );
}

Now we can find which user created a group with

$group->createdBy->name;

In the organizational context, we may have a list of all groups and who created them.

$org = Organizations::find( 42 );
foreach( $org->groups as $group ) {
    echo “Group: “ . $group->name . “ - Created by: “ . $group->createdBy->name ;
}

Hope that helps!

30_gallon_stand_cardboard_mockup

The 30 gallon fish tank stand is getting an upgrade – Sides!

With Clara crawling, it is time to baby-proof the house. One big project to tackle is the fish tank. Currently the 30 gallon tank sits on a custom stand made of 2x4s. There is a shelf on the bottom, that inevitably winds up holding tank gear. It is open for all the world to see. We are going to be closing it in  so that Clara cannot get ahold of any of the chemicals or electrical connections that are kept on that shelf.

This stand is fairly old, so this update will give is a whole new life. I do not recall exactly when we found this, but my buddy Jordan got it first I think- when we were teens still!

Here is the cardboard mock up of our solution.

30_gallon_stand_cardboard_mockup

free 90 gallon tank and stand

Free 90 gallon fish tank! Big project alert

Some of you may know- to add to the list of crazy traits I have, I love fish keeping. When I was born my parents had 21 fish tanks in the house, in fact, they met at a fish club show. Growing up I was around all varieties of tanks, from 5 gallons to 125 gallons. Small community fish to fish large enough to take a finger off.

Over the last four years I lived on a small powerboat- not really enough room to have a proper tank, so I have been without fish a while. After moving into our project house, I set up my old 30 gallon tank, but I wanted more.

Yesterday on OfferUp I saw a 130 gallon tank listed, FOR FREE! Hard to pass that up. I headed over and picked it up a few hours after it was posted.

free 90 gallon tank and stand

Tank size from a picture is a bit hard to determine, so I will post photos of the measurements below. Suffice to say this is a 90 gallon tank, not a 130. But hey, it was free!

The tank material is acrylic. I believe this is the first acrylic tank I have owned. There is a slight haze to it that I can get off with a good buffing. Sometimes when filled with water the haze disappears, so I will try that first.

The stand looks rough in the picture- because it is rough. There is a lot of rot and water damage on it. I do not trust it with the 800 pounds it will be holding. No big deal, we were already knew it needed work from the posting photos. I will take the doors off the front and build a new skeleton inside it. Piece of cake.

Sadly, there are several projects around the house that are higher priority than getting this tank running, so it will be a few months until she is up and running.

I prefer under gravel filters but am tossing around the idea of building an external sump. What do you think? Shoot me a message.

Outer tank size

Inner tank size

Page 1 of 161