Adafruit IO Based Smart Irrigation System using MQTT Protocol for Urban Farming

Corresponding Author: Devesh Mishra Department of Electronics and Communication, Faculty of Science, University of Allahabad, Prayagraj-211002 Uttar Pradesh, India Email: deveshbbs@gmail.com Abstract: Freshwater is needed for irrigation and nutrient supply to plants to make up for the lack of rainfall. Agricultural activities consume more than 70% of the available freshwater. This emphasizes the importance of responsible management of water for irrigation using smart Internet of Things (IoT) based agricultural practices combined with irrigation-related technologies The purpose of this research article is to integrate Internet of Things (IoT) soil profile data to help you make the best watering decisions. In the proposed setup we have presented an IoT-based model for optimizing the water resource on a demand basis, especially for the areas where water is a scarce commodity that can be monitored remotely by the user node. This smart management helps to dynamically allocate the resource utilization hence helping us to attain resource optimization. Motivated by this concern this study focuses on a smart soil moisture monitoring system by remote sensing the moisture level of the target patch. The advanced soil profile monitoring-based remote sensing unit is installed which explores the Internet of Things (IoT) network.


Introduction
The Internet of Things (IoT) paradigm depicts a continuous technological growth path via which every device or environment that we encounter in our daily lives can be connected. Administrations are increasingly widespread, capillary, interconnected, and accessible. Encounters are tailored to our preferences and certain (but not unusual) requirements. The attribute 'smart' is presently habitually related to assorted application fields of science and innovation, bringing about recognizable watchwords like Smart Cities, Homes, Objects, and so forth (Srivastava and Khan, 2018).

Motivation and Contribution
Related work covering the aspects of sensor networks for data acquisition has been dealt with in a few works of literature. Deployment of sensor networks particularly for soil moisture monitoring has been discussed by few researchers in the recent past. The work of (Srivastava et al., 2009) investigates soil moisture levels for a vast area using RADAR application and analyzed the system for several cases. However, the RADAR poses a limitation of its application in certain cases. Furthermore, the system in (Zhang et al., 2020) has elaborated on soil moisture study using radar and optical sensing. As the authors (Sun et al., 2011) have explored the design for deployment of underground sensor network model. With the advent of IoT lots of research work is been carried out in this direction. The researchers (Farooq et al., 2019;Ayaz et al., 2019;García et al., 2020;Li et al., 2020;Kour and Arora, 2020) have presented an extensive survey on IoT-based smart monitoring and farming and discussed its applications and limitations. The conventional communication operation of a monitoring system using Bluetooth/Zigbee has a limitation of the limited range of operation at the same time power consumption of the

Literature Survey
Using the EH mechanism the wireless devices with low power specifications can be easily operated. The replacement and maintenance of capacity-constrained power sources put limitations on usage in hostile situations including inaccessible geographical locations, military applications, and high-altitude monitoring systems. The sensed data is communicated over Ad-hoc protocol using fixed or relay nodes via drone Unmanned Aerial Vehicle (UAV) by a smart monitoring system (Baseca et al., 2013). This is most widely investigated in recent years for its deployment in precision agriculture (Cambra et al., 2014) applications. The benefits of this technology have been recently explored by many researchers in recent years which are illustrated in the subsequent subsections.

IoT Networking a Boon for the Agronomics Sector
With the advent of the Internet of Things (IoT) networking, the devices get virtually connected across wireless nodes hence, yielding us the information at the remote location. Precision agriculture was evaluated in (Shafi et al., 2019) using WSN. The author developed a smart health monitoring system for plants based on IoT. The emerging concept of IoT, cloud computing, and edge computing has opened several avenues to build a smart monitoring system for gaining access to real-time data from a remote location (Khan et al., 2021). An elaborate study of the various sensors deployed for IoT-based agriculture systems was presented in highlighting the benefits and limitations of each module. To improve the dynamic coverage and improve the detection and monitoring performance by extending the range of evaluation UAV based smart farming was elucidated by (Boursianis et al., 2020) to monitor the plant health and soil condition. A smart detection system for leaf disease diagnostic was developed by the author (Thorat et al., 2017). This detection system enables remote monitoring using a server system where data is processed to the cloud and sent to the user terminal after aggregating and processing data. The author (Harshani et al., 2018) designed a smart monitoring system for measuring soil nutrient levels. It uses a sensor network to evaluate soil PH level, temperature, and humidity sensing and measuring soil moisture level. To develop a system to monitor crops at the infancy stage the author (Shadrin et al., 2019) modeled an intelligent IoT setup to monitor seed germination sequence. This provides an early alarm system by monitoring the seed's health condition so that an early action sequence can be initiated in case of any reported disease or other containment issues. This deployed a WSN in the proposed setup with an inbuilt artificial intelligence mechanism provided by training the data sets (Khan et al., 2020).

