Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)

Aquaponics pH Level, Temperature, and Dissolved


Oxygen Monitoring and Control System
Using Raspberry Pi as Network Backbone
John Paul Mandap 1, Derrick Sze 2, Gerard Nico Reyes 3, Samuel Matthew Dumlao 4, Rosula Reyes 5, Wen Yaw Danny Chung 6
1-5
Department of Electronics, Computer, and Communications Engineering
Ateneo de Manila University
Quezon City, Philippines
6
Department of Electronic Engineering
Chung Yuan Christian University
Taoyuan City, Taiwan
1
johnpaulmandap@gmail.com, 2 derrick.sze@obf.ateneo.edu, 3 gerardnico.reyes@gmail.com,
4
sdumlao@ateneo.edu, 5 rsjreyes@ateneo.edu, 6 eldanny@cycu.edu.tw

Abstract - Monitoring environmental parameters in aquaponics in terms of labor and time. As a result, there is a need for a
is essential to sustain healthy living conditions for both fish and network system which should allow quick system scalability
plants. In order to maximize growth for both, an optimal balance of and should be able to manage transfer of data between the
environmental parameters present in the system is necessary. As a
system and the user.
solution, an automated aquaponics system that reacts to parametric
changes with an integrated web interface is developed. The Arduino The main objective of the study is to develop a sensor
microprocessor sends measured parameters to a central node which network array with a control system and web interface for an
host a local server to store the data. Acquired data is processed and aquaponics system. Specifically, the study aims to:
triggers corresponding actuators to maintain the optimal ● Implement a sensor node that is capable of gathering
environmental parameters. All information are displayed in a pH, temperature, and oxygen saturation values
mobile-friendly web application which enables access to the ● Implement a control node that automatically changes
real-time and historical data, and manual controls of the actuators.
pH content, temperature, and oxygen saturation to
Results shows that the calibrated sensors can gather sensor
parameters with high accuracy through comparisons with maintain the standard set values as well as
commercial sensor readings. The control system is capable of periodically feeding the fish
running actuators automatically as a result of changes in sensor ● Develop a network that is capable of integrating both
parameters or manually by the user. Each actuator was tested and the sensor and control node that also enables the user
successfully triggered for a set period of time for both manual and to view live system feedbacks
automated controls. Finally, the network backbone can transmit
information and host a website that displays live sensor data, II. REVIEW OF RELATED LITERATURE
manually control the actuators, and save sensor reading logs.
Sensor data are updated and are presented to the user every half Ion Sensitive Field Effect Transistors (ISFET) are MOS
seconds which ensures that the data presented are updated. A web based transistors which is primarily an electrochemical sensor
application is also uploaded to Heroku which allows the user to used to detect ion activity in a solution through the addition of
view sensor logs and manually control the actuators anywhere. an insulating layer to its sensitive surface (Si3N4, Al2O3, Ta2O5)
With the fully integrated system, the study was able to implement an [1]. For this research, Si3N4 constitutes the sensing membrane
automated aquaponics system that measures and controls pH, of the ISFET in determining H ions activity, specifically for
temperature, and dissolved Oxygen.
pH level. This sensor also utilizes a readout circuit which
Keywords—Aquaponics, ISFET, Sensor Network, Control provides constant drain current and constant drain-source
System, Web Application voltage shown in Fig. 1.

I. INTRODUCTION
To know the current state of an aquaponic system, checking
the parametric values read by the sensors is essential.
Checking these values manually often require an experienced
individual and thus could prove difficult for beginners to
understand. Determining a means of understanding the current
state of the aquaponics system in any given time and place is
essential to the users. As the aquaponics system expands,
monitoring the aquaponics systems become more demanding Fig. 1. ISFET Single Channel Readout Circuit [4]

978-1-5386-5457-6/18/$31.00 ©2018 IEEE 1381


Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on August 09,2021 at 15:35:27 UTC from IEEE Xplore. Restrictions apply.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)

