Instructables
Picture of Raspberry Pi Controlled Aquaponics
DSC_0231.jpg
DSC_0008.jpg
TopView_Raspi.jpg
DSC_0016.jpg

Aquaponics /ˈækwəˈpɒnɨks /, is a food production system that combines conventional aquaculture (raising aquatic animals such as snails, fish, crayfish or prawns in tanks) with hydroponics (cultivating plants in water) in a symbiotic environment. In normal aquaculture, excretions from the animals being raised can accumulate in the water, increasing toxicity. In an aquaponic system, water from an aquaculture system is fed to a hydroponic system where the by-products are broken down by nitrogen-fixing bacteria into nitrates and nitrites, which are utilized by the plants as nutrients. The water is then recirculated back to the aquaculture system. http://en.wikipedia.org/wiki/Aquaponics

This build uses the IBC method of Aquaponics, with modifications to include a Raspberry Pi for controlling a pump, solenoid drain, and temperature probes for water and air temperatures. The relays and timing is controlled with python scripting. Temperature and control data is collected every minute and sent to plot.ly for graphing, and future expansion will include sensors for water level and PH values for additional control.

All of my scripts are available at github.com, feel free to use them for your aquaponics setup. Thanks to Chris @ plot.ly for the help with streaming data to their service, and to the amazingly detailed build instructions provided at IBCofAquaponics.com.

The video below shows the script execution towards the end:

 
Remove these adsRemove these ads by Signing Up

Step 1: Materials

Aquaponics:

  1. IBC Shipping Container, prepared using instructions at http://ibcofaquaponics.com/

Supervisory Control and Data Acquisition System:

  1. Raspberry PI Adafruit
  2. SainSmart 8-Channel Relay Module Amazon
  3. Brass Liquid Solenoid Valve Adafruit
  4. DS18b20 Waterproof Temperature Sensors Adafruit

  5. Long range WiFi Adapter Amazon

Shed:

  1. 4x4s, 2x4s, 2x6, Cedar wood fence planks

Step 2: Build IBC Aquaponics / Shed

Picture of Build IBC Aquaponics / Shed
DSC_0197.jpg
DSC_0191.jpg
DSC_0003.jpg
  1. The shed was laid on 25 1ftx1ft pavers on gravel/sand base.
  2. I followed the instructions/video detailed at http://ibcofaquaponics.com/ to build Aquaponics base and growbed.
  3. Shed frame was built with 4x4s, 2x4s, and 2,6 on top for supporting weight of growbed

Step 3: Wiring Raspberry PI

Picture of Wiring Raspberry PI

The raspberry Pi wiring uses three GPIO ports, two for controlling relays for the pump and drain, and another for reading the value of two Waterproof DS18820 temperature sensors.

GPIO 18: Relay Pump
GPIO 24: Relay Drain
GPIO 04: Temperature Probes

Step 4: Raspberry Pi Configuration and Controller Script

Picture of Raspberry Pi Configuration and Controller Script

Prepare Raspberry PI:

Install Python and Python GPIO libraries:

sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install python-rpi.gpio

Download controller and Plot.ly script:

cd ~
git clone https://github.com/matthewh415/PiPonics

Since this script will be running for several days, I recommend running in background process or using screen command.

screen
sudo python pumpController.py

Press Control-AD to exit screen command while controller script is executing.

To return to the session, you use the screen -list command to find screen ID, then screen -r <screen id>:

pi@aquaponics ~/Aquaponics/PiPonics $ screen -list
There is a screen on: 6614.pts-0.aquaponics (09/06/14 20:32:37) (Detached) 1 Socket in /var/run/screen/S-pi.

screen -r 6614

Once controller script is executing, start Plot.ly script inside another screen command.

screen
sudo python status_Plotly.py

Press Control-AD to exit screen command while plot.ly script is executing.

gundamdud3 days ago

I love this setup and was wondering if it would be easy to use the same Raspberry Pi configuration for a normal Hydro system? I think the only addition would be adding light and fan control.

pwnage_1 month ago

