International Journal of Trend in Research and Development, Volume 4(3), ISSN: 2394-9333
www.ijtrd.com
IJTRD | May-Jun 2017 Available [email protected] 170
Design of Remote Operating for Smart Fish Farm
Using MQTT 1Prof. Kyoo Jae Shin and 2Muhammad Akbar,
1,2Department of ICT. Creative Design, Busan University of Foreign Studies, Busan, South Korea
Abstract— Internet of Things (IoT) is the new revolution in
the world of industry. It will give tremendous of benefit to the
human activity and continuously growing rapidly along with
the development of internet technology. This paper attempts to
develop a fully automatic control system of a smart fish farm
by using IoT technology with android mobile application. In
this system, we propose to build a smart fish farming system
that can monitor several sensors such as: oxygen level,
temperature, pH, and water level. It also provide a regulation
of the water flow of the aquarium by using Arduino platform
and MQTT communication. The proposed system is a very
powerful to create a natural environment of fish to grow and
life. Moreover, this system has main advantage which is can
minimize the human effort for the fish farming.
Keywords— Internet of Things; Sensors; Arduino Platform;
MQTT Communication; Android Mobile Application
I. INTRODUCTION
Internet of Things is the network of physical objects that contain embedded technology to communicate and sense or interact with their internal states or the external environment and the confluence of efficient wireless protocols, improved sensors, cheaper processors, and a bevy of start-ups [1]. IoT make it possible for computational devices such as sensors and actuators to build an integration and communication each others and working as a single system.
The number of Internet-connected devices surpassed the number of human beings on the planet in 2011, and by 2020, Internet-connected devices are expected to number between 26 billion and 50 billion [2]. According to industry analyst firm, International Data Corporation (IDC), the installed base for the Internet of Things will grow to approximately 212 billion devices by 2020, a number that includes 30 billion connected devices. IDC sees this growth driven largely by intelligent systems that will be installed and collecting data - across both consumer and enterprise applications [3].
By understanding the current development of IoT, this paper propose an autonomous system of fish farm that connected and controlled by IoT technology. With the rapid growth of devices that connected to the internet, IoT will bring a transformation to the society about an efficiency and productivity improvement. Our aim is to reduce the human effort for the fish farm as well as improving the productivity, efficiency, and easiness for growing fish.
Smart fish farming is a new invention in the world. This smart aquarium can perform autonomous control for the water circulation as well as monitoring several important indicator in the aquarium for the fish living such as oxygen level, temperature, pH and water level. Water circulation in fish farming is very important to maintain the purity of water. In this system we use centrifugal pumps and electrical valve that possible to control whether autonomously or remotely from the internet. This electrical valve is specially designed for the flow regulation in the aquarium. As the water flow is the major requirement in this project, it needs an extra care to be taken
for pumping the water to the correct level with appropriate pH level, oxygen content and removing the sludge from the aquarium [4].
In this system, all sensor indicators are possibly monitored from the internet. Here, we also built an android mobile application to display the data. In the controller side, we use an Arduino platform. Arduino will maintain the control of actuators which are in this system pumps and electric valves as well as acquire the sensors data which are water level and temperature. In order to obtain accurate data measurement, this system uses Oxyguard sensor equipment to measure oxygen, pH, and temperature in the aquarium.
Message Queue Telemetry Transport (MQTT) is a messaging protocol that is lightweight enough to be supported by the smallest devices, yet robust enough to ensure that important messages get to their destinations every time. With MQTT devices such as smart energy meters, cars, trains, satellite receivers, and personal health care devices can communicate with each other and with other systems or applications [5]. Here, MQTT will be supported by JSON data format in order to improve efficiency when transferring data from Arduino to the server.
The Data Flow Diagram (DFD) of the system is shown in the figure 1. In this system, devices means sensors, electric valves, and pumps will give data and controlled by Oxyguard and Arduino. Later on, devices will be connected to the broker since MQTT protocol was used in this system. Before connected to the broker, Oxyguard sensor will be connected to the raspberry pi which will pass the sensor data to the broker. In the server side, data from broker will be stored in the database as well as shown in the client.
Fig. 1. Data Flow Diagram of System
The approach to integrate smart fish farming with the concept of IoT will provide user with a convenient way to control and monitor the smart fish farm system. IoT embeds computer intelligence into the smart fish farm which allows user to control and monitor the system from anywhere and anytime.
II. DESIGN OF SMART FISH FARM SYSTEM
The term smart systems is quite general and identifies a
broad class of intelligent and miniaturized devices that are
International Journal of Trend in Research and Development, Volume 4(3), ISSN: 2394-9333
www.ijtrd.com
IJTRD | May-Jun 2017 Available [email protected] 171
usually energy-autonomous and ubiquitously connected. They
incorporate functionalities like sensing, actuation, and
control[6].This fish farm system can be considered as a smart
system because it has capability to automatically collect the
environmental data and send it to the server. The data can be
monitored from the android mobile application. It also has
ability to autonomously regulating the water flow and water
level in the aquarium with respect to water level sensor and
controlled by Arduino microcontroller.
This smart fish farm system is very friendly to the
environment. Here, we use container box as the main frame
material to build the aquarium tank. For the next phase, we
also have plan to use wastage water from the thermal plant to
be used in the system. This wastage water from the thermal
plant exchanges the function of the heat pump in this system.
A. Smart Fish Farm
The design of hardware configuration for smart aquarium
is shown in figure 2. Smart aquarium also called vertical
aquarium because of the aquarium were arranged one over
another. The construction of the smart fish farm consists of
balancing tank, Recirculating Aquaculture Systems (RAS) for
the water filter system, aquarium 1, and aquarium 2 where the
fishes will reside.
(a)
(b)
Fig. 2. Design of Hardware Configuration for Smart Aquarium, (a) 3D View smart Aquarium, (b) Front View smart Aquarium.
In this system, water will flow in a close loop system. From the figure 3 we can see that green line indicates the outflow of the aquarium while red line indicates inflow of the aquarium. Aquarium 1 and aquarium 2 will control two kind of valve which are inflow valve and outflow valve to keep the water circulation and level of water at stable position. Balancing tank will store the warm water which will be distributed to aquarium 1 and aquarium 2. Next, water from aquarium 1 and aquarium 2 will be sent to RAS along with the sludge of the fish. In the RAS, not only sludge will be filtered but it also purify the pH of the water by using biochemical filter. Then, the clean water will flow again to the balancing tank and
continuously looping. The full description of the water circulation can be seen in the figure 3.
Fig. 3. Water Flow Circulation
B. Sensors
1. Oxyguard Sensor Equipment
In order to acquire more accurate data, in this system we
use Oxyguard sensor equipment. Oxyguard is a company from
Denmark which has been supplying water quality measuring
and monitoring equipment to the aquaculture since 1987 [7]. In
the figure 4(a), shows Dissolved Oxygen (DO) and
temperature sensor. From that probe we can measure and
acquire DO and temperature data in the aquarium. That probe
is a membrane which covered galvanic cell that generates an
electrical signal proportional to the oxygen pressure it senses,
no matter whether it is in water, gas, wine, oil, or something
else [8]. Figure 4(b) shows pH sensor that has capability
working normally in the temperature up to 60°C. All the sensor
probe were connected to the Oxyguard pacific panel which
shown in the figure 4(c). It provide data sharing to the internet
by using ajax data interface. This panel also has capability to
manage up to 6 sensor at a time, meanwhile if we need to use
more than 6 sensors we have option to expand the panel using
Oxyguard pacific probe which shown in the figure 4(d).
(a)
(b)
(c)
(d)
Fig. 4. Oxyguard Sensor Equipment, (a) Dissolved Oxygen (DO) and
Temperature Probe, (b) pH Probe, (c) Oxyguard Pacific Panel, (d) Oxyguard
Pacific Probe.
2. Water Level Sensor
Water level sensor is needed to control the water level in
each aquarium tank. This sensor is very important to our
system since we will continuously circulating the water. By
using water level sensor, we can avoid some danger cases in
our autonomous system such as overflow as well as lack of
water in the aquarium. Here, we use sonar sensor which will
measure water level data in the real time based on the distance
from the ceiling of the aquarium to the surface of the water.
The sensor shown in the figure 5.
International Journal of Trend in Research and Development, Volume 4(3), ISSN: 2394-9333
www.ijtrd.com
IJTRD | May-Jun 2017 Available [email protected] 172
(3)
(2)
(1)
Fig. 5. XL-MaxSonar-WR MB7062.
3. Actuators
Electrical valve was specially designed for this system.
Electrical valve consists of DC motor for driving the valve and
potentiometer, this is major components in the electrical valve
and the next important component is potentiometer it measures
the angle and sends feedback to the micro-controller [9].
Electrical valve is shown in figure 6(a). In the figure 6(b),
centrifugal pump is used to support water circulation in the
system. This pump was pre-programmed in the Arduino to
automatically working if the valve is widely open, otherwise
this pump will automatically off if the valve is fully close.
(a)
(b)
Fig. 6. Actuators, (a) Electrical Valve, (b) Centrifugal Pump.
III. DEVELOPMENT OF REMOTE OPERATING ALGORITHM
FOR SMART FISH FARM
In order to perform an autonomous system, in this study we use Arduino microcontroller. Arduino is an open source physical computing platform based on a simple input/output (I/O) board and a development environment that implements the Processing language. Arduino provide development software tools called Arduino IDE (Integrated Development Environment), which is used to write and upload the computer code to the physical board [10]. Here, Arduino will be equipped with JSN270 shield for the wifi communication.
Arduino will control several components in the aquarium fish farm system such as electric valves and pumps to control the level of the water in the aquarium with respect to water level sensor, control heat pump operation to maintain the temperature stable at 30°C, and control the air pump operation to maintain the oxygen level not less than 6 mg/L.
A. Water Level Control
Fig. 7. Water Level Control Block Diagram.
The main sensor to control the water level of aquarium is sonar sensor as shown in Figure 5. It sends out a high frequency sound pulse that will hit anything in front of it for then the sound pulse will reflect back to the sensor. As the speed of sound is 343 meter per second, the distance between the object can be calculated as :
Distance = (Speed of Sound X Time) / 2
The distance between the ceiling of the aquarium and the bottom is 100 cm. Here, we want to keep the water level stable at the minimum is 20 cm and maximum is 60 cm in the aquarium. Aquarium 1 and aquarium 2 are controlling inflow and outflow valve as shown in the figure 8.
Fig. 8. Sensors and Flow Control System.
Electric valve is equipped with potentiometer as a feedback for angle sensor. After calibrating the valve, we know that the operating angle of valve is between 0 to 300 out of 1023. It means at 0 position, valve is fully close while at 300 position, valve is fully open. By knowing this factor, then we can formulate the calculation of the valve angle control respected to water level as :
m =𝑦2 − 𝑦1
𝑥2 − 𝑥1
y − 𝑦1 = m (x − 𝑥1)
where y is the angle value and x is the water level value.
B. Oxygen Level and Temperature Control
(a)
(b)
Fig. 9. Flowchart, (a) Oxygen Control, (b) Temperature Control.
Keep the DO in a require level is needed in the fish farm
system. Low level of DO can impact to the fish life and its
reproduction. Here, we want to keep the DO level not less than
International Journal of Trend in Research and Development, Volume 4(3), ISSN: 2394-9333
www.ijtrd.com
IJTRD | May-Jun 2017 Available [email protected] 173
6 mg/L. Arduino is connected to the air pump. If the DO level
is less than 6 mg/L, Arduino will turn on the air pump until the
require level of DO is reached. The flowchart of the oxygen
control is shown in the figure 9(a).
Normally, balancing tank is a source of water tank. Here,
water is stored and heating to 30°C before it deliver to
aquarium 1 and aquarium 2. In the process after several time of
circulation, the temperature will decrease because of several
factor. To keep the water stable at around 30°C which means it
is a comfortable temperature for the fish living, we control the
heat pump from the Arduino. In figure 9(b), heat pump will
turn into on if the temperature is below 27°C. Otherwise, heat
pump will off if the require temperature of the aquarium is
reached.
IV. MONITORING AND CONTROL OF SYSTEM USING MQTT
MQTT is a machine-to-machine (M2M) / Internet of
Things connectivity protocol. It was designed as an extremely
lightweight publish/subscribe messaging transport. It is useful
for connections with remote locations where a small code
footprint is required and/or network bandwidth is at a premium.
[11].
The main entity in the MQTT protocol is broker. This
communication is similar with client-server communication.
Broker as server officially in charge as router to pass
information using publish-subscribe format. In the broker is
pre-registered of several topic to classify the destination of the
information. In this system, every sensor data will be published
under this topic address. Here we use "topic/Arduino/pub" to
publish the data from Arduino to the server and
"topic/Arduino/sub" to subscribe every data of sensor and
command which come from the client to be executed in
Arduino.
Fig. 10. MQTT publish-subscribe architecture
Full description of MQTT subscribe – publish architecture
can be seen in the figure 10. Arduino is fully control of valve,
pump, air pump, and heat pump. When the valve is rotating,
potentiometer measure the error angle as the angle sensor. If
the error is zero that means the valve is already in the proper
position. Otherwise, the valve is keep rotating whether it
moving to close direction or open direction.
This valve is possible to control automatically or remotely
from the android application. Arduino will listen everytime
and ready to subscribe the command from the client. Along
with controlling function, Arduino also send the water level
data and angle data to the server. When another device such as
oxyguard will send oxygen, temperature and pH data to the
server. Later on, this data will pass to publish into android
application.
A. JSON Data Format
Smart fish farm system needs to send many data of sensors to the server as well as listening command from the client to Arduino. To increase the efficiency in transferring the data, this system used JSON for data representation and exchange. JSON stands for JavaScript Object Notation. It's an open standard to represent data as attributes with values. It is now widely used for data serialization and transport in many standalone and web applications. JSON provides an ideal means to encapsulate data between the client and server.[12].
The approach in this system, we need to use several sensors that constaint to make natural environment of fish to life and grow. Those sensors data were read by using whether Arduino or Oxyguard and need to be transmitted to the server. The current implementation of JSON in the system is given as the following :
{“ID”:“AQ01IN” , ”US”:45.5, ”ANGLE”:50}
{“ID”:“AQ01OU” , ”US”:45.5, ”ANGLE”:50}
{“ID”:“AQ02IN” , ”US”:45.5, ”ANGLE”:50}
{“ID”:“AQ01OU” , ”US”:45.5, ”ANGLE”:50}
These data are sent from Arduino to the broker to topic address "topic/Arduino/pub". This data will be sent into one package to the broker. “AQ01IN” means that data was sent from aquarium 1 inflow and “AQ01OU” means that data was sent from aquarium 1 outflow. Every entity comes with water level data which is in this case labelled as “US” and valve angle data which is in this case labelled as “ANGLE”.
Arduino also always listen command from the client. The command will be transmitted to Arduino by using JSON format that is represented by entity or id of destination valve, angle command, and Arduino mode. In this system, we need to change the mode of the system if we want to perform remote mode from the client which is represented by “M” for manual mode from client and “A” for autonomously fully controlled by Arduino. We can see the current implementation as follows:
{“ID”:”AQ02IN”, “ANGLE”:35, “MODE”:”M”}
B. Android Mobile Application
Android is one of the most famous Operating System (OS)
for smartphone. Besides this OS is open-source, Android also
has support from Google which is the most reputed IT
company currently. The smart fish farm system is targeted to
working in the android mobile application for monitoring and
controlling purposes. As described in the figure 10, android
application received data from broker. This data comes from
Oxyguard sensor data and Arduino sensor measurement. Later
on, this data will display on the screen. All data sends and
packages by JSON format and transfer using MQTT protocol. V. EXPERIMENTAL RESULTS
A. Monitoring Sensor Data
Android mobile application was specially developed to
support smart fish farm system. This mobile application is
capable to monitor all sensor data in the smart fish farm system.
As shown in the figure 11, all sensor data were successfully
displayed on the screen. All aquarium tank on the system has
different sensor parameter. For aquarium 1 and aquarium 2 the
sensor is temperature, pH, DO, and water level. For the
balancing tank and RAS are the same sensor but without pH
sensor. We also can track the valve angle position of every
aquarium tank which are include inflow valve and outflow
valve.
International Journal of Trend in Research and Development, Volume 4(3), ISSN: 2394-9333
www.ijtrd.com
IJTRD | May-Jun 2017 Available [email protected] 174
(a) (b)
(c) (d) Fig. 11. Android Mobile Monitoring Sensor Data, (a) Aquarium 1, (b)
Aquarium 2, (c) Balancing Tank, (d) RAS.
B. Autonomous Valve Flow Control
In order to support an autonomous control, this system has
to develop ability to balancing the flow between the inflow and
outflow of the aquarium tank. This is needed to avoid overflow
of the water as well as lack of water in the aquarium. In the
figure 12 is shown the experimental result of the autonomous
flow control. The system is capable to control equally between
inflow and outflow of the valve in the constant position.
(a)
(b) Fig. 12. Autonomous Flow Control, (a) Back-side Aquarium 2 Inflow, (b)
Front-side Aquarium 2 Outflow.
C. Remote Control of Valve Flow Control
To perform the remote control of the fish farm system, we
need to change the mode of the application from the mobile.
Figure 13 describes the remote control of the system in the
balancing tank. Here, the water will flow from the RAS tank to
the balancing tank. Valve angle is adjustable from 0 to 90
degree. In the figure 13(a), shows the state of the in valve on 2
degree which means this valve is in close position. On the top
right of the picture, we can see the mode of the system already
changed into remote control mode. By using “+” and “-”
button, we can adjust the valve angle as we desire. Next, we
can tap the “OK” button to send the command of the valve
angle to the Arduino.
Before the command is transmitted into Arduino, there will
be alert information appears in the screen as shown in the
figure 13(b). This alert shows in order to ensure the user about
the valve command. If the command is correct, user can
approve by choosing “Yes” button. Next, Arduino will give
feedback to the server about current valve angle position. The
final position of the valve can be seen in the figure 13(c). As
we can see, the command was sucessfully executed by
Arduino. The valve position changed into 88 degree which
means the valve is in open position.
(a) (b)
(c)
Fig. 13. Balancing Tank Remote Valve Control, (a) Valve Initial Position, (b)
Alert Information, (c) Valve Final Position.
CONCLUSION
Smart fish farm with IoT technology is a new invention in the world. This system can effectively reduce the human effort for growing and farming fish. Here are the points that we can acquire from the results of this system :
1. Electric valve which has function as a water regulator of this system were very well controlled by the Arduino. Autonomous control of the electric valve was successfully control with respect to water level sensor. The system
International Journal of Trend in Research and Development, Volume 4(3), ISSN: 2394-9333
www.ijtrd.com
IJTRD | May-Jun 2017 Available [email protected] 175
shows equally balance and stable between the inflow water and outflow water as shown in the figure 12.
2. MQTT as a lightweight protocol is very suitable to run in the low memory micro-controller such as Arduino. It shows very good performance and flexible in data exchange although the broker was connected to many entity in the system such as Arduino, Oxyguard sensor, database, and android mobile application.
3. JSON data format successfully enhance the efficiency in data exchange and make it very easy to understand and handling in the program.
4. All sensor data indicator were successfully showed and displayed in the android mobile application. All data such as DO, temperature, pH, water level, and valve angle can be seen in the figure 11.
5. The system is possibly maintain a good environment for the fish living with preserve the temperature of water around 30°C, pH stable not less than 6 and DO not less than 6mg/L.
6. Remote control of the system can be perform by change the mode into remote mode. Command data successfully send from mobile application to Arduino through MQTT protocol. Arduino return feedback to the mobile application as shown in the figure 13.
Acknowledgment
This work supports by the KOREA Ministry of Trade, Industrial and Energy. We established the project, which is industrial verification and design of ICT VAEMS practical models. Also, this work granted to “Busan University of Foreign Studies”.
References
[1] O. Vermesan, P. Friess, “Internet of Things-From Research and Innovation to Market Development,”River Publishers, pp. 8, 2015.
[2] Raymond James & Associates, “ The Internet of Things - A Study in Hype, Reality, Disruption, and Growth”, online at http://sitic.org/wp-content/uploads/The-Internet-of-Things-A-Studyin-Hype-Reality-Disruption-and-Growth.pdf, January 2014..
[3] IDC, “Worldwide Internet of Things 2013–2020 Forecast: Billions of Things, Trillions of Dollars,” Doc #: 243661, October 2013.
[4] K.J. Shin, A.V. Angani, M. Akbar, “Fully Automatic Control System for Smart Vertical Aquarium, ” IEEE International Conference on Applied System Innovation, Sapporo, Japan, pp. 1-4, May 2017.
[5] V. Lampkin, W.T. Leong, L. Olivera, S. Rawat, N. Subrahmanyam, R.Xiang, “Building Smarter Planet Solutions with MQTT and IBM WebSpehere MQ Telemetry, ” IBM Redbooks, pp. ix, USA, September 2012
[6] A. Sassone, M. Grosso, M. Poncino, E. Maaci, “Smart Electronic System : An Overview, ” Smart System Integration and Simulation, Springer International Publishing, pp. 5 – 21, Switzerland, 2016.
[7] Oxyguard About Company, online at http://www.oxyguard.dk/about-us/, accessed May 2017.
[8] Oxyguard Manual, “The Oxyguard Oxygen Probe”, online at http://www.oxyguard.dk/wp-content/uploads/2014/07/D02-Standard-Probe-brochure-gb-06131.pdf, accessed May 2017.
[9] K.J. Shin, A.V. Angani, “Development of Water Control System with Electrical Valve for Smart Aquarium, ”IEEE International Conference on Applied System Innovation, Sapporo, Japan, pp. 1-4, May 2017.
[10] M. Banzi, “Getting Started with Arduino 2nd Edition, ” O’Reilly, pp. 1-3, USA, September 2011.
[11] D. Barata, G. Louzada, A. Carreiro, A. Damasceno, “System of acquisition, transmission, storage and visualization of Pulse Oximeter and ECG data using Android and MQTT, ” HCIST 2013 - International Conference on Health and Social Care Information Systems and Technologies, Elsevier, pp. 1265 – 1272, Portugal, 2013.
[12] R. Rischpater, “JavaScript JSON Cookbook, ” PACKT Publishing, pp. 1-3, Birmingham, UK, June 2015.
Kyoo Jae Shin is a Professor of Intelligence Robot
Science at the Busan University of Foreign Studies
(BUFS), Busan and South Korea. He is the director of Future Creative Science Research Institute at the BUFS.
He had received his B.S. degree in Electronics
Engineering in 1985 and M.S degree in Electrical Engineering from Cheonbuk National University (CNU)
in 1988 and his Ph.D. degree in the Electrical Science
from the Pusan National University (PNU) in 2009. Dr. Shin was a professor of Navy technical education school and a main director
for research associate of Dynamic stabilization system in Dusan defense
weapon research institute. Also, he had researched and developed the following as; fish robot, submarine robot, automatic dug spay robot in glass
room, milking automatic robot using manipulator, personal electrical vehicle,
smart accumulated aquarium using heat pump, solar tracking system, 3D hologram system and gun/turret stabilization system. He has interested in
intelligence robot, image signal processing application system and smart farm
and aquarium using new energy and IoT technology.
Muhammad Akbaris a Master student of Professor Kyoo Jae Shin of ICT Creative design at the Busan
University of Foreign Studies (BUFS), Busan, South
Korea. He had received his bachelor degree in Informatics Engineering in 2014 from Universitas
Islam Negeri (UIN) Syarif Hidayatullah, Jakarta,
Indonesia and he is pursuing his Master’s degree in the Embedded and Automation control from the Busan
University of Foreign Studies (BUFS), Busan, South Korea. He is researching
on ICT Vertical Aquarium Fish Farm, fish robot and 3D hologram. He has interested in embedded system, software development, image signal
processing application system, intelligence robot and space technology.