Colossus Rebuild

Okay it was time to stop neglecting the aquarium part of Colossus.  I have been putting off upgrades and serious tank maintenance for months now.  So it’s complete tear down of the tank.

There are several little glitches that I want to correct with Colossus.  They are as follows: lighting glitch caused from using a breadboard,  turning on UV relay causes other relays to turn off.

Here are the mysql stats from Colossus v1.

I copied the database, and using phpmyadmin, deleted existing records so that the Record-ID number would keep the current record number and not reset to zero.


Aqeuon 300 Watt Heater Added

My last heater was a 200 watt Aqeuon.  When I reset up Colossus this summer, I was suspicious that the heater wasn’t working properly. During the summer, the heater was not a priority as the tank stayed close to normal due to room temperature.  With cooler temperatures approaching,  I ordered a 300 watt model from Amazon.

We set the temperature dial, and installed it into the tank.  After waiting a hour for the temperature to adjust, we turned on the heater.  A short time later, my suspicions were confirmed,  the other heater just wasn’t doing the job anymore.  After some time the tank warmed up and held at 79 degrees.

I them modified the colossus control program to auto turn the heater relay on or off depending on the temperature.  See commit for more code.

An additional commit to the code added an emergency overheat feature.  When the temperature reaches a certain level, Colossus Control double checks that the heater is off and will blink the mood lights until the situation is resolved.


Colossus Control Software

Colossus – The Raspberry Pi Aquarium Controller uses custom software by RBA Marketing.  Since we are using Raspberry Pi SBCs, it only made sense to write the software in Python.

The Colossus Control Software was developed using the DietPi OS.  DietPi makes installing common apps easy and has a very small footprint when booting.  Hand’s down, this is our favorite operating system for the Raspberry Pi.  The software will run on any Raspberry Pi operating system available.

Colossus Control Software Features

This python scripts handles the all of the relay switching, event logging, temperature monitoring, and system notifications.

Software Requirements

The following system applications are required for the Colossus Control Software to operate.

  • RPi.GPIO – GPIO Interface Library
  • WiringPi – GPIO Interface Library
  • I2c – I2c Support
  • LAMP Webserver Stack – Apache2/MySQL/PHP
  • phpMyAdmin – Php Mysql Manager
  • Python – Python Programming Language
  • mySQL Python Connector

You can find out how to install the above applications with easy google searches for your particular OS.  One of the reasons we use DietPi is that installing these applications is a part of the initial install process.  Once again, DietPi is highly recommended.

Miscellaneous Software

Espeak – Voice Program

Get The Software

Important note:

This software was designed to be used with three (3) MCP23017 I2C Expansion Chips. If you use less than three, you will have to modify the source code.

You can check out and download our software by visiting our GIT repository at Bitbucket.  Follow the quick setup steps below after downloading the code.

Quick Setup Guide

  1.  Create mysql database for the software using phpMyAdmin.
  2. Import config/colossus.sql into database.
  3. Edit config/colossus.confEnter your mysql information into the appropriate sectionsChange any other appropriate config options.
  4. Edit and change the following informationChange channel list to assign your own commands to a particular pin numberChange the expansionaddr[1-3] variables under #Global Placeholders.

Command Syntax

You can pass an optional on/off setting for the command if you like.  This is helpful for initialization and shutdown scripts.  If on or off is not specified, the software will flip the bit from 0 to 1 if off, or 1 to 0 if on.  Simple bit flipping with no current status checks.  If you need to know for sure that a relay is on or off, use the optional on/off

Sample Command Syntax

python Light1

python Light1  on

python Light1  off

Getting the Temperature

python temp

This command will read all DS18B20 probes defined in the config/colossus.conf file.

Miscellaneous Commands

python halt – Turn all i2c expanders to their “off” positions determined by the halt() routine located in the script.

python help – List all commands and pin numbers

python status [html] – Displays the current status of the relays.  Use the optional html to return the output as html instead of plain text.

python webstatus – Returns a single line of output as a comma seperated list contain relay name, pin number, and status.  This is used for the Colossus WordPress Plugin.

python phtest x.xx – Log result of manual pH testing into the database.

python waterchange xx -Log number of gallons of water changed into the database.

python log sensor data – Command line input feature to record miscellaneous sensor data to eventlog.