E-CityFarm: sustainable small-scale food production integrated fish and crop cultivation

E-CityFarm is an electronic system that can control the parameters needed to grow fish and plants integratedly. It can control temperature, water acidity, and utilizing the neural network method able to count the number and length of fishes also their weight. The weight will be directly proportional to the need for feed. In E-CityFarm, various variables are processed by multitasking, therefore real time operating system (RTOS) is used. RTOS has several advantages in terms of: concurrency, pre-emption, capacity, flash size, synchronization tools, third party software, and convenience. RTOS is real time where in the execution process it will work in parallel for all existing processes according to the time specified. E-CityFarm implements RTOS to improve and maintain the quality of system measurement accuracy, which is expected to help users maintain product quality. In several experiments, the measurement results still have deviations compared to conventional measurements, deviations in measurements for: temperature 0.46%, light intensity 1.935%, 4.93% (3 levels) and weight control 1.995% (98.005% accuracy). Within 14 months the growth of fish and plants seemed to be very controlled, fish and plants grew well, thus E-CityFarm is a feasible system to be developed in areas that have limited land and water.


INTRODUCTION
In this increasingly modern era, the need for land for fisheries and agriculture is increasingly limited. The limited land available is not balanced with the food needs of the people in Indonesia. In addition, the higher level of human mobilization also demands convenience in agriculture and fisheries so that it can be controlled remotely. Therefore, innovation is needed as a solution to these problems. E-CityFarm is a technology that combines fishing and agriculture into one integrated system and performs maintenance in the form of control and observation by utilizing an electronic system. E-CityFarm, known as the integration of hydroponics with electronically controlled fish farming based on wireless sensor network (WSN), considered as an integrated food production system [1]- [7].
In this research, E-CityFarm will be developed which is an integration of our 4 previous research, which is expected to overcome the above problems. E-CityFarm is an attractive system which is a combination of aquaculture and hydroponics that can recycle nutrients using a small amount of recycled water to enable integrated growth of fish and plants, this system requires effective and simple technical intervention. The E-CityFarm system ensures oxygen content in the water and removes toxic ammonia produced by fish waste which is broken down into nitrates and nitrites by natural processes and used by plants as a source of nutrients. Connecting hydroponics and aquaculture will bring closer to natural systems in plant and fish cultivation, thus, the two systems complement each other perfectly. Compared to conventional cultivation on land, there are several advantages of aquaponics, including no need for fertilizers and pesticides, very efficient use of water, can be done on non-agricultural land, produces two products at once, namely plants and fish. From contaminants, chemical and biological, efficient work and can be made by people of all ages. The aquaponics system must also have a biofilter and aerator. The biofilter is where the nitrifying bacteria convert the ammonia produced by fish waste into nitrate that can be used by plants, while the aerator functions to increase the dissolved oxygen level in the water which is beneficial for fish and plants. Aquaponic systems have the advantages of zero waste, no chemicals, saving water, and reduced pests [6], [8].
In the first generation of the E-CityFarm system, there were already variables monitoring climate conditions in the aquaponics ecosystem, such as: air, temperature, water acidity, and light intensity. The system also has an automatic control system, namely controlling light intensity, controlling fish salt, and controlling fish feed. This control system will adjust the state of the E-CityFarm ecosystem to optimal conditions for the needs of plants and fish so that they can grow well. The many features possessed by E-CityFarm create room for development and improvement, especially in the network architecture, where the development of the E-CityFarm 2 nd generation E-CityFarm system is integrated using a WSN and transmitted to smartphones using a wifi network, and the 3 rd development of E-CityFarm modul is the innovation of applying artificial intelligence (AI) to automatic fish feeding systems by utilizing the neural network method to determine the number, length and weight of fish and the amount of food they need. The 3 rd E-CityFarm modul has the ability to communicate between sensors with WSN and the ability to feed and identify fish accurately with AI. WSN technology is an integrated system consisting of a group of distributed sensor nodes/modules connected to a network topology. The WSNs' technology is used for environmental monitoring and theft detection, simple, cheap, and easy to use the system detect the data of temperature and humidity in the air covered on the greenhouse properly [9]. Real time operating system (RTOS) is a new breakthrough for running multitasking processes on embedded systems. An ideal closed aquaponic system should include some automated control preparation of nutrient solutions for both plantations and fishes, including reuse of the drain solution with replenishment of water and fertilizers in proper ratios based on real-time measurement of various nutrient concentrations in the drain solution. The electrical conductivity based systems RTOS commonly used for managing hydroponic nutrients in closed systems do not allow individual corrections to each nutrient deficient for crop growth, of course, the role of RTOS becomes dominant to regulate the nodes connected to the sensor [10]- [12].
In this 4 th research carried out is the application of a RTOS to facilitate system multitasking capabilities. An RTOS is a piece of code (usually called the kernel) that controls task allocation when the microcontroller is operating in a multi-tasking. RTOS is a new innovation for running the multitasking process on an embedded system. RTOS applies the real time principle where the system concept in the process of executing orders will work on all existing processes according to a predetermined time so that no process is carried out beyond the predetermined time limit. RTOS runs tasks in a regular pattern. This system is not like the operating system in general, the operating system used for computers. The general concept of the operating system on the computer running for a moment when the computer receives power, then the computer program runs. When the system starts, the kernel will first turn on and then run the RTOS. The main task of RTOS is to manage existing resources, including processors, memory/registers, and access rights to these two resources. In addition, RTOS is in charge of communication and synchronization. In addition to running using the RTOS kernel, it can consist of a combination of several modules, such as the kernel, file system, networking protocol stack, and other components. In this 4 th research, it is a combination of the previous 3 modules, to make the E-CityFarm system a complete one [13].