A study by Sallenave [2] illustrates the consequences of


exceeding the threshold levels for control variables relevant to
this study as summarized in Table I. When the pH level drops
from 6.4, a base of calcium hydroxide or potassium hydroxide
can be added to the system. However, these must be added
alternately since both calcium and potassium are essential to
an aquaponics system [2]. Additionally, phosphoric acid may
be added to reduce the pH levels of the aquarium. Other forms
of acid may be detrimental to the health of fish. In order to add
these compounds, peristaltic pumps are usually used in this
type of setup. However, since fish cannot easily adjust to fast
changes in pH levels, the chemicals should not be directed to
the fish tank [3].
Water temperature not only affects the fish, but also the
performance of the nitrifying bacteria and plants [2]. Choosing
a balance between these ranges would be optimal for the Fig. 2. Sensor System Design
growth of all organisms. Contrary to controlling the ion
concentration which would take up to several hours, In order to control the necessary water quality parameters, a
temperature can be controlled more easily. As such, another cooling fan, heater, aerator and peristaltic pumps together with
form of control may be used. In order to sustain the ideal a fish feeder are used. The set-up for the control node is shown
temperature conditions, PID control would be sufficient. in Fig. 3 where all the actuators are controlled by Arduino. A
By creating a network architecture, viewing and manually fish feeder was also added to sustain fish growth.
controlling the system in the local network becomes possible. The overall system framework is shown in Fig. 4. The
Vikram et. al. was able to create a network architecture for a backbone network serves as the bridge that integrates the
home automation system [5]. The five sensor nodes are sensor network and the control network. It obtains the sensor
communicated to the nearby microcontroller by using several readings from the sensor node and sends appropriate control
nRF24L01 RF modules. The microcontroller uses the signals to the control node based from computations. The
ESP8266 WiFi module so that it can connected to a web backbone network also hosts a local web server that gives the
server. An Android application that can access the database in users the ability to view the sensor readings and the status of
an (Message Queuing Telemetry Transport) MQTT based each actuators as well as the option to manually control these
cloud server was then developed so that the user can supervise actuators through a web application. A web application is also
the data from the sensors and control different actuators. hosted in heroku to provide access to the user anywhere.

III. DESIGN OF THE SYSTEM IV. IMPLEMENTATION OF THE SYSTEM


The study features four sensors which monitors the water The ISFET shown on Fig. 5 (a) is placed on the grow bed
quality of the aquarium to be used in the aquaponics setup. below the pumping tube while the ISFET shown in the middle
The sensors are composed of two ISFET-based pH sensors, a is placed in the aquarium beside the siphon tube. These
DS18B20 temperature sensor, and an Atlas D.O. Probe. As sensors produce an output voltage through the readout circuit
seen in Fig. 2. These sensors are interfaced with Arduino and which
gather the pH content, temperature and oxygen saturation.

TABLE I. EFFECTS OF CONTROL VARIABLE LEVELS [2]


Control Effect
Optimal Levels
Variable Low Levels High Levels
Nitrifying bacteria
pH pH 6.4 -7.4 Plants grow best performs best; Fish
grow best
Fish growth is
Warm water has less
impeded;
o oxygen; Difficult to
Temperature 25-30 C reproduction stops,
maintain Dissolved
higher risk of
Oxygen level
diseases or death
When water becomes
saturated, the excess
Dissolved Fish growth will be
>6ppm oxygen will simply
Oxygen adversely affected
disperse into the
atmosphere
Fig. 3. Control System Design

1382
Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on August 09,2021 at 15:35:27 UTC from IEEE Xplore. Restrictions apply.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)

Fig. 4. Overall System Framework

the microcontroller can directly read and translate into pH


