JOJMS.MS.ID.555768

Abstract

Indoor farming is one of the agricultural innovations, providing essential support in controlled environments that reduced many traditional farming challenges. However, they face unique issues in managing their crops effectively, from optimizing limited space to controlling environmental conditions within their facilities. While traditional indoor farming methods provide a foundation, they often lack the precision and real-time insights needed for optimal plant health and yield. This paper explores the application of Azure IoT Hub in indoor farming, focusing on how this technology facilitates enhanced data analysis to improve agricultural efficiency and productivity. In the realm of precision farming, Azure IoT Hub plays an important role by enabling seamless integration and management of IoT-enabled sensors. By integrating sensors into the green house, users can access real-time data on crucial parameters such as temperature, moisture levels, and potential nutrient issues. This data is then processed through Azure Stream Analytics, enabling users to make data-driven decisions with precision. These sensors are critical for monitoring variables such as water level, temperature, nutrient levels, and pH, allowing for precise control over irrigation and fertilization schedules. By implementing Azure IoT Hub, the paper demonstrates how real-time data acquisition and analysis can be optimized, ensuring that optimal growth conditions are consistently maintained. This system not only supports the immediate detection and response to environmental changes but also provides a framework for predictive analytics, which is crucial for handling issues that could adversely affect plant health and crop yield.

Keywords:Indoor farming; Precision agriculture; IoT in agriculture; Azure IoT hub; Real-time data analysis.

Abbreviations:SCK: Serial Clock; GND: Ground; VIN: Voltage Input; SDI: Serial Data Input; AI: Artificial Intelligence

Introduction

Agriculture origins date back to 12,000 years, it is a particularly unpredictable and imprecise sector. The primary goal of agriculture is to produce a sustainable food supply to meet the nutritional needs of people. Agriculture is experiencing a significant transformation that implies incorporating new technologies to meet yield requirements, comply with environmental regulations, address labor intensity challenges, and solve workforce issues. To meet these challenges, agriculture has evolved and diversified with advancements in technology, scientific research, and sustainable practices [1].

With farming serving as a crucial subset of agriculture, different indoor farming systems have emerged, including conventional agriculture, organic farming, hydroponics, aquaculture, and agroforestry, among others. These systems aim to maximize productivity while minimizing ecological harm, promoting biodiversity, and securing sustained agricultural viability.

The importance of real-time data in modern farming has revolutionized the way farmers manage their crops and livestock. Access to up-to-the-minute information enables them to make precise decision-making. For instance, real-time data helps farmers anticipate, enables them to optimize irrigation schedules and protect their crops. Sensors provide instant feedback on moisture and nutrient levels, facilitating timely interventions. Additionally, real-time tracking of livestock health indicators can prevent disease outbreaks and improve overall output. By integrating real-time data, farmers maximize efficiency, reduce waste, and increase profitability, ultimately leading to more sustainable agricultural practices as mentioned before.

In the realm of data analysis, Artificial Intelligence (AI) has added value to agriculture, broadening perspectives. CNIL characterizes AI as “the grand illusion of our era,” while experts view it as a segment of software capable of processing complex data. Interestingly, the advent of AI dates to the 1950s as shown in Figure1, contrary to the assumption of its novelty. AI encompasses a broad spectrum, including Machine Learning techniques, with Deep Learning as its subset.

Yann Le Cun, a researcher in Artificial Intelligence, considered as one of the inventors of deep learning, defines AI as a set of techniques allowing machines to accomplish tasks and solve problems normally reserved for humans and some animals [2].

Artificial intelligence requires access to big data, which is best managed through cloud storage rather than traditional data centers [3]. Azure offers a solution with its Azure IoT hub, its service supports the storage and analysis of extensive data streams from IoT devices such as Raspberry Pi, making it readily accessible for AI applications. This approach allows agriculture to overcome the limitations of local data centers and enhance decision-making efficiency [4].

Materials and Methods

Materials Temperature and humidity