RESEARCH METHOD
The following are the basic principles of smart E-CityFarm using internet of things (IoT). There are several sensors used, such as temperature sensors, light intensity sensors, and cameras. The data from all these sensors can be processed by an internet-based microcontroller unit such as the Raspberry Pi, and actions can be carried out by controlling the existing relay module to turn on the pump as shown in Figure 1.
For the model based on the more complex WSN with RTOS, shown in Figure 2, the overall design of E-CityFarm includes four important elements that are integrated with each other. These elements are input circuit, control circuit, output circuit and integrated software program. This circuit consists of electronic components, the form of input or output of these electronic components is needed to operate the microcontroller [14].
This is needed so that the microcontroller can manage and control all tool performance, all measurement data made by the sensor will be sent to the database so that it can be accessed by the user. By using E-CityFarm, as long as there is an internet network, users can monitor anytime and from anywhere using a smartphone through an android-based application. The stored data will also always be updated automatically [14], [15]. Figure 2 illustrates E-CityFarm using WSN and RTOS.

RESULTS AND DISCUSSION
In this session, the performance of the system modules will be tested and observed, the results will be compared with conventional measurement methods. Parameters measured are: air and water temperature, water acidity level, light intensity and fish length. From the tables and graphs shown, the measurement results are quite accurate.

Temperature measured
Experiments to collect temperature data on E-CityFarm get 2 data results, namely air and water temperatures. The air temperature is done by comparing the data obtained by the E-CityFarm temperature sensor with a conventional room temperature thermometer when the air temperature is around 32−42 degrees, with the consideration that the temperature range represents the room temperature in general and the thermometer used works on that scale. The measurement results with the sensor are fairly close to conventional thermometers with an average error range of approximately 0.18 degrees or 0.46% of the 14 data taken. The data can be seen in Figure 3. While the water temperature measurement experiment has an average error range of 0.55 degrees or 1.5% of 14 data. By testing the same way as testing the air temperature, which is to do a comparison with a conventional thermometer. The test data can be studied from the graph in Figure 4.

Acidity measured
Testing of the water power of hydrogen (pH) sensor is carried out by measuring the acidity level of the water using a sensor and comparing it with conventional measurements, namely litmus paper. The test was carried out using 3 different litmus papers. Comparative data with litmus paper sensitive to pH 3 is shown in the graph in Figure 5, then test data at pH 7 (fresh water) can be seen in Figure 6 and as for the test data at pH 10, it can be seen in Figure 7. Based on the data obtained, the acidity meter test on the E-CityFarm has an error of 11% at pH 3, then 2.7% at pH 7 or fresh water, and 1.1% at pH 10 when compared to conventional litmus paper. The light intensity measurement test is carried out by comparing the measurement data using a light dependent resistor (LDR) with another luxmeter. The experimental data can be seen in Table 1. Because if the data is presented using a graph, the lines will be too close together, so that the information is not conveyed properly. From the test results on E-CityFarm for light intensity obtained from 10 test data, it produces measurement results with an average error of 1.935%.

