Design and implementation of smart farming system for fig using connected-argonomics

Received Jan 11, 2019 Revised Jul 23, 2019 Accepted Jul 30, 2019 This paper proposes a design and implementation approach of smart farming system using connected-agronomics technique for fig farm application. Nowadays, fig plants having a rapid growth in the current market demand due to its rich in natural health benefiting nutrients, antioxidants and vitamins where some farming systems have been used in maintaining fig plant’s environmental resources to grow without fail. Smart farming is a system applied to provide user with real time information and plan for desired plant such as time intervals for watering systems. There are two major problems on maintaining the fig fruit quality; watering system fail during emergency blackout and a contagious disease known as leaf rust due to external environments. The system implements two microcontrollers, the Arduino Uno & Raspberry Pi along with smartphone Android application. The system performance is evaluated based on the requirement specification, irrigation soil, surrounding temperature and moisture. It is found that all data collected by the sensors are within the optimal range of values, which are 1500 μS/cm to 1599 μS/cm for the EC reading of the fertilizer while 6.0 to 6.5 for the pH value of the soil. This prototype of smart farming was well developed and can be applied to the fig plantation environment.


INTRODUCTION
Fig fruit is a special fruit as it is nutritious as well as an important role for good health. The common fig is one of the members of the genus Ficus, in the mulberry family [1]. Figs can grow in any tropicalclimate area; happens in the countries that lie on the Equator of Earth. The height of fig trees can reach up until 7-10 cm, thus farmers need to have a good scheduling system in order to take care of them. This is because fig trees are very sensitive to their external factor of environment such as water, temperature, humidity and many more. In fact, a fig tree contains latex may affect human body such as skin irritation.
Traditionally, figs are grown in the Mediterranean region such as Turkey, Iran and Egypt as well as other countries such as Portugal, Spain and Greece. According to [2] fig has now been commercialized and developed in the USA, Argentina, and Australia. In recent years, the fig has been cultivated in tropical regions including South East Asia countries Malaysia, Thailand and Indonesia. The figs tree was first cultivated in Malaysia and received good feedbacks as the tree need both sunlight and warm temperatures as well as suitable to be planted in the tropic region. Fig is known for its good quality production of the fruits that is very high in vitamins and minerals. Thus, the price for a kilogram of figs can be reached until RM 200. Based on these facts, the figs have a huge potential to be marketed commercially and provide an opportunity for farmers to gain profits. In Malaysia, recent development of fig farms is increasing rapidly as the country blessed with proper weather environment that the fig needs. High nutrient fig fruit can be obtained using proper maintenance as the tree is very sensitive to environment. According to precision agriculture [3], a plant needs watering system that is commensurate with the growth stage and includes a variety of parameters including soil moisture, surrounding temperature and sunlight. However, there is a need for smart agriculture approach, as 70% of a farming time is wasted just for monitoring and managing which is not the actual need for field work [4]. The aim of this research project has therefore been to try and establish an intelligent system that uses Raspberry Pi and Arduino Uno as a smart farm system. This project seeks to obtain data which will help to address fig farmer's issues. The development of an automated system is designed based on several specification of figs plant itself. Overall system is equipped with several types of sensors which are mainly to deliver a controlling tasks towards important factors which contribute for figs fruit grows quality. Besides, the automated system also will perform its controlling functionality for irrigation system; drip irrigation type. Microcontrollers have been used to control suitable data transmission and command to control all of specific functions.

LOCAL FIG FARMER CHALLENGES
According to [5], agriculture is an art and science of growing plants mainly for foods, human needs as well as for economic gain. Sensitivity to the external factor of environment is the most common issue for fig trees maintenance which is need for continuous effort and commitment. Like most plants, fig tree needs to have effective routine schedules of watering system. Plants use much more water if compared to humas or animals as they are consisting of 90% of water [6]. year. An ineffective watering session system can contribute to leaves patches of rust which can be observed periodically as shown Figure 1. This forms may affect the growth of the tree and its fruit production which contribute to low quality fruit in term of sweetness, size and others. The other issue that fig farmer needs consider is the soil pH value of the plant. Traditional method of soil custody, pest attack, diseases and soil fatigue have been contributed to irregular soil pH value [8]. Ideal soil pH required by most plants are 6.0 to 6.5 for better phosphorus absorpsion as to promote root growth [9]. An effective way to supply the water and nutriens to plants is by using soluble nutrients solution that mixed together with water via automatic irrigation system; fertigation method [10]. One of the factors that affect the pH value of the soil is the level of dryness of the surrounding environment. The ideal surrounding temperature for growing figs is suggested at 20 ℃ -45 ℃ [11]. Generally, the watering system plays the important role to control the pH value of the soil by allowing the soil of the trees to be watered and fertilized. Thus, the pH value of the soil can be maintained indirectly and the pH value of the soil is being monitored once in a week.
Fig tree also needs to have effective and precise fertilizer scheduling routine, as fertilizer is the important source of producing good quality of figs. Figs are naturally slow growing trees, with excessive fertilizer can cause growth spurs that will cause in trunks and branches splits and cracks [12]. The basic  [13]. The existing watering and fertilizer system uses an approach that is called the drip irrigation system. Farmers are using it as an artificial technology to ease the work load to flow the water or fertilizers to the tree [14] commercially. In fact, this system is widely being used in most fig farms as comparing to the sprinkler irrigation system; drip irrigation system has the efficiency of 87% to 95% of flowing water or fertilizers to the trees [15]. Understanding this data through analysis and agronomics is the key for success in seeking the opportunities in the connected fig farm. As technology grows in agricultural fields, it is crutial to figure out how these agronomic puzzles can develop knowledge as well as the understanding of each acre in each field. Combinations of technology and agronomy understanding can ensure success in adopting these aspects on fig farm.