The Economic Effect of Smart Water Management
In the next few decades world, the population will peak at 9 billion hence increasing agriculture and water consumption. So smart water management to reduce water consumption at the same time ensuring balanced soil moisture technique to monitor soil health and hence optimize production of farmland is a great initiative towards world economic growth. Both the conditions of rain-fed where surplus water is given to the farm field and water-scarce farmland harms the production. Hence a smart monitoring system using the IoT concept helps to avoid such unfavorable conditions. Irrigation requires a regulated water supply at the required interval. Appropriate water regulation based on soil moisture level is needed for optimized water resource management (Klein et al., 2018). An extension to this has been carried out by authors (Alahi et al., 2017) which modeled a smart monitoring system to evaluate the underground water nitrate level. In lieu to develop a smart water management system for enhanced crop health, the author (Jayalakshmi and Gomathi 2020) has designed a sensor network employing the dimensionality reduction technique to gain the optimal performance parameters. Considering the security issues and challenges faced by the third party and mismanagement in handling data traffic the cloud-based data processing is replaced by an efficient edge data distribution model (Khan et al., 2016). The proposed architecture is implemented and verified in Greece for strawberry irrigation. The authors develop an automated system for scheduling irrigation based on training data observing the routine and these making decisions accordingly. The authors developed a smart water management system to improve crop yield by maintaining the soil moisture level and rain infiltration rate (Alattas et al., 2021). A more specific case has been evaluated by authors in which they developed a smart sensor system for managing water scarcity issues in the urban areas by aggregating the climatic condition and plantation dataset to evaluate the parameter for the regulation water management system (Jazyah, 2021).

Sensing and Processing Base Station
The sensor node uses the ESP8266 microcontroller unit which is being strategically placed to process the uncorrelated data from distantly located farm patches. So that wide variation in the soil texture, climatic condition, and other environmental variations can be accounted for in the overall observations and measurements. This provides more realistic data and measurements accordingly independent water regulation can be done by controlling the valve based on the soil moisture content of its corresponding location (Mishra et al., 2020a). The mechanism involved in its operation has been illustrated in Fig. 1.
According to the data input from the sensor probes, the controlling unit placed in the base station controls the flow of water by regulating the valve accordingly (Mishra et al., 2020b). For water supply, we have taken a water tank fitted with a DC submersible pump. The water tank is equipped with a submersible DC pump to supply water. The communication module used in the IoT board has the following specifications as illustrated in Table 2.
For the proposed setup we have preferred using the ESP8266 IoT board compared to other IoT boards like Wi-Fi Shield, Genuino MRK 1000, Onion Omega, etc. is that ESP8266 provides good memory capability without consuming more power (Devesh Mishra et al., 2019). It can be easily extendable and supports a varied range of interfacing ports. It has a low dimension and hence can be suitable for easy portability and lightweight applications (Devesh Mishra et al., 2019).

Flow Graph of Implementation Methodology
Electronic device energy consumption continues to fall, allowing ambient energy collecting devices to be used to power Wireless Sensor Nodes (WSNs), microelectromechanical systems, and portable electronics. Vibration-based piezoelectric harvesting has emerged as a promising method for recharging/replacing chemical batteries in WSNs over the years. Using a constructed sensor probe encased within a sensing unit, parameters of the seed plant's soil are detected. Because it provides useable power only in a small spectrum near the resonance frequency, a traditional geo-location cannot match the requirement for broadband vibration resources. Several strategies are used, including passive/active resonance tuning, harvester beam arrays, nonlinear designs and energy harvesters with several degrees of freedom have also been researched. The basic working of the module in the proposed setup can be explained by the below-mentioned Fig. 2.  This study proposes releasing water to an ideal location of the seed plot for the water system of the seed plot through water pipelines went with scientific demonstration, which creates numerous nearby pinnacles of voltage yield from low sufficiency broadband and low recurrence encompassing vibration sources. The helpful data transfer capacity and the number of tops for the geo-location could be tuned advantageously by fluctuating different branches and tip masses (Abioye et al., 2022).

Adafruit IO
Adafruit.io is a cloud-based platform. Those with an Internet connection can interact with it. It's designed exclusively for storing and retrieving data. Adafruit IO collects sensors in real-time, measures and reports, drives robots, and can switch LEDs/bulbs on and off. This can also integrate web-based services, such as RSS feeds. To prevent the service from being overcrowded, Adafruit IO's MQTT server has a rate limit. Some publish requests might be refused if a user executes too many publish operations in a short period. A maximum of one request per second is currently allowed. A message will be sent to the (username)/throttle topic unless you go beyond this limit (Jan et al., 2022).

