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:
Supervisory Control and Data Acquisition System:
DS18b20 Waterproof Temperature Sensors Adafruit
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
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.
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.
sudo python status_Plotly.py
Press Control-AD to exit screen command while plot.ly script is executing.