I. Description: The Si7sub>021 I2C Humidity and Temperature Sensor shown in Figure 2 is an integrating humidity and temperature sensor element, an analog-to-digital converter, signal processing, calibration data, and an I2C Interface. The patented use of industry-standard, low-K polymeric dielectrics for sensing humidity enables the construction of low-power, monolithic CMOS Sensor ICs with low drift and hysteresis, and excellent long-term stability. The humidity and temperature sensors are calibrated, and the calibration data is stored in the on-chip non-volatile memory. This ensures that the sensors are fully interchangeable, with no recalibration or software changes required. (Silicon labs, 2017).

II. Power pins

a) Vin - this is the power pin. Since the chip uses 3VDC, we have included a voltage regulator on board that will take 3-5VDC and safely convert it down. To power the board, give it the same power as the logic level of our microcontroller - e.g. for a 5V micro like Arduino, use 5V.
b) 3v3 - this is the 3.3V output from the voltage regulator, we can grab up to 100mA.
c) GND - common ground for power and logic.
III. I2C Logic pins
a) SCL - I2C clock pin, connect to our microcontrollers I2C clock line.
b) SDA - I2C data pin, connect to our microcontrollers I2C data line.

Ultrasonic distance sensor HCSR04

The HCSR04 Ultrasonic (US) sensor shown in Figure 3 is a 4-pin module, whose pin names are Vcc, Trigger, Echo and Ground respectively. This sensor is a very popular sensor used in many applications where measuring distance or sensing objects are required. The module has two eyes like projects in the front which forms the Ultrasonic transmitter and Receiver. The sensor works with the simple high school formula: Distance = Speed × Time.

The Ultrasonic transmitter shown in Figure 4 transmits an ultrasonic wave, this wave travels in air and when it gets objected by any material it gets reflected toward the sensor this reflected wave is observed by the Ultrasonic receiver module as shown in the picture below

I. Power pins

a) Vcc. The Vcc pin powers the sensor, typically with +5V.
b) Trigger. This pin must be kept high for 10us to initialize measurement by sending US wave. Trigger pin is an Input pin.
c) Echo. This pin goes high for a period which will be equal to the time taken for the US wave to return to the sensor. Echo pin is an Output pin.
d) Ground. This pin is connected to the Ground of the system.

Characteristics of electronic components

Table 1 defines the characteristics of the electronic components. A breadboard is used to facilitate the connections between the Raspberry Pi and the Adafruit humidity-temperature sensor. The Ground (GND) pin of the Raspberry Pi is connected to the sensor’s GND pin. The Serial Clock (SCK) pin of the sensor is connected to the third pin of the Raspberry Pi, serving as the data input. The Voltage Input (VIN) pin is connected to the 3v3 pin on the Raspberry Pi to power the sensor with a low energy draw and a maximum current of about 50MA. The Serial Data Input (SDI) pin of the sensor is linked to the second pin of the Raspberry Pi, facilitating data transmission from the processor to the sensor.

Azure IoT hub

Azure IoT hub, as shown in Figure 5, is a managed cloud platform provided by Microsoft as part of its Azure services. Azure IoT Hub allows for bidirectional communication between IoT applications and the devices they manage [5]. It is integral for real-time data processing, device-to-cloud and cloud-to-device communication, secure messaging, and device management [6]. This platform supports various protocols, including MQTT, HTTPS, and AMQP, making it versatile for different IoT scenarios. In our study, Azure IoT Hub was used to securely collect, store, and analyze telemetry data from sensors connected to the Raspberry Pi, facilitating sophisticated data management and analysis capabilities crucial for precision agriculture [7].

Methods Sensor integration with raspberry Pi