Measure of length and count fishes
Fish monitoring in E-CityFarm is dynamic. Monitoring to determine the length and number of fish is an important parameter that is directly related to the need for feed and their health and the number of deaths. In E-CityFarm monitoring no longer uses conventional methods but uses electronic technology whose speed and accuracy are expected to be better. The use of image processing and processing using Raspberry Pi and the use of the right method will produce parameters according to the original.

Measure of length fishes
Tests on measuring the length and weight of fish have 2 test results, namely the ability of the system to recognize the image of a fish in an image, as well as the length and weight of the fish itself. The ability of the system to recognize fish is summarized in Table 2, where there is a truth table of the system's ability. True positive means the number of accurate predictions made by the system when it states there is a fish image. True negative means the number of accurate predictions made by the system when stating that there is no fish image in the image. False positive means the number of false predictions when stating that there is a fish image in a non-fish image. While false negative is the number of false predictions when stating that there is no fish image in the fish image [16], [17]. Accuracy, precision, and recall values can be calculated from the Table 2. The accuracy value is intended to describe how accurate the system is at recognizing images correctly. In other words, the accuracy value is a comparison between the data that is classified correctly and the whole data. The accuracy value can be obtained by (1) [18]. (1) The system accuracy level is 98.005%. The precision value describes the number of correctly classified positive category data divided by the total data classified as positive. Precision can be obtained by (2).
The system accuracy level is 97.2973%. Meanwhile, the recall shows what percentage of positive category data is correctly classified by the system. The recall value is obtained by (3).
The system recall rate is 98.97%. Meanwhile, testing on the measurement of fish length and weight was carried out by comparing the results of the measurement system with conventional measurements using a tape measure. The test result data can be seen in Table 3. as the system test result data. Table 3 shows the measurement data scanned by the camera on the E-CityFarm. Fish length can generally be converted to fish weight, errors compared to conventional measurements still occur, but are still within reasonable tolerance limits. The weight of the fish is needed to know the amount of feed that must be given, the weight of the fish is directly proportional to the feed requirements of the fish in question.

Count fishes
The results of scanning the number of objects that are counted (fish) are obtained from a series of image processing processes, including: do the blurring process, automatic image thresholding using Otsu method for binarization, and edge detection using canny edge method. The accuracy of E-CityFarm in feeding, greatly affects the health of fish and their growth, but on large-scale fish farms will be difficult to measure, especially without E-CityFarm. For this purpose, in this research, a system consisting of hardware and software has been developed and equipped with IoT to feed fish and measure the length of fish in the feedlot. Using real-time series analysis and algorithm of machine learning for determining later how the fish feeding operation differs from the model. E-CityFarm can send alerts to E-CityFarm owners as needed. In Figure 8 is ilustrated the fish feeding model. when fish are fed, under the camera view (feedlot) the number of fish will increases dramatically just as the fish feed is being fed until it reaches its peak (most number of fish), then slowly decreases as the feed runs out and the degree of fish satiety. Figure 8(b) is a normal (dark gray) and Figure 8(c) black block and dark gray block show abnormal fish behavior nutritional habits. The change from black block to dark gray block indicates a slower feeding effect of fish − they take longer to reach the maximum; from dark gray block to white block, there are fewer fish to eat − some fish do not enter the feeding area to be eaten [19]- [21].
With the E-CityFarm concept, it is hoped can help understand the activities when fish eat the food provided by the feeder in the feed lot and the changes in fish behavior when fed. Parameters in the form of quantity and feeding time can be parameters when creating a program. The data will be stored as a database which will be used later when analyzing and visualizing in the form of statistical data. In E-CityFarm, the electronic components used, including components for pH and temperature sensors, it has been integrated into a system. From the above description, E-CityFarm will be able to meet both the needs of research and integrated agricultural operations on a small scale. Currently, the new Raspberry Pi model has an internal ethernet port, apart from being able to directly connect to the internet via a USB WiFi dongle or by using the built-in WiFi model 3. This capability will make the feeder system an IoT device capable of functioning other sensors, namely monitors and controls real time without using a cable or wireless [22], [23].
Trial the functional of E-CityFarm have been done, several vegetables and strawberries were used, pakcoy can be harvested at the age of 36 days after planting, Figure 9. show vegetables grow well as well as the fish. The characteristics of plants that are fit for harvest are having leaves that thrive and are fresh green TELKOMNIKA Telecommun Comput El Control  E-CityFarm: sustainable small-scale food production integrated … (R. Wahyu Tri Hartono) 1061 in color, the bases of the leaves look healthy, and the height of the plants is uniform and even. Vegetables produced using E-CityFarm system are vegetables that are grown with the help of fluids containing minerals obtained from fish waste which are needed by vegetables to grow. Unlike other vegetables that require soil to grow, vegetables with E-CityFarm only require mineral water with fish waste without additional fertilizer or other nutrients to grow. The water used to grow these vegetables can also be recycled, making the system bring clean air and water for fish. In addition to water and minerals, E-CityFarm plants also need lights, stable pH and temperature, filtration systems for water and air, and climate control devices. All these things are needed to support the growth of E-CityFarm plants.
In the E-CityFarm system, the method and place of planting are strictly maintained and does not require soil and does not need the use of pesticides to protect it from insect pests. With these criteria it can be claimed that the vegetables/fruits produced are organic foods [24], [25]. In addition, the benefits that can be obtained from growing vegetables using the E-CityFarm system: a) Requires less water than conventional planting methods. b) Nutrition, humidity, (pH), and the environment in which it grows can be controlled. c) Vegetables grow faster because more oxygen (from water) is available in the root area. d) More yields. e) Can be planted anywhere, does not require a large area to plant it. f) Does not require cultivation or weeding. g) No need for crop rotation. Several crops, such as lettuce, pakcoy and strawberry have been tried to grow, their growth can be well conditioned to reach a better height for planting, cultivating, and harvesting. Figure 9 shows E-CityFarm can function properly, vegetables grow well as well as the fishes under it. From the experimental results, the harvest period for pakcoy, bokor lettuce is 36 days on average, while strawberries need approximately 52 days from planting to harvest. The characteristics of strawberries that are ready to harvest are the skin of the fruit is dominated by red, reddish green, to reddish yellow. Strawberries are non-climacteric fruit and are harvested when they are old with red fruit characteristics. Figure 9 prove E-CityFarm can function properly, vegetables grow well as well as the koi fishes, therefore E-CityFarm is feasible to be developed for use by people who have limited water and land.