Circuit Diagram
The interfacing circuit diagram of the experimental setup is shown in Fig. 3. The Wi-Fi-based sensor node is powered up using a power bank. The resistive hygrometer sensor is interfaced with the NodeMCU at A0 (Analog Input Pin). The sensor provides the analog input to the NodeMCU which is being processed and transmitted to the Adafruit IO cloud server. A Single Pole Single Throw [SPST] relay module is connected with the NodeMCU at a digital I/O pin. A submersible DC pump is interfaced with the relay module to perform actuation for irrigation. The circuit of the smart sensor node acts as a publisher of the sensor data as well as a subscriber to perform actuation to perform irrigation depending upon sensor data.

Field Setup Methodology
The System setup follows the publish-subscribe model of the Message Queue Telemetry Transport [MQTT] protocol. In the present article, the sensor node acts as a publisher of the soil moisture data. For the aforesaid operation, the resistive hygrometer sensor is interfaced with the NodeMCU. The data from the NodeMCU is transmitted to the Adafruit IO acting as an MQTT broker. For the deployment of IoT, the Adafruit IO is a cloudbased service that has been utilized. For storing and accessing data over the internet other than using them locally is cloud computing. The three main services of cloud computing belong to Infrastructure as a service, Platform as a service, and Software as a service. Adafruit IO supports most of the hardware. For the implementation of the Publish-Subscribe-based MQTT protocol, Adafruit IO supports the essential libraries in Arduino IDE SDK. The dashboard of the Adafruit IO acts as a subscriber of the topic "Agriculture Data". In the present setup, both the Publisher & Subscriber may act as Subscriber & publisher respectively. Therefore, in the second phase if the soil moisture value goes below a threshold the DC pump can be switched ON from the Adafruit IO dashboard. Adafruit IO Cloud broker receives the data from the publisher dashboard. The pump status "Topic" data has been subscribed by the NodeMCU. The Adafruit IO broker sends the data to the NodeMCU (Kurniawan et al., 2021).

Experimental Setup
Proposed research investigated different scenarios for different water levels hence monitoring the valve regulation in each case. This enables the flow control from the valve depending on the variation in the Soil Water Content (SWC). The setup as has been demonstrated in Fig. 4 to 7 deployed sensor probes, so a large farm field patch can be controlled and managed.
The proposed integrated setup of sensor probes is used to capture the real-time uncertainties of the pot. As several factors may be involved this may lead to variation in the data from different locations based on its positioning, uneven soil physical properties, non-uniform sun intensity incidence in the farm area, etc.

Results
To explore and implement it on a large scale to support massive connectivity the present design can be extended using several traditional networking topologies which can support multiple devices and improve range.
When implemented on a larger scale to sense big farmland this proposed setup may employ multiple sensor nodes and can function with an appropriate network topology. This setup can facilitate regulating the water flow to irrigate the farmland on-demand basis by monitoring the moisture level. So, the water flow initiates only when the soil moisture level falls below the threshold limit or less and the valve cuts off the flow when an adequate moisture level of the soil is attained.

Conclusion
The paper presents the factors involved in the trend of development that combat the issue of the limited onboard capacity of power-constrained nodes and focuses on the energy-efficient approach to gain an optimal system performance. In this direction, the author has presented an experimental setup to demonstrate the solar EH technique for IoT devices for monitoring soil moisture levels in real-time application.

Future Scopes
Moreover, the farming industry's push for Industry 4.0 is anticipated to boost additional exploration into the use of technology in smart irrigation systems. Both farmers and users are expected to profit from the combination of predictive modeling as well as the integration of webbased solutions. Farmers, scholars, and experts engaged in the automation of the farming process can be benefited from this research. Future research will contribute to the environmental challenges associated with using digital irrigation management methods on agricultural farms. Future advances in the use of the Internet of Things (IoT) and digital agribusiness solutions to promote long-term precision irrigation were also explored.

Funding Information
This is purely self-financed research. No external funding grant is provided for this research.

Author's Contributions
Devesh Mishra: The author has worked on the design of the test setup and carried out the coding of the controller module for successful signal transmission and execution. The author has also worked on the literature section of the presented work.
Prakhar Yadav: The author's expertise has motivated the work to enable smart sensing and monitoring system.
Vandana Yadav: The author has expertise in the deployment of solar energy harvesting in the module and also, has contributed to writing the manuscript.

Rekha Srivastava:
The author has carried out the experimental data analysis to reach conclusive performance.
Krishna Kant Agrawal: The author has supervised the work with his expertise in environmental impact on the soil profile and IoT implementation for the test setup.
Ram Suchit Yadav: The author has supervised the communication module test setup for wireless signal transmission.

Ethics
The paper does not involve any subject of the kind which requires ethical norms approval and hence is not applicable. As far as journal submission ethical guidelines are concerned the paper has not been prior submitted anywhere else.