The Raspberry Pi is connected to various sensors through the breadboard as shown in Figure 6. This setup is critical for realtime data acquisition from the physical environment. Through the breadboard, we connect the sensor Adafruit humiditytemperature: to the raspberry PI, the sensor has four pins. We connect the ground GND pin of raspberry PI and sensor, we connect the SCK pin of the sensor to the third pin of the raspberry PI, this connection serves as an input of data. We connect the VIN pin to the 3v3 in raspberry PI, this connection serves as a power low energy and a maximum available current of about 50mA. The last connection is between the SDI pin of the sensor and the second pin of the raspberry PI, this is for the data sent from the processor to the sensor.

Data management via azure IoT hub

The integration of the Raspberry Pi with Azure IoT Hub is essential for the transmission of data, ensuring the efficient flow of data from the Raspberry Pi to the cloud platform. The process involves transmitting data collected from environmental sensors to Azure IoT Hub, which supports big data storage, analysis, and accessibility. The management of data infrastructure not only captures real-time environmental variables but also secures and processes the data effectively. To illustrate the practical application, a Raspberry Pi simulator is used within a preprovisioned Azure IoT environment to demonstrate device registration, configuration, and data transmission.

Initial steps include setting up the Azure IoT environment: using Azure Cloud Shell, the Azure IoT extension is installed, and a device identity is created for the IoT hub. A connection string, crucial for linking the Raspberry Pi to the IoT hub, is generated and implemented in the Raspberry Pi Azure IoT Online Simulator. Figure 6 shows the Resource Groups section in Microsoft Azure portal’s interface. It illustrates how Raspberry Pi is registered. The presence of the Bash CLI in the portal confirms the flexibility Azure offers to users for interacting with their cloud resources using command-line operations Figure 7, which simplifies the process of deploying and managing IoT solutions.

Figure 8 shows how the Smart Phone communicates with Azure IoT Hub, which acts as the central node orchestrating data transmission and device management. This method highlights the critical role of Azure IoT Hub in not only facilitating seamless data transfer but also in securing the data sent and readily available for further analysis, thereby enhancing the capabilities of IoT solutions in environmental monitoring.

The integration of raspberry Pi with Azure IoT Hub facilitated real-time data acquisition and management, which is illustrated through the transmission of data in form of instant messages as shown in Figure 9. The console outputs display messages sent from the Raspberry Pi to the Azure IoT Hub, confirming successful communication and data relay involving environmental parameters such as humidity.

Figure 10 shows a multi-line graph representing different temperature readings- ambient, box, top, and reservoir temperatures. This graph is critical for understanding the thermal dynamics within the controlled environment, where significant fluctuations occur, potentially correlating with external environmental changes or internal system adjustments such opening the door of the growing chamber.

Figure 11 shows a line graph of relative humidity over time, indicating a peak and subsequent decline, which could suggest an interaction or response within the ecosystem as of controlled adjustment in humidity levels managed by the IoT system. These visualizations not only confirm the functionality of the sensor setup but also provide insights into the environmental conditions, demonstrating the system’s ability to monitor and react to the microclimate effectively.

The comparison in Table 2 highlights the significant improvements achieved by integrating Azure IoT Hub into the indoor farming system. Notably, real-time alert accuracy increased from 91% to 96%, while data latency was reduced by approximately 60%, ensuring faster and more reliable environmental monitoring. Additionally, the system’s enhanced scalability and security features make it suitable for deployment in larger agricultural setups. These improvements contribute to more informed decision-making, efficient resource management, and overall better performance in maintaining optimal growing conditions.

Discussion

This study demonstrated the effectiveness of integrating Azure IoT Hub with real-time sensor data acquisition and MATLAB’s predictive modeling capabilities to optimize indoor farming operations. The system successfully collected environmental data, such as temperature, humidity, and nutrient levels.

By applying this architecture, the following performance improvements were observed:
a) Water usage was reduced by 29%, from 5.2L to 3.7L per day per plant.
b) Nutrient solution use decreased by 36%, from 100mL to 64mL per cycle.
c) Average crop yield increased by 9.5%, reaching up to 301g of biomass per lettuce plant.
d) Real-time alert response time improved by 66%, from over 15 minutes to under 5 minutes.
e) Predictive modeling accuracy ranged between 93% and 96%, enabling highly reliable planning.
f) Irrigation scheduling became 50% more efficient with adaptive timing based on real-time feedback.