PROJECT METHODOLOGY
A case-study approach was adopted to conduct this exploratory project. The methodology used in this project is the System Development Life Cycle Model (SDLC). The phases involved in the SDLC are; system planning, system requirements analysis, system design, coding and testing of the system. Figure 2 shows the SDLC phases.

Project requirements
The development of this fig smart farming system is designed based on specific specifications and requirements. Through this system, there are sensors which are being used and connected to the main controller system. This system development requires the use of two modern microcontrollers which are Raspberry Pi 3 and Arduino Uno. Each microcontroller has its own function in order to build this smart farming system. Raspberry Pi acts as the main controller that is connected to the sensors while the Arduino Uno function is to be the controlling system for drip irrigation system. Hence, this system will be more efficient and systematic as today there are a lot of technologies that use the micro system controller [16]. The block diagram on the flow of this system being installed is shown as in Figure 3.

Controllers system
The main controlling system which is the Raspberry Pi 3 needs to be installed with required sensors. In this project, the sensors for this system have the functions to control the external environment parameters such as fertilizers and pH value of the soil. The sensors used in this project are the pH Sensor Kit and Electrical Conductivity (EC) Sensor Kit. Both sensors are selected because both of them have the specifications that meet the process requirement and compatible with the Raspberry Pi 3. The specifications of these sensors are as in Table 1 and Table 2.

Data storage and monitoring
The data readings from the sensor are then stored in a web server application, phpMyAdmin by setting up the contents. The value from the sensors will be read by the Arduino Uno controlling system. One of the functions of using the phpMyAdmin web server is to control the value of the readings obtained so that the readings always within the range of the optimal value set. For EC reading of the fertilizer used, the optimal reading that needs to be maintained is in between 1500 µS/cm to 1599 µS/cm. Thus, whenever the readings obtained by the EC Sensor are beyond or less then the set optimal value, the Arduino Uno controlling system will not start functioning. In the other hand, the pH values of the soil obtained by pH Sensor indicates that the soil of the plants are in a good condition.
The EC sensor and pH sensor readings were used as the monitoring system to provide good water system for soil thus delivers healthy fig plant. Hence, the readings obtained by both sensors are shown in Table 3 and Table 4 respectively. The EC sensor will be transferred the digital signal to the Arduino Uno controlling system combined with the existing drip irrigation system. This combination is set up by analysing the hardware used in the drip irrigation system as well as in the Arduino Uno system. The drip irrigation system is recommended to be used because the evaporation rate of flow of water would be much lesser [17].

Power management
The connection between two main controlling systems which are the Raspberry Pi and the Arduino Uno are established using Python codes that contributed to signal transmitted between the microcontrollers connected with the USB cable. Then, 5 V relay module is used to trigger fertilizer irrigation operated from the tank to the soil. This can be done by setting up the relay using programming codes set in the Arduino Uno software system.
The main purpose of using the relay is to connect it to the 12 V solenoid valve as these are some electronic components operated for the drip irrigation system. Besides, in most farming system, the solenoid valve is commonly used to flow the fertilizers or water from the tank to the soil of the plants [18]. Furthermore, this drip irrigation system is using a 12 V water pump motor to provide enough pressure for the fertilizers to flow in this designed watering system.

Smartphone application
Recently, many researchers developed an Android application smartphone to communicate with microcontroller using several Integrated Development Environment (IDE). The most popular is the Eclipse IDE. However, Eclipse IDE usage began to shrink at the end of 2015. The Android Studio is currently the most popular IDE for Android development as it provides the latest JAVA programming tools to build applications, and providing a simple way of data injection on custom type of Android Application Programming Interface (API) [19] and produce the best quality app with no cost. In this system Android application was built to monitor the fig plant's condition. This app will display data visualization of the parameters of the plant as well.