levels. A reference electrode as shown in Fig. 5 (c) is also
placed within the aquarium. Fig. 6 shows the Atlas Dissolved Fig. 6. Sensor Node Circuitry and Arduino Uno
Oxygen Probe on the right and the DS18B20 second on the
left both submerged under water in the aquarium. The Atlas
D.O. Probe comes with its own IC which sends data regarding
the oxygen saturation of the water to the sensor node. The
DS18B20 is connected to a 4.7kΩ pullup resistor which is then
connected to the sensor node.
Fig. 6 shows that all of these sensors are connected to a
single Arduino Uno microcontroller. Data obtained by the
sensor node is then sent to the Raspberry Pi central node
through a wired serial connection.
The control system implemented in Fig. 7 uses Python
running in Raspberry Pi for computations and Arduino for
control of the actuators depending on the water parameter
levels. This entails that Arduino directly controls the actuators
to turn on or off for a specified time frame. On the other hand,
Python performs all operations and processes and instructs the
Arduino on when to trigger the controls based on sensor data

Fig. 7. Control Node Implementation. (a) Control Housing Location (b)


Control Node
or user input. Fig. 8 shows the critical values of the control
variables to where it should be adjusted by actuators.
PID control is used to maintain a range of temperature
values. As such, a temperature set point is sustained which is
then adjusted through the necessary actuators. Since the
Fig. 5. Sensor Locations. (a) pH-ISFET in grow bed, (b) pH-ISFET in actuators affect the temperature levels at a short period of time,
aquarium, (c) reference electrode (d) DS18B20 Sensor, and (e) Atlas D.O. PID control was used and implemented. Schedulers were used
Sensor.

1383
Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on August 09,2021 at 15:35:27 UTC from IEEE Xplore. Restrictions apply.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)

Fig. 9. Live Sensor Data Page

Fig. 8. Control System Flow Chart

for time dependent controls such as fish feeding and peristaltic


pump control. Fish feeding is done at intervals of eight hours
which starts counting once the program is initiated.
Additionally, when the pH value is below 6.4, the peristaltic
pumps automatically activate by releasing acids or bases to the
Fig. 10. Sensor Data Log Page
grow bed. Checkers were also added to the control functions
of peristaltic pumps where an acid or base will be immediately
added to neutralize abrupt changes in pH. Lastly, the aerator is
simply turned on when the dissolved oxygen level becomes
too low. Since the effect is almost instantaneous, no additional
controls are implemented.
All three sensors are connected to a single Arduino sensor
node where the data from the sensors are acquired, interpreted,
and communicated to a Raspberry Pi sync node through USB
serial communication. Data sent from the sensor node are in
the JSON string format which the sync node interprets.
Transmissions are also automatically verified by taking
advantage of the JSON library used for Python. Because of Fig. 11. Live Overview Page
the close proximity of the setup, wireless transmission
between the sensor and the sync node is not needed. The live graph on Fig. 9 retrieves data from the database
Similar to the sensor node, the control node also every second. This will ensure that the data that the user will
communicates with the sync node through a wired two-way be seeing is up to date. The Highcharts library provides the
USB serial communication. The control node sends JSON graph on Fig. 10 which features a static graph that obtains data
strings of the control status while the sync node sends control from the database in page load. The graph obtains the data
information also in the JSON string format to the sync node. asynchronously which will avoid long web loading time. The
The Flask microframework is used to develop both the web graph features a scrollable and zoomable graph that will let the
application that is broadcasted to the local network and is user easily view the trend of the sensor data.
uploaded to Heroku. Several routes are created that enables the The web application hosted in heroku does not feature live
user to view live sensor data in a graph as shown in Fig. 9, to sensor data but it allows viewing of sensor data logs and
manually control and view status of the actuators as shown in manual control of each actuators. The interface of the web
Fig. 10, and to view the sensor data history in a graph as application is similar to Fig, 10 for the sensor logs and Fig. 11
shown in Fig. 11. The seamless communication between the for the manual controls.
server and the client is assured with the use of the socket.io
library. V. TESTING OF THE SYSTEM
The Twitter front end framework Bootstrap is used to The ISFETs have been calibrated using three pH solutions:
provide better visuals to the web application. The Highcharts 3, 6, and 9. Along with the process of calibration, a Dr. Meter
Highstock Javascript library is used to display sensor data in a pH Pen Tester, an Atlas EZO pH Sensor and pH Indicator
graph that is visually pleasing as shown in Fig. 9 and Fig. 10.