These outcomes demonstrate the potential of cloud-enabled IoT infrastructure in transforming data into actionable insights. The integration of Azure IoT Hub with MATLAB not only supports real-time monitoring but also enables predictive and prescriptive analytics essential for next-generation smart agriculture.

By enabling faster responses to environmental changes and reducing resource waste, the system aligns with sustainability goals and precision agriculture principles. Future enhancements could explore integration with Azure ML services for automated actuation and machine learning at the edge using Azure IoT Edge.

This predictive capability supports strategic agricultural planning, optimizing resource use, and improving yield outcomes by anticipating future environmental impacts on plant growth [8]. Such models are pivotal in transforming data into actionable insights, enhancing decision-making in precision farming [9].

Conclusion

The integration of cloud-based IoT infrastructure with advanced data analysis tools offers a significant step forward in the development of intelligent agricultural systems. This study highlights how Azure IoT Hub, when combined with real-time sensor networks and predictive modeling platforms like MATLAB, can enhance the management of indoor farming environments.

By enabling continuous environmental monitoring and datadriven decision-making, the system supports more precise control over critical variables such as temperature, humidity, and nutrient delivery. This approach not only improves operational efficiency but also contributes to more sustainable and resilient agricultural practices.

Overall, the proposed framework demonstrates the potential of combining IoT and analytics to support the transition from reactive to proactive farming strategies. It lays the groundwork for future innovations in autonomous crop management and reinforces the role of digital technologies in shaping the future of agriculture.

Acknowledgment

This research was supported by the Stipendium Hungary Scholarship Program and conducted at the Hungarian University of Agriculture and Life Sciences, MATE. I would like to extend my gratitude for their financial assistance and to all the faculty and staff at MATE for their invaluable support and guidance. Additionally, I express my appreciation to the organizers and participants of the 12th International Conference on Agriculture & Food, held from 12-15 August 2024 in Burgas, Bulgaria, for providing an excellent platform to present and discuss our findings.

References

  1. Demestichas K, Peppes N, Alexakis T (2020) Survey on security threats in agricultural IoT and smart farming. Sensors 20(22): 6458.
  2. LeCun Y, Bottou L, Bengio Y, Haffner P (1998) Gradient-Based Learning Applied to Document Recognition. Proceedings of the IEEE 86(11): 2278-2324.
  3. Wolfert S, Ge L, Verdouw C, Bogaardt MJ (2017) Big Data in Smart Farming - A review. Agricultural Systems 153: 69-80.
  4. Sharma V, Tripathi A, Mittal H (2022) Technological revolutions in smart farming: Current trends, challenges & future directions. Computers and Electronics in Agriculture 201: 107217.
  5. Elksasy MSM (2023) Understanding the Internet of Things (IoT): Concepts, Applications and Standards: An Overview. Delta University Scientific Journal 6(1): 205-210.
  6. Shahab H, Iqbal M, Sohaib A, Khan F, Waqas M (2024) IoT-based agriculture management techniques for sustainable farming: A comprehensive review. Computers and Electronics in Agriculture 220: 108851.
  7. Navarro E, Costa N, Pereira A (2020) A systematic review of IoT solutions for smart farming. Sensors 20(15): 4231.
  8. Thilakarathne N, Yassin H, Abu Bakar M, Abas E (2021) Internet of Things in Smart Agriculture: Challenges. Opportunities and Future Directions in Proceedings of the IEEE Conference on Sustainable Development and Environmental Engineering (CSDE), pp. 1-9.
  9. Tolentino LKS, Fernandez EO, Jorda RL, Amora SND, Bartolata DKT, et al. (2019) Development of an IoT-based aquaponics monitoring and correction system with temperature-controlled greenhouse. 2019 International SoC Design Conference (ISOCC), pp: 261-262.