Aquaponic combines Aquaculture (fish growing) with Hydroponics (plant cultivation in water). Fish excrete is broken down by bacteria to Nitrate which are absorbed by plants as nutrients, and plant roots act as a filter to clean the water for the fish. The water is circulating from fish tank to plant growing beads and back to fish tank. This is almost a closed circuit, you feed the fish and fish feed the plants and both feed you. This type of plant cultivation can be used anywhere (deserts, rooftops, houses...) and actually saves water as the same water is constantly recirculating (you just have to top up the tank when water evaporates), compared to traditional soil plant cultivation that needs to be watered constantly and most of the water is lost in soil. Also if all conditions are meet plants grow much faster then in soil because they don't have to develop extensive roots, nutrients are brought directly to them.
More details about aquaponics can be found on these links:
NFT (Nutrient Film Technique) is a system for growing plants that recirculates water in a shallow stream over plant roots in a watertight gully. Gullies are most commonly made from PVC pipes with drilled holes on them that fit plant containers. Plant containers have holes that enable plant roots to grow inside the gully.
My motivation for doing this instructable was to make life easier to all those aquaponics enthusiasts by automating the system so they can have a better control and monitoring of the system, and to allow them to experiment more easily with different settings to see which ones give best results.
I used a 20 liter aquarium as a fish tank and pvc pipes to house 10 small plant containers. Its a small experimental setup but the controller can be used on a much bigger system. It could even run a small aquaponic greenhouse or if you already have an aquaponic NFT system you can just hook it up on that.
The system uses Intel Edison as a brain, many thanks to Instructables and Intel for providing me with this nice piece of hardware. Controller is made to be plug and play, you just plug in regular aquarium water pump, lights, air pump and fan to the controller box and attach the sensors. Controller can be hidden somewhere as everything can be viewed and controlled in the webpage on the local area network. Webpage displays the sensor data and enable users to change system settings, sensor data is refreshed using websockets so it has a good response to system changes.
To control water flow through the gullies water pump(AC) and water flow sensor are used. When certain amount of water passes through the gullies system can pause for some time to allow better aeration of the roots. If the water flow stops (pipes clogging or water pump malfunction) an alarm is sounded with LED indicating what is the problem.
You can set which period of the day you want your plants to receive light (eg. 10am to 10pm), if the ambient light is strong enough "artificial" light will be turned off to save power and when ambient light drops under user defined value artificial light will be turned off. There is a second light sensor that measures system light, so if the system is not getting enough light even when the artificial light is on an alarm is sounded with LED indicating what is the problem.
Aeration pump can be turned on or off by system settings, and fan can be turned on if temperature goes over user defined value.
Alternating current circuit is completely isolated from the Intel Edison circuit by using 4 channel relay module with optocouplers.
- First I'm planning to add a DIY automated fish feeder with adjustable settings (already in process)
- Water level sensor that will sound the alarm if the water level in aquarium drops too low.
- Webcam to take a picture of the plants each day and store it on a SD card, so you can review your plant progress.
- Next is to add pH, DO and EC sensors to have a better overview of the water chemistry. DO (dissolved oxygen) sensor readings can then be used to turn the air pump on if DO value drops too low. These sensors are expensive so prize sparkfun credits would really come in handy. So please if you like the this instructable don't forget to vote for me in Intel IoT Invitational.
- End goal is to store all these sensor and event data in a central database, that way we can feed it with data from multiple controllers. A web app on top of database that can display all the data and make statistics. I know there are cloud services like Salesforce IoT Cloud and Intel IoT Analytics that can achieve a similar effect, but I want to do it locally so i have full control, and can tailor the webapp (and db) the way I want and make its simple enough for everyday use.
Step 1: Gathering Materials and Tools
- Intel Edison + Arduino Breakout Board
- 4 Channel 5V Relay Module With Optocoupler
- G3/4 Water Flow Sensor Switch - Hall Effect
- Piezo Buzzer
- Temperature Sensor TMP36
- Photoresistor (2x)
- Resistor 220-ohm (3x)
- Resistor 10-kilohm (3x)
- LED (Light Emitting Diode) Green (1x)
- LED (Light Emitting Diode) Red (2x)
- Small Breadboard with jumper wires
- 1-2 meter of wires (8x) or just use UTP cable like me
Alternating Current parts:
- 220V AC Outlet (Europe) or 110 AC Outlet (US) (4x) - local hardware store
- AC Switch - local hardware store
- Power Supply - AC 220V/110V to DC 5V minimum 400mA - try to find old phone chargers (I used one from Ericsson)
- 1mm copper insulated wires for electrical instalations (2-3 meteres) - local hardware store
- Laminate Flooring/Floating wood tile (6mm thickness)
- 25x25mm piece of wood
- Small Nails
- Small Hinge (2x)
NFT System Parts:
- 25 liters fish aquarium (40cm x 25cm x 25cm)
- metal or wooden frame (50cm x 40cm x 50cm)
- 1 meter of garden hose 1/2''
- 3/4"x1/2" Hose Barb to Male Pipe Fitting (1x)
- 1/2"x3/4" Barb to Female Swivel Garden Hose (2x)
- PVC pipe 75mm diameter, length of 30 cm (3x)
- PVC pipe (75mm) elbow 90 degrees (5x)
- PVC pipe (75mm) elbow 45 degrees (1x)
- PVC pipe (75mm) cap (1x)
- Drilling Machine
- Rasp Tool
- Brad Point Drill Bits
- Hole Saw
- Angle tool
- Tape Measure
- Soldering Iron
- Wire Stripper
Step 2: NFT (Nutrient Film Technique) & Aquarium Settup
For NFT gullies I used 7.5 cm diameter PVC pipes that is ordinarily used for bathroom drain plumbings. They have rubber rings on one side so joint is sealed as soon as you plug one into another. Where i live you can pick them up from any hardware store. If your country doesn't have pipes like that you can probably find something with similar diameter just make sure it fits inside the frame and you can make joints watertight.
First drill one hole on 4 elbows (90 degree) and two holes on each 30 cm pipe, make sure that there is at least 5 cm space between the holes and try to distribute them evenly. To make these holes use a drilling tool and a circular saw (50mm diameter), after that use a rasp tool or knife and sand paper to smooth the edges of the holes. These holes will hold plant containers.
In the center of the PVC cap drill a hole of 26mm also using a circular saw and screw in the brass fitting (1/2''3/4"x1/2" Hose Barb to Male Pipe Fitting).
Assemble the PVC piping as it is shown on the picture 4 and 5. If the pipes are not going one into another put some cooking oil on the rubber rings to enable them to slide in more easily. A good thing to do before assembling is to wash the pipes to make sure nothing on them can harm the fishes.
Frame I used for the system was an old shelve unit made from aluminium rods and connectors. It is strong enough to hold the aquarium and pipes with plants and it looked good so i decided to reuse that. If you cant find anything similar you can always make your own frame. Dimensions are: height 50cm, width 50cm and depth 40cm.
Once assembled put it on your frame and adjust the pipe angles to drain the water from the cap to the 45° elbow (last one), holes for plant containers should face up :) . To secure the pipes I used few galvanized screws (screw them in the upper part of the pipes that wont have water running over them) and wires tied to the frame. Probably a better way of securing them would be to use proper 75mm pipe mounts, but im not planning on having big heavy plants so this should be ok.
Put pipe fittings(1/2"x3/4" Barb to Female Swivel Garden Hose) on each side of the G3/4 water flow sensor and tighten them. Now cut two pieces of 1/2 garden hose and connect them. One should go from the water pump to the water flow sensor and the other one from water flow sensor to fitting on the pvc cap. If they are going hard on the barb fitting heat the hose in hot water for a minute and then try again. I also added a manual valve between the pump and the flow sensor so i can control the amount of water flow, but its not necessary as I have it fully open all the time. Tighten the water flow sensor to the frame by zip ties or wires.
At this time you should test the pipes and hoses for leaks by leaving the pump to circulate water through the system for at least half an hour (just put some water container below the pipes). Also when you turn off the pump, if the water stays in one part of the gully adjust the slopes so all water is drained back to the aquarium.
If everything is ok you can install your aquarium and make sure water exiting from the pipes drop into aquarium and don't sprinkle water out of aquarium.
Now the aquaponic system is ready and we can go to the steps to automate it.
I wont go into starting up and cycling the aquaponics system in this instructable you can read more about it here.
Step 3: Controller Box
As I don't have a 3D printer i had to make a box for the controller in the old fashioned way ... with wood.
You can download pdf with dimensions and sketchup model of the box.
I had some laminate flooring left so i used that for the box, board thickness was 6 milimeters. You can use any wooden board you can find but if it has a different thickness you will have to compensate on sides E and F (labeled on first picture). Eg. if your board thickness is 10mm then the length of sides E and F are 180mm instead of 188mm.
First cut out all sides from dimensions specified in pdf (compensate board thickness), then mark all hole centers and Intel Edison board openings.
Use brad point drill bits (50mm) to make socket holes on side B, then use a rasp tool widen them so sockets can fit in tightly. If your country uses different sockets then measure them and make holes to fit them.
Drill 5mm holes for LED Indicators and piezo buzzer (Side C), and 3mm holes for bolts that will secure Edison and relay boards(Side B), a 8-10mm hole for power cord (Side F).
For Edison board openings first use a drill to make holes, and then tailor out the openings using the jigsaw. Try to fit in the edison board, if its not going in widen it more using a jigsaw. Also make sure all cables can be plugged in.
I found this AC flip switch laying around, most probably you will not find something simmilar so you can skip adding a switch. If you want it, buy something similar from a local hardware store, take the measurements and cut out an opening to fit it in.
Take 25x25 piece of wood and cut 4 pieces to 80mm length (Parts G).
Now take a hammer and nails (15-20mm long) and first assemble and nail sides C, D, E and F to parts G in the corners (look at the picture 5 to get a better idea how), then nail in the side B to assembled frame. You could use screws instead of nails, but nails are cheaper and are good enough.
Side A can be screwed in when you put everything in the box, but i wanted a easier access to the inside of the box when i want to modify or check something. For this I used two small hinges (30x30mm), screw them in on the inside of Side A, and on the outside of side C. As side C is the top side, gravity will keep it closed.
Step 4: Relays & AC Sockets Setup/Wiring
Here in my country (Croatia) we use European Type F Sockets for domestic grid electricity (230V monophase alternating current), so I put those on the controller box. That kind of socket is used for all house appliances, aquarium also, although most of them use Type C plugs, which are the same thing just without grounding connection.
If your country uses different AC Sockets use that, the wiring is the same, you just have to adjust the size of the box holes for sockets.
WARNING - In this step we are working with alternating current which can do serious damage to human body and can even cause death, so if you don't have any experience in working with alternating current or you are not sure what you need to do here find a person that does, and let them help you out.
First insert the sockets in holes and secure them with screws, two screws for each socket should be enough (if you want you can put four).
Take the 4 relay module and find two bolts(around 2-3cm length) with 6 matching nuts that fit the mounting holes.
- put the bolts in the mounting holes and secure them with nuts
- next screw in second set of nuts on desired height, minimum 1cm of bolt length should be keept so it can go through the box and have space for the nut on the other side
- insert into box holes and screw in nuts from the outside, make sure everything is tight
To secure the AC-DC adapter you can use a metal strip and screw them in the sides. The adapter I found had a cable with AC plug, so I cut it off and used that as the controller box cable plug. If your adapter doesn't have a cable plug you can buy it or strip it of from some old household appliance that doesn't work.
I have put an AC switch on the box, but if you don't have (or don't want) one it doesn't matter, you can skip that and just unplug the controller from the wall socket when you want it to turn off. NOTE: If you put the AC switch make sure it's made to handle alternating current.
And finally wire everything up as it is shown on the schematic.
- One input AC wire goes directly to the adapter and one side of the sockets
- Second AC wire goes to switch (if you have it)
- After the switch it goes to adapter and to middle connector on each relay
- Left side of each relay connector connects to second side of the corresponding socket
- Connect +5V (red) wire from adapter to jd-vcc pin on the relay module (remove the jumper)
- Connect gnd wire from adapter to gnd pin on the relay module
This relay module uses optocouplers so we can completely isolate our edison board, to protect if from any possible surges caused by relay failure. More info about relay modules can be found on this site and about the wiring to arduino here.
Step 5: Intel Edison Wiring
Screw in Intel Edison Arduino breakout board to plastic legs that came with the board, and then screw in the legs through the pre-drilled holes on the box (side B).
Most of the breadboards have a sticky back side, so just stick it on the box between the Edison board and the relay board.
All sensors are outside the box, connected by wires to breadboard. I recommend using UTP cable for wiring, its light and it has 8 different color wires in them, so you can identify easier what goes where.
- Make two groups with 4 wires each
- On first group connect the temperature sensor and photoresistor, they can share the +5V wire so 4 wires are enough
- First group will collect ambient data so its best to attach those sensors somewhere above the system lignt, so it doesn't pick up the system light
- On second group connect water flow sensor and photoresistor, they also can share +5V wire so 4 wires are enough.
- Photoresistor from the second group should be placed somewhere inside the system so it can catch its artificial light, possibly somewhere it wont be covered with plant leaves.
- On the breadboard photoresistors use 10-kilohm resistor connected to the ground, and water flow sensor uses 10-kilohm resistor connected to +5V
- Secure the wires so they can't be pulled out of the box, I used a metal strip screwed on the box and put few layers of insulation tape on the wires so they cant be pulled out.
Insert LEDs into box holes and solder some wires to them so you can connect them to the breadboard, connect the cathodes (short leg) to ground through 220-ohm resistors, and anodes to edison pins 10, 11, 12.
Solder some wires to piezo buzzer and insert it into box hole, connect one wire to pin 9, and other to gnd.
Connect Edison pins 4, 5, 6, 7 to relay module pins, and +5V from edison to vcc on relay module board.
Finally label the sockets and LED indicators.
Step 6: Edison Configuration and Code Upload
First assemble, flash and install everything you need for Intel Edison with Arduino breakout board, details can be found on this link.
- Set up your serial connection, details here.
- Connect your board to your local wifi, details can be found on this link.
- Set the your Time Zone on edison, details can be found on this forum post.
- Set your device name using this command (in serial terminal): configure_edison --name
- Set your root password using this command: configure_edison --password
Device name will enable you to access you device from browser(on a computer connected to your local network) without IP by typing in "http://device_name.local/" (eg. "http://edison.local/"). You should try it out to make sure its working ok, a simple web page with device information (hostname and IP Address) and intel logo should show up.
Install Intel XDK IoT Editon, details can be found on this link. Make sure your XDK is up to date and after you connect to your board upgrade the xdk-deamon on IoT device.
Start a new project from template "Onboard LED Blink" and run it on your device just to make sure everything is working ok.
- Now when everything is set up you can download "Aquaponic_IoT.zip" and unpack it somewhere on your disk.
- Start a new project, select "Import Your Node.js Project", browser for folder where you unpacked the zip, continue and enter a working name of the project.
- Upload the code to your device and run it
- Go to "http://device_name.local:3000/" in your browser and you should see the Aquaponic IoT webpage
Step 7: WebApp and Alerts Explained
- Light percent gauge - this sensor is placed somewhere above the system lamp
- Temperature gauge
- These show the data from the ambient the system is in (eg. room where you put the system).
- Light percent gauge - this sensor is placed inside the system
- Flow Rate - shows current flow rate, something like a RPM gauge in a car, only this one shows Liters per Minute.
- Flow Cycle Progress - progress bar that shows how many liters have passed in the current flow cycle
- Flow Cycle Statistic - holds the values of last cycle duration, average cycle duration and how many cycles where measured for this statistics. Flow statistic will be reset after edison reboot, manual reset and if you change Liters per Cycle setting.
- 4 boxes, one for each device connected to Controller: Water Pump, Lights, Air Pump, Fan
- Red box indicates the device is turned off, green indicates the device is turned on
- Stop Sound Alert - override for alarm, so you can stop the sound until you fix the problem (i did try to make the alarm sound as less annoying as possible, but long exposure to it will probably make it annoying)
- Reset Flow Cycle Statistics - Resets the flow cycle count and average values (good to do after cleaning your pump)
- Event log displays every event in the system, when any of devices is turned ON or OFF, and system alerts.
- eg. "08:42:27: Water Pump: OFF, Reinitiate at: 08:52:27"
- Starts At: - when to turn the lights on
- End At: - when to turn the lights off
- Minimum Light (%): - turn lights on if ambient light drops below this percent
Water Pump Cycle
- Liter per Cycle: - how many liters should flow in the cycle before the pause
- Pause Cycle (minutes): - after the cycle ends pause for minutes specified
- Fan plugged in: - fan is optional so you can define here if you connected it or no
- Max. Temperature: - Specify maximum temperature, if ambient temperature go over that value fan will be turned on
- Air Pump plugged in: - If you think your water is not aerated enough you can plug in an air pump, runs constantly for now, I'm planning to add a DO (dissolved oxygen) sensor to know when it should be turned on.
When water isn't flowing through the system, and water pump relay should be on this alarm is sounded and flow alert LED lights up.
This alert can be caused by few different reasons:
- Water pump malfunction
- Flow sensor malfunction
- Hoses clogged
- Relay malfunction
When system lights should be on, but the system is not getting enough light, alarm is sounded and light alert LED lights up
This alert can be caused by few different reasons:
- Light malfunction
- Light sensor malfunction
- Light sensor covered by a leaf
- Relay malfunction
Second Prize in the
Intel® IoT Invitational