1384
Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on August 09,2021 at 15:35:27 UTC from IEEE Xplore. Restrictions apply.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)

Papers were also tested as a basis for comparison. The graph TABLE II. PH SENSORS AVERAGE PERCENT ERROR
Fig. 12 shows the different performance of the sensors. pH-ISFET Dr. Meter pH Pen Tester Atlas EZO pH Sensor
1.51% 1.48% 0.55%
The output voltages of the ISFET were also obtained at
varying temperatures due to the inherent effect of the
temperature to the output voltage of the ISFET. Graphs in Fig.
13 show the linear plot of the pH curve based on the output
voltages obtained from the two ISFETs. The average percent
error between these three sensors were also obtained based on
Fig. 12 as shown in Table II. The pH-ISFET has nearly the
same performance as the Dr. Meter pH Pen Tester whilst the
Atlas EZO pH Sensor outperforms both, having significantly
less percentage error.
The ISFET has also been tested on the aquaponics setup
itself over the span of six hours to test for its efficiency over a
Fig. 14. ISFET Actual Testing Results
long periods of time. Every fifteen minutes, the pH obtained
from the two ISFETs are obtained along with the pH obtained TABLE III. PH-ISFET PERCENT DIFFERENCE
from the Pen Tester submerged in the grow bed and aquarium. Duration (Hours) 1 2 3 4 5 6
Results of this testing is shown in fig. 14. A noticeable pH-ISFET #1 1.37% 0.96% 1.46% 3.56% 3.89% 2.38%
difference between the results of the two sensors used in the pH-ISFET #2 1.58% 2.37% 1.19% 1.51% 3.02% 3.65%
six hour duration testing is the apparent drift of the ISFET pH
TABLE IV. ATLAS D.O. PROBE CALIBRATION RESULTS
reading as compared to the Pen Tester. In Table III, the percent
Pre-Calibration Post-Calibration
difference of both ISFETs are at maximum at around five to Trial #1 Trial #2 Trial #3 Trial #1 Trial #2 Trial #3
six hours after its operation. 1.77 mg/L 1.77 mg/L 1.77 mg/L 0.00 mg/L 0.00 mg/L 0.00 mg/L
The Atlas D.O. Probe was calibrated by submerging the
probe in a sodium sulfite solution which ideally return an TABLE V. ATLAS D.O. PROBE TEST RESULTS
oxygen saturation of zero. An offset is introduced to ensure Aerator ON Aerator OFF
Trial #1 Trial #2 Trial #3 Trial #1 Trial #2 Trial #3
that the sensor return a value of zero. Table IV shows the
10.15 mg/L 10.35 mg/L 10.31 mg/L 6.34 mg/L 6.42 mg/L 6.38 mg/L
results of this calibration procedure. The Atlas D.O. Probe was
placed on the aquaponics setup itself, testing for the effects of
The DS18B20 was calibrated with the use of a Medica
the aerator turned on or off for an hour. This was performed in
Digital Thermometer. Small amounts of water with varying
three trials, ten minutes apart as illustrated in Table V.
temperatures in increments of three degrees were used as data
points for each of the trials. Results as seen in Fig. 15 show
that the DS18B20 was consistently off by 0.375 degrees
celsius and thus we introduced an offset to compensate for this
difference. The DS18B20 has been tested on the aquaponics
setup, measuring the temperature of the water in the span of
six hours; the same time the ISFETs were tested. Results in
Fig. 16 show that in an outdoor setup, the temperature of the
water continuously increases up to a peak of 26.31 degrees
celsius at 4:30 pm.

