Instructables

Arduino Aquaponics: JSON Pump Controller

When we started developing the Aquaponics Controller   we realized we wanted a single unit that could handle multiple situations.  Some flood-and-drain aquaponics systems toggle the pump on and off on non-matching intervals, say five minutes on and fifteen minutes off and some use a bell siphon and let the main pump run continuously. 

This controller does both and throws in a third mode for manual operation.  There are a couple of challenges to building an aquaponics controller like this with Arduino, where we want to sync the operation information (mode, run time, idle time, and pump state) with a web application and yet operate independently if it should fail to make the connection.  First, due to the inherent limit the Ethernet Shield can make requests - a maximum of 5 to 10 seconds - and the frequency we need to check whether the pump relay should be toggled on or off - once every second, we realized we would need two different TimerAlarms.  Similarly, the Ethernet request frequency meant we had to find a way to sync the operating parameters (mode, run time, etc.) in one request so the Arduino could move on to checking the pump. 

Enter JSON, a web standard for passing key-value pairs.  We used the aJson library to parse the response from the web application.  A ChronoDot (real-time-clock) is used to keep the system time and track when the pump toggles on and off. 

Parts
1 x Arduino Mega R3
1 x Arduino Ethernet Shield R3
1 x ChronoDot
1 x PowerSwitch Tail II
1 x Bi-Color (Red/Green) 5mm LED
Jumper wires
CAT-5e cable

Arduino Libraries
You'll need a few libraries:

RTClib is used by the ChronoDot.
aJson is used to parse the JSON.
Time and TimeAlarms

This project is taken directly from Automating Aquaponics with Arduino.
 
Remove these adsRemove these ads by Signing Up