My Raspberry Pi Aquarium Controller

So I have my first fish tank and some Raspberry Pi’s lying around and decided to create a kinda of controller/monitor with the future functionality of a data logging.

There are already lots of ideas out there for a Raspberry Pi based aquarium controller, but as a first time project I wanted to create something as much on my own as possible. Systems like the ones below do look very nice and when I flip back to what I intend to make it isn’t as good… but its exactly how I want it to be and I made it!

Current Raspberry Pi aquarium controller projects:
Google search result
Google search result on the RPi forum
Open Aquarium
RPi Tank Monitor
Raspberry Pi Monitor
ReefPi – I was really interested in this one, they have some great ideas but as with many projects, lots of people say they will do things and then back out for whatever reason, the original people loose interest or they cant find someone who is willing to actively do the hard bits of hardware/software. This project is still new but I get the feeling not enough people are creating and there is just commenting.

I am not script guy so all of this is learning, very slowly, but hay, its fun!

The plan is to have a power bar for things like the lights/pump/filter/air/topup and alike that can be controlled by the Raspberry Pi though a web browser and later an ‘App’. Other sensors can plug into the power bar which then connects to the RPi.

At the moment I will plan for the Pi to be located inside the power bar, once the basic setup has been completed I will move the Pi to an external enclose – I am going on the idea of if the SD ever crashes, being housed in an external case is easier to deal with.

Aswell as the web interface for smart devices/PC,  I would like to have a screen or box mounted on the front of the aquarium cabinet with some physical buttons for functions that can be monitored from the web interface but not changed i.e. a button to activate a task that should only be carried out whilst next to the tank so the task cannot be run accidentally by remote, like a ‘feeding time process’.  This box can also house some simply LED’s to give a visual on the state for the relays, and it means a chance to play with more LEDS!


Lights like the back-light, main ‘sun’ and moonlight will run from the power bar. The first stage is to get a working and reliable scheduler setup so the lights turn on and off at the right time. An RTC (real time clock) module is needed to keep the time accurate on the RPi (outbound firewall blocking is active and a backup incase my domain goes does and thus no NTP service, also something else to learn…)


Temperature probes for the tank and sensors for other equipment will have a pass-through connection from the power bar to the main RPi box. A D-Sub style connector will be used for the main power bar to RPi box for the first version of this project I will just be using GPIO pins where each pin has its own wire, at the moment the wire count is at 18 lengths.

Two or three temperature probes will be used, 1 for the air temp between the lights and the top of the water with 2 probes to actually monitor the water.


pH sensing is going to be one of the harder parts of the project, finding a probe, obtaining a source for the calibration fluid, setting it up, programing a function to log when the probe was last checked and when to do it again.

I don’t really need an automatic water top up system as with the glass top there’s no evaporation, but a system to fill the tank in a ‘soft’ way rather then glugging water from a container into the top of the tank is on the plan.
This system will run from a pump connected to the remote power bar. With 2 senors on this circuit,  1 sensors will tell the piTank when the water reservoir is empty  other will tell the piTank when the aquarium is at max capacity. A siphon affect from the pump below will drain off any access water once the ‘hi mark’ cuttoff has been reached and the pump stops.  This function wont be available from the remote interface as I will still need to fill the reservoir below, using two 10 liter containers I go back and forth so its just fail-safe function. I am not looking for a plumbed in solution to refill the water any more then this.


Version Control
Rather then editing a live version of the controller I will run both an alpha and Beta, the Beta on my actual tank and the Alpha on a simulation platform. An RC will be released at some point as a basic project for anyone to improve on.


The Future
As my knowledge and the project progresses piTank will also log data, timestamped into a remote database as to minimize SD card writes and also a backup in case the card dies. In time,  pH/temperature, water change events and alike will not only be logged in the database but also graphed out using the previously recorded data.


Why the name piTank?
Okay okay, I know there is a Raspberry Pi ‘war’ tank project going by roughly the same name, my name has no spare between the Pi and the piTank bit. All other names I could think of that provided such obviousness as to what the project does in comparison to its name has already been taken i.e. ReefPi, PiAquarium, AquaPi, iAqua, OpenReef, FishPi….. Any suggestions your willing to throw my way please do!


Stay tuned for updates on the project.

Leave a Reply

Your email address will not be published. Required fields are marked *