CONCLUSION
Based on the results of measurements and observations, it can be concluded that E-CityFarm is functioning well and is integrated into a unit that is able to monitor and control fish and plant ponds, so that the growth of plants and fish can grow well. In this research, besides having obtained advantages, several weaknesses were also found. Error still occurs in various parameters, there some differences with conventional measurement methods, the error rate in % as: temperatur 0.46%, light intensity 1.935%, acidity of 4.93% (rate for 3 level acidity) and weight control of 1.995%. Within 14 months the growth of fish and plants seemed to be very well controlled, fish and plants grew well. E-CityFarm is a feasible system to be developed in urban areas that have limited land. E-CityFarm besides being able to improve nutrition, it also has the potential to increase family income, therefore E-CityFarm is feasible to be developed for use by people who have limited water and land. It can be said that E-CityFarm is a reliable system that is very important for small scale food production improvement. It is necessary to identify how to link research and marketing with the E-CityFarm pattern. For large-scale production processes, many problems need to be solved, one of them is to clarify the planning for the balance of fish and vegetable production, as well as a plan for pilot production to be increased in the commercial sector.

Eka Pratiwi
was born on June 27, 1999, in Bandung, West Java Province. She graduated from SMAN 1 Cimahi majoring in science in 2017. Then he continued his education in 2017 at the Politeknik Negeri Bandung. Currently she is graduate from D4 Telecommunication Engineering study program. She is also active in the activities of the Telecommunications Engineering Student Association. She can be contacted at email: eka.pratiwi.tcom417@polban.ac.id.

Regina Nur Shabrina
she graduated from the D3 Telecommunication Engineering Study Program, Bandung State Polytechnic, 2020/2021 with the final project title "e-Detect: Deteksi Non-Pengguna Masker Berbasis Pengolahan Citra Menggunakan Metode Convolutional Neural Network", she was selected as an outstanding student with the highest GPA and received an award from the Director of the Bandung State Polytechnic, Currently, she is working as Database and Server Administrator. She can be contacted at email: reginanursh@gmail.com.

Vina Fitriana
she is currently studying at the Bandung State Polytechnic, Telecommunication Engineering Study Program, class of 2018/2019. Currently working on a final project with the title "e-Lock: Sistem Cerdas Untuk Mencegah dan Mengawasi Penggunaan Kendaraan Bermotor Oleh Yang Tidak Berhak Berbasis IoT". She can be contacted at email: vinafitriana12@gmail.com.