Fig. 12. pH Sensor Comparison

Fig. 13. ISFET #2 Calibration Graph Fig. 15. DS18B20 Calibration Results

1385
Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on August 09,2021 at 15:35:27 UTC from IEEE Xplore. Restrictions apply.
Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference (Jeju, Korea, 28-31 October 2018)

Fig. 18. Control Logs as Seen in a Database Viewer

VI. CONCLUSION
An automated aquaponics monitoring and control system
Fig. 16. DS18B20 Actual Testing Results integrated with a network backbone was successfully
implemented. The main system comprises of three
With all of the parametric data obtained from all the components, the sensor node, control node and the network
aforementioned sensors, the Arduino Uno Microprocessor backbone. The sensor node is comprised of the ISFETs, the
compiles all gathered data onto a JSON string format as seen Atlas D.O. Probe and the DS18B20 all connected to an
in Fig. 17. It sends a JSON string to the Raspberry Pi sync Arduino Uno. These sensors gather significant sensor
node every one second interval; completely independent of the parameters, are calibrated, and verified with commercial
baud rate of the individual sensors. Placeholder parameters for sensors and other measuring methods. The control node
electrical conductivity, oxidation-reduction potential, water individually controls the actuators based on the control
flow, and water level are also included to take into information the sync node calculates from the sensor
consideration additional sensors in the future. parameters. The control node consists of peristaltic pumps, a
The actuators were initially tested through manual triggers heater, cooler, aerator, and feeder all connected to an Arduino
from the website. In this case, the corresponding actuator was Uno. The Raspberry Pi sync node holds the entire system by
able to turn on for 10 seconds. Also, the fish feeder executes integrating both sensor and control nodes into a network
one revolution at around 5 seconds, which releases around backbone. Each subsystem was tested and produced desirable
2.3g of fish food per revolution. The peristaltic pumps releases results, ultimately achieving an aquaponics monitoring and
at a rate of 1mL/sec of solutions to the setup assuming that the control system integrated to a network backbone.
tubes are initially filled (around 10 seconds to fill). The system
REFERENCES
flushes at around 1.8 seconds and the grow bed fills up for 5
seconds before the syphon works. Other controls were also [1] S. Martinoia and G. Massobrio, "A behavioral macromodel of
able to function even if an actuator is still executing its the ISFET in SPICE", Sensors and Actuators B: Chemical, vol.
62, no. 3, pp. 182-189, 2000.
instruction. Additionally, based on the water quality
[2] Sallenave, Rossana. “Important Water Quality Parameters in
parameters data from the sensors, the system automatically Aquaponics Systems.” New Mexico State University. 2016.
executes the corresponding actuator. The turning on and off for [3] S. Tawnya, W. A. Patrick. “The Carbonates Controversy in
the actuators is illustrated in the database viewer on Fig. 18. Aquaponics.” [Online]. Available:
In order to ensure that the communication between the https://www.theaquaponicsource.com/blog/the-carbonates-contr
nodes are flawless, the back end Python program prints out the oversy-in-aquaponics/
JSON strings that it receives and sends from and to the nodes. [4] Wen-Yaw Chung et al. “Electronic Tongue System for Remote
Multi-Ion Sensing Using Blind Source Separation and Wireless
Also in this way, it is easier to check for possible errors that
Sensor Network.” 2018.
may arise. [5] N. Vikram, K. Harish, N. M.S., R. Umesh, A. Shetty and A.
Kumar, "Low Cost Home Automation System Using Wi-Fi
Based Wireless Sensor Network Incorporating Internet of
Things(IoT)", 2017 IEEE 7th International Advance Computing
Conference, pp. 174-178, 2017.

Fig. 17. JSON String Format

1386
Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on August 09,2021 at 15:35:27 UTC from IEEE Xplore. Restrictions apply.

You might also like