Analysis and evaluation
Validation and verification process of the project meets the requirements and the specifications that decided earlier. Several testing mechanisms have been applied, which are the Requirement Verification and Performance Testing. a) Requirement Verification: The objective is to ensure that the smart farming system conforms to its original specifications as a connected-agronomics approach. b) Performance Testing: This is to ensure the system is durable, reliable and does not experience any related issues that is affecting the fig plant.

RESULTS AND DISCUSSION
The prototype of this project is as shown in Figure 5. Both Raspberry Pi 3 and Arduino Uno controlling system were integrated so that the whole project can be performed well. The SDLC steps are followed as in the Methodology part results in both microcontrollers controlling system become more efficient, systematic and strategic.
The sensors keep collecting data whenever this prototype is being turn on, so that its effectiveness rate also can be measured and tested. Table 3 and Table 4 show the actual reading of pH value of the soil and the EC reading of the fertilizer as in the phpMyAdmin web server application.

Sensors measurement results
There is one analysis done in this project to determine the effect of surrounding temperature to the fertilizer. The fertilizer used in this project is being kept in two different places which is a place with room temperature and in a cold room with a temperature of 4°C. The result of this experiment shows that the temperature of surrounding affects the quality of the fertilizer in the form of EC reading. As in Figure 6, by referring to the data collected from Table 5, there is a slight increment when employing the fertilizer in the cold room. Meanwhile, the fertilizer that is being kept in a place with a room temperature shows a decreasing value of EC reading after four weeks of experiment.
These explain that the fertilizer that is being used in a  The parameters needed by the fig trees are also controlled and the monitoring process operated continuously to improve the effectiveness of the whole system. Indeed, the data collected by the sensors are within the optimal range of values, which are 1500 µS/cm to 1599 µS/cm for the EC reading of the fertilizer while 6.0 to 6.5 for the pH value of the soil. Connected-multi-microcontroller based automated irrigation system for optimize watering application and fertilizer use for agricultural purpose compare with existing traditional irrigation system [15][16][17]. The system consists of distributed connected sensor network of soil moisture, and temperature sensors placed in the crop field with wireless connected multi-microcontroller bring high efficient data transmission handling in order to implement in real time environment application [20]. To handle the sensor information, network and Restful API protocol have been used and control the water quantity programming using an algorithm with threshold values of the sensors to a microcontroller for irrigation system. The system has been powered by several 12 V battery and wireless internet interface for data inspection. The system is low cost and energy autonomy useful in water limited geographically isolated areas [14].

Data visualizations and notifications
The Android application of smart farming system consists of three parts. The first part will displays the indoor temperature and humidity readings as well. The second part will displays the outdoor temperature and humidity readings while the third part will displays the soil moisture. The data reading on the app interface will change every two minutes according to the readings from the sensor. Data display on Android applications will be accepted if the smartphone is connected to the same WiFi network, which is the Raspberry Pi 3, connected. Figure 7 shows the interface of the Android application used in this project.
The e-mail function on a Raspberry Pi can be established which SMTP library must be downloaded and needed to be configured. Gmail account to be opened for the purpose of email delivery however Raspberry Pi 3 can only send e-mail to recipients to those who have Gmail account only. Apart from Gmail account, other mailing accounts cannot be used. In this system, the e-mail notification will alerts the users. If the reading of the surrounding temperature and humidity of the environment is higher than the threshold value, the Raspberry Pi will send e-mail as shown in Figure 7 to consumers as an alert. This notification system providing a trigger to the user for fig plant status awareness. Additionally, if the sensors malfunctioned and failed to send data to the database, it also will be warned and notified by the email delivery of which sensor that is fail to function.

CONCLUSION
A prototype of smart farming system based on agronomics approach has been applied that significantly achieved the project requirements and specifications. By incorporating microcontroller as dual control system and database as data storage for data visualizations and notifications, both controlling system become more efficient, systematic and strategic. This system development requires the use of two modern microcontrollers that are Raspberry Pi 3 and Arduino Uno. Each microcontroller has its specific functions builds in this smart farming system. The parameters needed by the fig trees are effectively controlled and the monitoring process operated continuously to improve the effectiveness of the whole system. In fact, the data collected by the sensors are within the optimal range of values, which are 1500 µS/cm to 1599 µS/cm for the EC reading of the fertilizer while 6.0 to 6.5 for the pH value of the soil. This prototype was well developed that can be implemented and applied to the fig plantation environment. The system consists of distributed connected sensor network of soil moisture, and temperature sensors placed in the crop field with wireless connected capability of multi-microcontroller, in turn will provide high efficient data transmission and handling to be implement in real time environment application. The system is low cost and energy autonomy, which is useful in water limited geographically isolated areas.