Hi, what pump did you use?

matthewh415 (author)  pwnage_6 days ago

I'm using this pump from Amazon:

http://www.amazon.com/gp/product/B002RBGFA4/ref=oh_aui_search_detailpage?ie=UTF8&psc=1

michaelgc1 month ago

Love the aquaponics, how is this going for you?

bestlife1232 months ago

The system architecture embedded code?

madmedix3 months ago

I like this too; the cold frame/insulation idea would increase your growing time. As an aside, a cold frame for the growing section and a couple of brewing heat belts might just guarantee year round comfort for the fish and food for you. For an auto feeder, there's a whack of instructables on feeding your cats hacking old VCRs etc.

Thanks for sharing!

xanxer823 months ago

I think anywhere north of TX, insulating the shed and adding a cold frame on top of the grow bed would be wise to do. Very cool project!.

SoHa SMART3 months ago

spectacular job...great detail and solid build design!

Great project Matthew, I going to create mine at home. I forked your github project I going to transform your script into a web app. I going to add more features.

xarlock6675 months ago

Yes, but where is your fish launching cannon? What use are all these fish with no way to shoot them? LOLZ. No, seriously I love the idea of aquaponics. I was all set to turn our warehouse here in Houston into an aquaponics facility and try raising nile tilapia, tiger prawn, and blue crab and my boss pulled the plug. Grrrrrrrrrrrrrrrr.... Nothing like 2 weeks of wasted research to brighten your mood. One thing you might try is to make it into a streaming system. This is a similar system in most respects but creates an artificial channel in wich to raise the fish, rather than a stationary pond. It utilizes more space but nets more fish. (Pun intended). Anyway, good luck, and make a fish cannon. Fish cannons are kewl and make more efficient use of fish than merely throwing them back into the sea as some commercial trawlers do. Target? Why the fish trawlers of course. If anyone asks, it was a fish mutiny, NOT a fish cannon! You saw nothing!

Indeed! LOL!

ooterman5 months ago
Have you thought about adding a auto feeder that is connected to the system. With it connected you can have it stop feeding the fish during our short cold weeks. Also what part of texas?
matthewh415 (author)  ooterman5 months ago

Definitely - my wife is already getting annoyed with feeding the fish while I'm at work. I've looked for some commercial feeders that I could tie into, but I'm not finding many that are fully waterproof and hackable, so will likely build my own soon. San Antonio, TX

I was looking into a diy auto feeder and was thinking of a stepper motor that you would pulse with a digitally controlled voltage source. I am not sure if the PI can do that or if it can pulse the relays correctly to get the same result so I may have to use a microcontroller like a A-uno or something.

Good idea.

Also, should this be implemented, it would be a good idea to put in an inline water tester that tests for ammonia. nitrite and nitrate. If you notice spikes, it could automatically reduce feeding and alert operator by text message.

matthewh415 (author)  damionflynn5 months ago

That would be ideal... right now I'm sampling all those manually and it's another great automation opportunity. I've found a few digital probes for pH monitoring, but haven't seen any that can continuously sample for ammonia and nitrates... if you come across any please let me know!

There are numerous that test anything from PH, Temperature, TDS, Ammonia, Nitrite, Nitrate, Hardness (GH and KH) and even some that will monitor iron (important as you will almost always be adding iron to your system) and calcium as well as other trace minerals as well.

I do not have any specific examples but a quick search for them will return results.
Personally, I do not use them. As I am frequently checking AP and hydro systems all over the MS Coast, it is much easier for me to use strips or the API master kit when I am out at other locations.

stvgrc5 months ago

This is awesome. Very clean build. And what a great use of a Ras Pi.

plotlygraphs5 months ago

Beautiful!

tim_n5 months ago

Fish being kept totally in the dark?

matthewh415 (author)  tim_n5 months ago

Not completely; I live in Texas which has daylight for most of the year and seeps in pretty well through the slats in the sides/door/access lid.

craftclarity5 months ago

Super clean implementation, and really nice build! Thanks for sharing this.