Development of Microclimate Data Recorder on Coffee-Pine Agroforestry Using LoRaWAN and IoT Technology

— Microclimate monitoring in agroforestry is very important to understand the complex interactions between vegetation, soil, and the environment. Microclimate parameters include air and soil temperature, air humidity, soil moisture, and light intensity. This research aims to develop a new microclimate data recording system for coffee-pine agroforestry, utilizing LoRaWAN and IoT technology to capture real-time microclimate parameters. Unlike traditional data loggers that require manual download on-site, this innovative system enables instant data download from IoT servers, thereby increasing data efficiency and accessibility. The system proved effective, significantly improving the precision of air temperature and humidity, as well as soil temperature measurements, with an average accuracy of 100%. However, soil moisture and light intensity recorded lower accuracies of 81.23% and 82.56%, respectively, indicating potential areas for future research and system refinement. The system maintains a 15-minute sampling period, aligning with conventional datalogger intervals. This represents an advancement in precision agriculture for microclimate monitoring, enabling the data to be utilized in decision-making for agroforestry management, which involves complex interactions between the local microclimate and the broader ecological system. It underscores the significance of sustainable land use as a response to global climate change.


INTRODUCTION
Coffee-pine agroforestry is an innovative and sustainable land-use system that integrates coffee cultivation with pine trees, offering a range of ecological and economic benefits.This agroforestry system has gained attention due to its potential to enhance ecosystem services while maintaining crop productivity [1].The integration of coffee and pine trees provides a middle ground, balancing negative impacts on ecosystem services while sustaining crop production [1] [2].Furthermore, the coffee-pine agroforestry system has been found to create specific niches for certain taxa, indicating its potential to support biodiversity and ecological resilience in the long term [3].Additionally, the system's potential for carbon storage and its economic benefits to farmers have been highlighted, with studies showing that it provides larger incomes to farmers compared to non-agroforestry models [4] [5] [6].However, challenges such as the limitation of nitrogen in the system have been identified, requiring management interventions such as the addition of nitrogen fertilizers to increase coffee bean yield [7]. Overall, the coffee-pine agroforestry system presents a promising approach to sustainable land use, offering a balance between ecological conservation and agricultural productivity.
The issue of microclimate monitoring in agroforestry is very important to understand the complex interactions between vegetation, soil, and the environment, where forest microclimate significantly influences biodiversity, ecosystem function, and plant-soil growth processes [8].Factors like topography, vegetation structure, and proximity to forest edges affect microclimate conditions [9].In agroforestry, monitoring assesses tree impacts on the environment, including water conservation, soil moisture preservation, increased soil fertility [10] [11], and potential climate change mitigation through carbon storage and erosion reduction [12] [13].Moreover, microclimate's influence on plant health, photosynthesis, and ecosystem resilience emphasizes the importance of monitoring in optimizing agroforestry management, enhancing ecosystem services, and mitigating climate change.Specifically, in coffee-pine agroforestry, microclimate monitoring is vital due to coffee trees' sensitivity to temperature, humidity, and light, impacting yield and quality, and the need to manage this unique system effectively for sustainable production.
To effectively bridge the identified research gap and record essential microclimate data like temperature, humidity, and light intensity within coffee-pine agroforestry, the utilization of advanced technologies such as LoRaWAN and IoT is imperative.LoRaWAN technology, renowned for its extended range and low-power capabilities, has already demonstrated its effectiveness in remotely monitoring environmental conditions in large-scale agriculture farms Journal of Robotics and Control (JRC) ISSN: 2715-5072 272 Heru Nurwarsito, Development of Microclimate Data Recorder on Coffee-Pine Agroforestry Using LoRaWAN and IoT Technology [14] [15].It holds immense promise for monitoring microclimates within the agroforestry system, enabling the real-time collection of data crucial for comprehending the impact of macroclimate changes on microclimates [16].
Recognizing the significance of understanding these microclimates, especially in the context of climate change and land-use shifts, underscores the pressing need for advanced monitoring systems [10].Furthermore, the integration of microclimate data into species distribution models is indispensable for ecological research and environmental monitoring [17] [18].The versatile application of LoRaWAN technology in heterogeneous deployments for IoT networks tailored to specific needs further underscores its adaptability and relevance in various environmental settings [19].
In addition to technological advancements, it is paramount to consider the specific environmental and agricultural context within coffee-pine agroforestry systems.For example, managing coffee intensification in these systems can have notable impacts on the soil hydrological system and pine growth, highlighting the intricate interactions inherent to such environments [20] [21].Moreover, the potential influence of tree and plant interactions on the soil hydrological system emphasizes the need for a comprehensive understanding of the environmental dynamics within the agroforestry system [22][23] [24].Furthermore, the incorporation of microclimate data into species distribution models and the assessment of the effects of tree canopy trimming techniques in pine-based agroforestry systems vividly illustrate the relevance of microclimate data in both ecological and agricultural research [25] [17].
Conventional microclimate datalogger typically require manual downloading of the data at the location where it is placed.This datalogger is designed to record certain microclimate data variables, capturing the environmental conditions experienced by organisms in terrestrial environments [26].However, the process of downloading data from these dataloggers can be time consuming and prone to human error [27].The need for manual downloads per site can hamper data synthesis across studies and hinder progress in global change biology [28].
The research conducted by the CEH-UB Projects Team at UB Forest involved the coffee plantation area within the UB Forest [25].A Microclimate Datalogging System was installed as part of the activities of the Tropical Agroforestry Research Group.This system, in place since 2018, required routine manual data downloads.The sensors were strategically located in the coffee plantation area amidst the pine forest of UB Forest, specifically in the LC, MC, HC, and BMP plots.The sensor setup included a Light Intensity Sensor positioned above ground among the coffee plants, an Air Temperature and Humidity Sensor placed on a pine tree within the coffee plantation, and a Soil Temperature and Humidity Sensor located on the ground surface among the coffee plants [29].A significant challenge was the manual downloading process required at each sensor's location.This necessitated the development of a remote sensing system for the sensor node, capable of recording microclimate parameters using IoT technology [30].
In parallel, soil moisture sensors play a pivotal role in coffee-pine agroforestry, particularly in monitoring underground interactions related to water availability, which is essential for nutrient solubility and transport in the soil [31].These sensors measure soil water content, providing vital data to comprehend how moisture levels impact nutrient solubility and plant uptake [32].IoT technology, with its ability to collect real-time, precise data from diverse sensors, proves to be a more suitable choice for this application, facilitating efficient and integrated monitoring and management of the micro-environment in agroforestry systems [33].
The research question for this research is how LoRaWAN and IoT technology can be leveraged to enhance the monitoring and management of microclimatic conditions within coffee-pine agroforestry systems.The primary objectives of this research are to design and develop a microclimate data recording system using LoRaWAN and IoT technology that can collect and record real-time data, such as soil and air temperature, soil and air humidity, and light intensity in coffee-pine agroforestry.Additionally, the research aims to assess the performance and feasibility of this system in optimizing agricultural practices, improving crop yield, and promoting sustainability in coffee-pine agroforestry.This recording will facilitate instant data download from IoT servers, thereby eliminating the need for physical presence at the Sensor node location.
The integration of LoRaWAN and IoT technologies for monitoring microclimate data in coffee-pine agroforestry holds promise for gaining a comprehensive understanding of the intricate environmental dynamics in these systems.By harnessing advanced technologies and tailoring their application to the specific context of agroforestry, valuable insights into the effects of macroclimate fluctuations, landuse practices, and agricultural management on microclimates can be acquired, facilitating more informed decision-making and the promotion of sustainable practices.Furthermore, the research's far-reaching implications extend to potential benefits for farmers, including improved crop growth, resource conservation, and reduced environmental impact.This technology could also find applications in various other farming practices and industries, with the potential to usher in positive changes in agriculture and environmental conservation.
By harnessing the capabilities of LoRaWAN and IoT technology, a real-time and precise microclimate data recording system has been developed for coffee-pine agroforestry environments.This system significantly contributes to the processing of data for decision-making and the promotion of sustainable agroforestry practices.It underscores the influence of macroclimate variations and land use practices on the microclimate, thereby enhancing our understanding and management of these complex ecological interactions.This technological advancement not only enhances resource efficiency and crop yields but also promotes responsible agricultural practices by reducing water, energy, and chemical inputs, thereby mitigating the environmental impact of farming activities and fostering a more harmonious relationship between agriculture and the environment.The existing research on microclimate monitoring in agroforestry provides valuable insights into the dynamics of microclimates within forest ecosystems, offering relevant perspectives for the monitoring and recording of microclimate data in coffee-pine agroforestry.Studies have underscored the critical importance of understanding the drivers of variation in forest microclimate, particularly in the context of rapid land-use transformation and global change, emphasizing the relevance of such insights for agroforestry systems [13] [34].Studies have demonstrated the successful deployment of sensor networks for real-time environmental monitoring, showcasing the potential for similar applications in agroforestry settings [35].Additionally, research has emphasized the importance of accounting for spatial variation in microclimate at resolutions smaller than most available climate data, highlighting the relevance of fine-scale microclimate monitoring in agroforestry systems [36] [37].Furthermore, studies have underscored the significance of microclimatic data in characterizing climate variability at unprecedented spatial and temporal scales relevant to biological processes in forests, emphasizing the relevance of such insights for agroforestry systems [10].Moreover, research has shed light on the implications of planned farmer behavior and agroforestry innovations, providing valuable perspectives on the human dimensions of agroforestry practices and their impact on microclimates [25].
The current research in the field of microclimate monitoring in agroforestry has shown significant progress in understanding the effects of environmental variables on microclimates, yet there are notable gaps that this research aims to address [38].Existing studies have highlighted the need for a wider range of case studies to enhance our understanding of the effects of gap size on microclimate and soil moisture variations, emphasizing the necessity for comprehensive and diverse case studies to capture the variability of microclimates in different forest types [39].Additionally, research has demonstrated the importance of understanding the buffering effect of forests on microclimates, emphasizing the need for further investigations to comprehend the implications of forest fragmentation on microclimate dynamics, particularly in the context of agroforestry systems [40] [23].Furthermore, the incorporation of microclimate into species distribution models has been recognized as crucial, yet the limitations of microclimatic grids in reflecting long-term climate dynamics over time have been acknowledged, indicating the need for improved methodologies to capture the long-term dynamics of microclimates [17].Moreover, the literature has underscored the significance of microclimates in buffering the responses of plant communities to climate change, highlighting the necessity of predictive models to mitigate the impact of climate change on agroforestry systems, particularly in the context of smallholder coffee farms [41][38].
These studies collectively contribute to a comprehensive understanding of the dynamics of microclimate data in forest ecosystems, providing valuable knowledge that can be leveraged for effective microclimate monitoring in coffee pine agroforestry.By addressing the need for diverse case studies, improving methodologies to record long-term dynamics of microclimate data, and in the future the need for predictive models to mitigate the impact of microclimate change on small-scale coffee agroforestry.
The Internet of Things (IoT) constitutes a worldwide network infrastructure, encompassing both physical and virtual devices, interconnected through their data acquisition and communication functionalities [42].This infrastructure consists of the internet network and its network development that can connect objects, sensors, and connections to provide independent cooperative services and applications [43].IoT is defined as an internet network that connects objects equipped with sensors [44].These sensors allow these objects to connect to the internet [45].Thus, IoT enables the use of sensors and other devices to collect data automatically and present information in various forms, such as graphs and tables [43].
Fig. 1 shows the concept of IoT.The expression Internet of Things encapsulates three fundamental constituents: firstly, physical objects integrated with sensor modules; secondly, connections to the Internet; and thirdly, data centers located on servers for archiving information derived from various applications [46].The aggregation of data procured from objects linked to the internet culminates in the formation of big data.This data can undergo analysis by entities such as government agencies, commercial enterprises, and other organizations, subsequently being harnessed to serve their specific interests.[47].LoRa is a network communication system with longdistance and low power usage [48].LoRa was initially used for military purposes, but over time, LoRa was promoted as a solution for the Internet of Things (IoT) [49].LoRa is one of the Low-Power Wide Area Networks (LPWAN) protocols [50].LoRa is quite suitable for IoT nodes that have limited resources/energy, and these nodes are in areas that are difficult to reach [51].This wide area nature and low power usage make LoRa suitable for use in IoT technologies such as environmental monitoring, water pressure measurement, and other sensors [52][53].
LoRaWAN is a standard protocol from LoRa that works on the LoRa MAC layer, which facilitates communication between nodes, gateways, and network servers even though they have different fabrications [54].In LoraWAN, the gateway is connected to the network server via a standard IP connection and acts as a transparent bridge, then converts RF packets to IP packets and vice versa [55].LoRaWAN allows for a single-hop link between the IoT Sensor node and the gateway [56].All nodes that use LoRa are capable of twoway communication [52].The application of LoRaWAN and IoT in environmental data recording has been demonstrated in various studies, providing valuable insights into the potential for monitoring and recording microclimate data in coffee-pine agroforestry.For instance, research that showcases the successful deployment of sensor networks for real-time environmental monitoring highlights the capacity to make informed decisions in response to adverse environmental events, which is pertinent to the dynamic conditions of agroforestry systems [35].Additionally, studies emphasize the reduced cost and superior range of LoRaWAN, which is particularly important for applications in remote areas, aligning with the expansive nature of agroforestry settings [57].Furthermore, the development of a LoRaWAN IoT node with ion-selective electrode soil nitrate sensors for precision agriculture underscores the potential for leveraging IoT technologies to enhance agricultural practices, which can be extended to the management of agroforestry systems [58].Moreover, the predictive model for microclimatic temperature and its use in mosquito population modeling demonstrates the reliability of microclimate temperature estimation from ambient environmental conditions, offering valuable insights into the potential for predictive modeling in microclimate monitoring, which is relevant to understanding the microclimates within agroforestry systems [59].These studies collectively contribute to the literature on the successful application of LoRaWAN and IoT in environmental data recording, providing a foundation for the potential implementation of similar technologies for monitoring and recording microclimate data in the coffee-pine agroforestry of UB forest.
MQTT is a topic-based publish/subscribe communication protocol.MQTT is designed to be simple and lightweight for devices with limited resources and low bandwidth [60] [61].With the design principle, namely the use of minimal bandwidth and reliability in ensuring data transmission [62].In the publish/subscribe mechanism, publishers will send messages, and users will subscribe to topics related to the system, so subscribers can receive messages sent based on that topic [63].In other words, a client or Sensor node can publish to a certain topic, and all subscribers can receive messages if they have the same topic [64].

III. RESEARCH METHODS
The research methods of this research was systematically organized in alignment with the research flow illustrated in Fig. 2. The start process then continues into the literature review phase, where data related to the system design is carefully collected and examined.The design stage, system construction is carried out, so that the completion is successful.After that, the system undergoes detailed testing and analysis to ensure proper functioning and ensure that the system fulfills its purpose successfully.This analysis may require certain modifications and improvements to the system.The procedure then continues to the conclusion stage, where an evaluation is carried out to determine the effectiveness of the system in achieving its objectives.After a successful evaluation, the procedure ends.

A. Location of Research
The research was conducted in the Coffee-Pine agroforestry area of the UB Forest, situated on the slopes of Mount Arjuno in Sumbersari, Tawang Argo Village, Karangploso, Malang, at coordinates 7.824° South Latitude and 112.578°East Longitude, and at elevations ranging from 1200 to 1800 meters above sea level.The UB Forest was selected as the research site due to its role as a hub for coffeepine agroforestry studies by students and lecturers.The UB Forest serves as the focal research area for this machine learning-based research, boasting diverse ecological features and a wide array of agroforestry practices.This expansive forest encompasses rolling hills, flatlands, and distinct microclimatic zones, offering a unique environment for developing a Microclimate Data Recorder using LoRaWAN and IoT technology.The forest's topography and soil composition further contribute to the intricacies of its microclimates, making it an ideal location for studying the influence of macroclimate changes on microclimates within the agroforestry system.The LC (Low density Coffee) plot is situated at an altitude of 1200 meters above sea level, while the BAU (Business As Usual) plot is at an altitude of 1300 meters above sea level.
The coffee-pine agroforestry system in the UB Forest area is divided into several plots, where each plot has different soil and vegetation characteristics.For this research, three plots were randomly selected to ensure variation in microclimatic conditions and plant composition.Plot description in UB Forest: • The LC plot in UB Forest exhibits a low canopy characterized by a canopy cover level of less than 40%.This condition results in increased direct sunlight exposure to plants beneath the canopy, which can impact soil temperature and moisture dynamics.Consequently, coffee plants within these plots may face heightened vulnerability to heat and drought stress, lacking protection from direct sunlight.However, such plots may also provide a suitable environment for the growth of other light-demanding plant species.This specific LC plot, encompasses a total of 500 plants, including 171 coffee plants and 329 Pine plants, within a 2400 square meter area.Notably, management practices for this plot involve minimal intervention, with no pruning or weeding activities conducted.

B. Research Time
This research was conducted for one full year, starting from October 2021 to September 2022.The choice of a duration of one year was intended to understand microclimate variations throughout the two seasons (rainy season and dry season) and how these variations affect the growth and development of coffee plants and pine trees.
During each phase, data is collected weekly and analyzed to understand emerging patterns and trends.In pursuing a rigorous methodology, this research endeavors to gain comprehensive insights into the effects of microclimates on plant growth in Coffee-Pine plots within UB Forest and to assess the efficacy of IoT technology for monitoring these environmental parameters.

C. Tools and Materials
For the precise and efficient acquisition of microclimate data in the Kopi-Pinus terrain of UB Forest, we utilized the following tools and materials.
The system developed in this research is the development of a multipoint LoRa communication network using the Lorawan and MQTT protocols for sending data in UB Forest to IoT Server.From the sensor, data will be obtained which will be sent by the LoRa LSN50-V2 to the OLG02 gateway, forwarded to the IoT Server, and the data is processed in The Things Network.The architectural design of the Microclimate Data Recorder with IoT Technology is shown in Fig. 3.
There are several reasons for strategically placing sensors in LC and BAU plots in agroforestry systems which are important for the selected locations in monitoring various microclimatic conditions.Sensors on BAU plots can track conditions such as higher sun exposure and temperature fluctuations, while sensors on LC plots can monitor more stable, shaded, and humid environments.This setting allows for a comprehensive understanding of microclimate variability, which forms the basis of management and adaptation strategies for plant and animal species in the system.Therefore, the careful placement of sensors on these contrasting plots highlights the importance of the diversity of microclimatic conditions in the research and sustainability of agroforestry systems.Each LoRa Sensor node LSN50-V2 is equipped with various sensors, including air and soil temperature sensors, air and soil humidity sensors, as well as light sensors, as depicted in Fig. 4.These sensor nodes communicate with the Gateway using LoRa technology, and the Gateway transmits microclimate data through the 3G/4G internet network to the IoT Server.The microclimate data can then be accessed and downloaded from the IoT server.In Fig. 4 it can be seen that the Sensor Node uses the Dragino model LSN50-V2 as a processor for input data from sensors to produce output according to needs and to transmit data via the LoRaWAN network.In this Sensor Node, there are several types of sensors used, namely the SHT31 air temperature and humidity sensor, the DS18B20 soil temperature sensor, the BH1750 light intensity sensor, and the SEN0308 DFRobot soil humidity sensor.Connection sensors to the Sensor Node can be seen in Table I.The SHT31 sensor is used to measure air temperature and humidity while the DS18B20 sensor is used to measure the temperature of the planting media (soil).The BH1750 functions to measure light intensity, while the SEN0308 DFRobot functions to measure the moisture content of planting media (soil).DFRobot's SHT31, DS18B20, BH1750, and SEN0308 sensors use 5v voltage.The SHT31 sensor output is connected to pins PB6 and PB7, and on the DS18B20 sensor, the output from the sensor is connected to pin PB3.On the BH1750 sensor, the output from the sensor is connected to pins PA9 and PA10, and on the SEN308 DFRobot sensor, the output from the sensor is connected to pin PA1.This system will require a gateway to send data to the IoT platform.The gateway used is Dragino OLG02 which uses the LoRaWAN protocol.The data obtained from sensor readings by the Dragino LSN50-V2 Sensor Node will be initially transmitted to The Things Network through the Dragino OLG02 Gateway.Subsequently, The Things Network will relay the data to the IoT Server platform, specifically Thingspeak.This sequence of actions ensures data recording, processing, presentation in graphical formats, and availability for further analysis through downloads.3, here are several points that can be explained regarding system design: • LSN50-V2 is a LoRa Sensor Node as in Fig. 5 and will accommodate several sensors, namely air humidity temperature sensors, soil air humidity temperature, and light intensity as seen in Fig. 5(a) on testing.Data on the sensor will be forwarded by the LSN50-V2 to the gateway.Solar panels are used to charge the Sensor Node battery as shown in Fig. 5(b) on site operation.Battery condition is continuously monitored and recorded to ensure functional efficiency.If problems occur with recharging, an evaluation of the panel capacity can be performed.• The OLG02 LoRa gateway, as depicted in Fig. 6, functions as a device that establishes a connection between a Sensor Node and an IoT server using a 3G/4G internet public communication network, specifically provided by Telkomsel.The Lora Gateway is situated in a forested region, a secluded area that is accessible solely through internet communication over the 3G/4G network.The Lora Gateway offers supplementary connectivity alternatives through LAN cable and Wifi.Strategically positioned atop a 12-meter tower (as illustrated in Fig. 6), the gateway is situated to receive robust LoRa signals emitted by the Sensor Node.Given its considerable power requirements, the gateway relies on access to a reliable public electricity network, which is typically available in the vicinity of the forest and supplied by PLN (Perusahaan Listrik Negara).Gateways assume a crucial role in the reception of data from LoRa Sensor Nodes and their subsequent transmission to The Things Network (TTN).
• TTN, accessible via the address au1.cloud.thethings.network,constitutes an open, worldwide, and community-driven IoT service designed to relay data received from IoT gateways to the IoT Server platform.TTN has been deployed in 70 countries across the globe and is poised for further expansion, with the overarching objective of establishing a comprehensive Internet of Things network on a global scale.
• The IoT Server, accessible through thingspeak.com,represents an analytical platform service within the domain of the Internet of Things (IoT).Its primary function is to enable cloud-based recording, aggregation, visualization, and analysis of real-time data streams of microclimate data series in coffee-pine agroforestry environments.

D. Data Collection Process
Microclimate data, once stored on the Internet of Things (IoT) Server, specifically ThingSpeak, can be both displayed and downloaded.The process involves accessing the ThingSpeak website through a web or mobile application, followed by logging into one's account and accessing the relevant channel ID.The data can then be visualized in the form of graphs and downloaded for storage in a CSV file format.This facilitates subsequent processing and analysis of the collected data.
The data collection process is pivotal to the integrity of this research.The procedure employed for gathering microclimate data from the Coffee-Pine Agroforestry in UB Forest is as follows:

E. Data Calibration
In the calibration process, equipment or sensors are calibrated by comparing them with a higher accuracy calibration standard as a reference.This is conducted in a controlled environment to minimize the influence of external variables.A series of measurements are taken to identify the discrepancy between the equipment readings and the standard values.Adjustments are made to the equipment, if necessary, to rectify any discrepancies.This process is repeated until the equipment demonstrates the desired accuracy.Comprehensive documentation, including a calibration certificate indicating the equipment's performance postcalibration, is prepared to ensure the equipment measures accurately and consistently.The calibration process involves using precise measuring tools as references that meet established standards.These tools include the AMF-035 Multimeter, a versatile 5-in-One measuring device capable of measuring wind speed, light intensity (lux meter), air temperature, and humidity.The Delta-T HH2 Moisture Meter, a versatile reader used with Delta-T soil moisture sensors, displays readings on an LCD and stores data for later download to a PC.Additionally, the Yieryi TPH01803 Multimeter, a crucial tool for maintaining plant fertility, accurately measures soil temperature, humidity, and pH levels.

F. Microclimate Data Analysis
The process of Microclimate Data Analysis adheres to a meticulous Exploratory Data Analysis (EDA), a crucial preliminary step in data science designed to comprehend and deconstruct datasets thoroughly.It commences with Data Cleaning to validate data accuracy and maintain consistency, followed by the application of Descriptive Statistics to unveil notable trends and variations, thereby fostering a comprehensive grasp of data attributes.Subsequently, Comparative Analysis and Parameter Summary enable a discriminating examination and comparison between the Data-LC and Data-BAU datasets, duly acknowledging their unique characteristics and providing a robust footing for subsequent in-depth analysis or data-informed decisionmaking.

IV. RESULT AND DISCUSSION
During implementation, testing of the Microclimate Data Recorder with LoRaWAN and IoT Technology was carried out in the Green House Laboratory and on the Coffee-Pine Agroforestry land in UB Forest.This test aims to ensure the Sensor Node, Gateway, and IoT Server are working properly.In tests carried out at UB Forest with different conditions for each Sensor Node.The data sent will be repeated every 15 minutes according to the data recording settings.

A. LC and BAU Microclimate Data Recording
The selection of the LC and BAU plots for this advanced research was informed by a prior research that involved four locations: BAU, LC, Medium-density Coffee (MC), and High-density Coffee (HC), utilizing conventional dataloggers [25].The current research aims to develop and test an Internet of Things (IoT)-based data recording system, aspiring to enhance the ease and practicality of data collection.The adoption of IoT technology is anticipated to significantly improve data collection efficiency, enabling automatic and real-time data acquisition, a marked improvement over the more labor-intensive and time-consuming conventional methods.By concentrating on the LC and BAU sites, this research not only builds upon previous data and observations but also assesses the potential of IoT technology to revolutionize data collection methods in agroforestry research.
A summary of the results of recording LC and BAU microclimate data is shown in Table II.The raw data can be downloaded from the IoT server.Plot Data LC in https://thingspeak.com/channels/1291445,and Plot Data BAU in https://thingspeak.com/channels/1285589.As seen in Table II, the comparative analysis of the combined parameter summaries and statistical analyses for the Data-LC and Data-BAU datasets reveals several insightful trends and variances between the two sets of environmental data.Both datasets exhibit stable voltage readings, with Data-LC averaging at 3.55 volts and Data-BAU slightly lower at 3.49 volts, this shows consistent battery voltage and stable charging from the solar panels all the time in both environments [69].
In terms of soil temperature, Data-LC recorded an average of 19.57°C, while Data-BAU was slightly higher at 20.58°C, coupled with a wider range of temperature readings, indicating potential differences in sensor placement locations between the two datasets.the.Light intensity readings showed marked variations, with Data-BAU showing a wider range and higher average (954.58lux).The disparity in these two parameters arises because the LC plot is situated within a coffee agroforestry setting where the pine tree canopy is denser than that of the BAU plot .
Air temperature readings were generally within the expected range for both data sets, but Data-BAU presented slightly higher averages and increased variance.Humidity levels in the air and soil are within physically reasonable ranges for both data sets, but Data-BAU tends to show slightly lower humidity means and larger variances, potentially indicating varying microclimates.The discrepancy in these two parameters is attributed to the location of the BAU plot within a coffee agroforestry area characterized by a sparser pine tree canopy and pruning practices, in contrast to the LC plot, which features a denser canopy with fewer pruning activities [70].
Traditionally, the process required physically downloading data from microclimate recorders, specifically LC and BAU models, positioned in remote areas within coffee-pine agroforests [71].This task was both timeconsuming and costly due to the inaccessibility of these locations.However, the introduction of LoRaWAN technology and the Internet of Things (IoT) has revolutionized this process [72].With the new system, data collection no longer necessitates physical presence at the site.Instead, it can be remotely accessed and downloaded via an IoT server over the internet.This advancement offers substantial benefits, notably in terms of convenience, efficiency, and cost-effectiveness, as it eliminates the need for long and expensive journeys to remote forest areas [73].

B. Measurement and Calibration
Measurements for calibration are carried out using a calibration measuring instrument as a reference and simultaneously with data collection on the sensor node.The microclimate measurement results are shown in table III.The calibration process is essential when discrepancies are observed in the readings of various parameters such as air temperature, soil temperature, air humidity, soil moisture, and light intensity, compared to standard measuring tools [74].To enhance the accuracy and ensure the sensor node readings align more closely with those of the reference tools, calibration is performed using the linear regression method [75].The linear regression formula, y = mx + c, where y represents the predicted value (reading from the reference instrument), m is the slope of the regression line, x is the independent value (sensor reading), and c is the intercept (yintercept), is employed to ascertain the optimal m and c values that best represent the relationship between the sensor readings and the readings from conventional tools [76].
Based on the coefficients obtained from calculations using the linear regression method, these coefficients will be entered into the Payload Formatter on The Things Network to produce more accurate reading values [77].Next, observations are made again and compared with the same reference tool to confirm whether the calibration was successful and the reading values became more accurate.
To calculate the measurement accuracy of the sensor node based on this reference value, the accuracy can be calculated using the formula [78]: The results of calibration calculations by applying linear regression and their accuracy for Soil Moisture are shown in Table IV.Calibration results, after applying linear regression and accuracy to all parameters [79].The results indicate that for air temperature, air humidity, and soil temperature, an exemplary average accuracy of 100% was achieved.However, for soil moisture and light intensity, the accuracies were 81.23% and 82.56% respectively, denoting good accuracy.This illustrates that while the sensor node exhibits excellent accuracy for air temperature, air humidity, and soil temperature, it shows good accuracy for soil moisture and light intensity, highlighting the effectiveness of the calibration process [80].

C. Functional Testing
Functional testing in the development of a microclimate recorder aims to ensure that the device operates correctly.The specific goal is to ensure that all functions of the microclimate recorder, such as measuring soil humidity, temperature, and light intensity work as expected.
Heru Nurwarsito, Development of Microclimate Data Recorder on Coffee-Pine Agroforestry Using LoRaWAN and IoT Technology Fig. 7 displays the functional test results for soil moisture with two dotted line graphs, in Fig. 7(a) Soil Moisture (BAU) and Fig. 7(b) Soil Moisture (LC), which shows soil moisture in percentage throughout the day on the 20th October.Both charts show similar data points, maintaining a consistent humidity level of around 60% from morning to evening, as seen by the continuous flat line formed by the connected red dots throughout the chart.This unchanged soil moisture data shows minimal fluctuations, changes of only around 5% which usually occur in the dry season in coffee pine agroforestry areas in non-irrigated forests [81].Under these conditions, soil moisture levels depend primarily on rainfall, resulting in daily variations due to evaporation during the day and dew accumulation at night [82].8(a), with different locations with a steady rise from the early morning, a peak at the same level, and a subtle decline after the peak [83].Fig. 9 shows two-line charts Intensity BAU Fig. 9(a) and LC Fig. 9(b), both depicting light intensity measured in lux for the same day.The general shape of both curves is quite similar, suggesting that both BAU and LC conditions are subject to the same general light patterns, which are likely driven by the sun's position in the sky [84].The differences in the magnitude of fluctuations during peak hours could be due to local variations in cloud cover, shading, or the sensitivity and positioning of the light sensors [85].The soil humidity data is anomalous when compared to the other parameters, as it does not show the expected daily variation [86].Air temperature and light intensity data both exhibit typical diurnal cycles, indicating that these sensors are likely functioning correctly and that they are capturing the expected natural variations in environmental conditions [87] [88].The consistent readings across both (BAU) and (LC) for all parameters suggest that the conditions or locations for these measurements are experiencing similar environmental factors or that they are part of a controlled experiment with uniform conditions [89].The functional testing for Soil Humidity, Air Temperature, and Light Intensity seems to be running well.

D. Testing Connection to the Internet and LoRa
The goal is to verify and ensure that the LoRa gateway Dragino OLG02 can effectively connect to the internet network via GSM 3G/4G communication.This testing includes checking the gateway's ability to detect and connect to a 3G/4G network, measuring the signal strength and quality of the LoRa connection, and ensuring connection stability over a specified time.LoRa communication is also connected to the Sensor Node, likewise, the LoRaWAN protocol is also active (LoRa and LoRaWAN icons are active).Likewise, the WiFi on the Gateway is also active (WiFi -active) and Fig. 10(b) shows WiFi has received an IP number, this WiFi is useful for monitoring and setting up the gateway [91].Overall, the Dragino OLG02 gateway delivers in terms of connectivity and stability [92].Its reliability and efficiency make it suitable for various applications, especially in recording coffee-pine agroforestry microclimate data where high reliability is demanded [90].These test results provide confidence in its use in long-term applications.

E. LoRa Signal Range and Quality Testing
Testing the range and quality of the LoRa signal is carried out by reading the RSSI (Received Signal Strength Indicator) and SNR (Signal-to-Noise Ratio) data read at the gateway from receiving the LoRa signal from the Sensor Node, and then comparing it with existing signal quality standards.There is this test also includes a signal range evaluation to determine the extent to which the LoRa signal can be received with good quality.Table V shows the result of LoRa Signal Range and Quality Testing and Fig. 11 shows the graph LoRa Signal Range and Quality Testing.
At Table V and Fig. 11 a closer distance of 50 meters, the Received Signal Strength Indicator (RSSI) was recorded at -87dbm, and the Signal to Noise Ratio (SnR) was at 10db, indicating high and good signal quality [93].However, as the distance increases from 100 meters to 300 meters, there is a noticeable decrease in signal quality.RSSI values drop to a range between -96dbm and -99dbm, while SnR shrinks from 6db to -12db.This trend highlights the increasing dominance of noise over the actual signal, indicating a decrease in signal clarity.RSSI and SnR readings at longer distances serve as important indicators of practical operational range limits for LoRa devices in a given test scenario [94].Especially at a distance of 350 meters, coupled with the thick pine plants as a canopy in the UB forest, the signal quality decreases sharply.RSSI plummeted to a low of less than -115dbm, causing poor signal reception.Therefore, this specific distance is characterized as a practical range threshold for installing the device in a UB forest environment, beyond which the device's ability to transmit a reliable signal will be significantly compromised [95].
The effectiveness of radio waves, including LoRa, diminishes with increased distance.An external antenna has been utilized to boost the range [96].However, the sensor node's placement in a coffee-pine forest with pine trees reaching up to 30 meters in height results in the attenuation of the LoRa signal [97].To enhance coverage across a broader region, the utilization of repeaters is a viable option.However, this approach warrants consideration of certain challenges, particularly in remote and forested areas.In these locations, gateways necessitate substantial electricity resources and incur significant costs [98].Therefore, this aspect presents a potential area for further research.

F. Performance Testing
The performance of this system will be tested, including delay and packet loss.The delay was obtained from the time difference between n+1 and n packet.It can be seen in the delay from the UB Forest Environment Test.
Delay testing is carried out by calculating how long it takes for the system to receive and display sensor readings in the The Things Network application.The purpose of this test is to measure Network Latency by determining the time The research required microclimate data from each site, with each data point being only 11 bytes and sampled every 15 minutes, thus avoiding the need for large data packets or high network traffic.During testing, data was transmitted every 15 minutes, 32 times in total.For the BAU Sensor Node, the results showed an average delay of 0.2534 seconds, with a minimum and maximum delay of 0.2059 seconds and 0.3083 seconds respectively.Similarly, the LC Sensor Node recorded an average delay of 0.2506 seconds, with the delays ranging from a minimum of 0.2053 seconds to a maximum of 0.3211 seconds.These delay frequencies for both BAU and LC are illustrated in Fig. 12. Fig. 12. Graph of the number of delay frequencies for BAU and LC Fig. 12 shows that the LoRa network has consistent and controlled delays in both BAU and LC test conditions [99].This performance indicates reliability in data transmission, which is important for LoRa applications that require timing accuracy [100].Recommendations for further research could include investigations into the factors that can cause delay variations and how to optimize them.
Conducting packet loss tests is an essential step in ensuring the integrity and efficiency of data transmission within the LoRa network [101].The main goal of this testing is to identify the frequency and causes of packet loss during the data transmission process from LoRa sensor nodes to the gateway, and thereafter to TTN/ThingsBoard [102].The purpose of these tests is to evaluate the impact of distance and environmental conditions on packet loss and to analyze at which stage the packet loss most frequently occurs, whether from the sensor node to the gateway, from the gateway to TTN, or TTN to ThingsBoard.The results of the packet loss tests are presented in Table VI.In the packet loss testing of the LoRa network, it was found that four nodes, installed at six different distances, exhibited relatively low packet loss values.The BAU node at 150m and the LC node at 200m recorded a packet loss of 4%, while the BAU node at 250m and the LC node at 300m showed a packet loss of 8%.These results show very good results [103].

G. Device Durability Testing
The purpose of this test is to assess resistance to environmental factors by measuring how long the LoRa sensor node (Dragino LSN50-V2) withstands different environmental conditions, such as extreme temperatures, high humidity, dust, or rain.
Test results show that the LoRa Dragino LSN50-V2 Sensor Node device has shown good durability in testing on UB Forest land, facing extreme weather conditions for 7 months of operation.The performance of the device in overcoming various environmental challenges, including extreme temperatures, high humidity, and wet/dry conditions, confirms its good reliability and structural durability [104].The device not only survived in terms of its physical integrity but also in maintaining consistent efficient data transmission, indicating that fluctuating environmental conditions do not significantly impact its primary function.This is very important, considering that data transmission stability is a critical factor in LoRa applications [105].In addition, the device's ability to maintain its operation with the help of solar panels to recharge the battery from the solar panel shows optimal energy efficiency, an important aspect for long-term field applications.Throughout the research, there were challenges related to the device's durability, such as rainwater infiltration, the equipment box turning into an ant nest, and solar panels that were inadequate for recharging the battery.However, these issues have been effectively addressed.

H. Integration Testing of the Things Network with IoT Server
The purpose of this test is to validate the TTN integration with the IoT Server and ensure that data from the LoRa Dragino LSN50-V2 Sensor Node device sent to The Things Network can be forwarded and displayed correctly on the IoT Server (Thingspeak).Fig. 13 shows the results of the Sensor Node and The Things communication and Table VII shows the result sample data record in the IoT Server (Thingspeak).Fig. 13 illustrates that the integration testing between The Things Network (TTN) and the IoT Server (Thingspeak) for the LoRa system was successfully executed, yielding favorable outcomes.The integration process was seamless, showcasing consistent and reliable data transmission without any loss of data.Notably, the transmission delay times were minimal, not exceeding 1 second, a critical factor for IoT applications requiring rapid responses.This efficiency underscores the system's capability in managing real-time data transmission and preserving data integrity [106].The integration of The Things Network (TTN) with IoT servers introduces various challenges, including constrained coverage, scalability concerns, security vulnerabilities, and possible data latency [107].Addressing matters of data ownership, privacy, and regulatory compliance can be intricate, and achieving interoperability with alternative IoT platforms may be constrained [108].In terms of security, it is noteworthy that TTN has implemented SSL encryption measures to enhance data protection.
The results of integration testing between Things Network (TTN) and IoT Server (ThingSpeak) for the LoRaWAN system have been successfully realized and provided good results [109].This shows that the interconnection of LoRaWAN technology from sensor nodes to IoT servers has been established effectively [110].This shows that the system has been successfully developed and has succeeded in recording microclimate data in coffee pine agroforestry by measuring the variables of soil and air temperature, soil and air humidity, and light intensity.This system provides ease and practicality of data collection from the new system, eliminating the need to physically visit and download the parameters of each datalogger, and reducing the number of dataloggers required per plot from three to a more manageable number, simplifying the process significantly.Table VII shows an example of data on an IoT Server (Thingspeak) that displays recorded data from BAU and LC in an easy-to-understand manner, emphasizing the userfriendly aspects of the system.The intuitive interface and clear data representation in the dashboard make it easy to monitor and analyze microclimate data.This test not only proves the technical reliability of the system in bridging TTN and IoT Server (Thingspeak) but also shows its ease of use, making this system an effective and practical solution for IoT applications in microclimate data recording.In other studies, experiments were carried out using different IoT platforms such as ThingsBoard and Blynk [111].However, the use of Thingspeak has proven to be adequate, straightforward, easy to use, and provides reliability in communication systems.In the future, we plan to explore Ubidots and Firebase as potential options [112].
In contrast to previous systems of traditional dataloggers, this new system increases the simplicity and feasibility of data acquisition by eliminating the need for the physical presence and download of parameters from each datalogger.In addition, this reduces the number of dataloggers required per plot from three to a more practical one, simplifying operations significantly.These improvements contribute to not only increasing the efficiency of data collection but also significantly reducing labor and time expenditures, which is an important advance in the effort to achieve more effective, precise, and labor-conservative agricultural methodologies.The versatility of this system includes its applicability in a variety of agroforestry contexts and its ability to adapt to a wide range of environmental conditions.
Regarding data security and privacy issues, the ThingSpeak IoT platform ensures enhanced protection [113].The ThingSpeak API Server facilitates secure connections between devices and ThingSpeak through the support of HTTPS and MQTT protocols, both of which are known for their robust security features [114].This approach ensures that data transmitted to and from IoT devices is safeguarded against unauthorized access and breaches, thereby maintaining the integrity and confidentiality of the data [115].

V. CONCLUSIONS
The LoRaWAN and IoT technology has been successfully developed and has succeeded in recording microclimate data in coffee pine agroforestry, significantly increasing the accuracy of measuring air temperature, air humidity, and soil temperature, achieving an average accuracy of 100%.While the accuracy for soil moisture and light intensity stood at 81.23% and 82.56% respectively, the most notable advancement is the instantaneous data retrieval from an IoT server, a stark contrast to the labor-intensive traditional methods requiring manual collection from multiple dataloggers in the forest.The consistency in the ISSN: 2715-5072 283 Heru Nurwarsito, Development of Microclimate Data Recorder on Coffee-Pine Agroforestry Using LoRaWAN and IoT Technology sampling period maintained every 15 minutes as with previous datalogger systems, negates the need for additional testing.
The new system's ease and practicality of data collection, eliminating the need to physically visit and download parameters from each datalogger, and reducing the number of dataloggers required per plot from three to a more manageable number, significantly streamline the process.This not only makes data collection more efficient but also substantially reduces the labor and time involved, marking a significant leap forward in the pursuit of more efficient, accurate, and labor-saving agricultural practices.This system can be implemented across various agroforestry locations and is adaptable to a wide range of environmental conditions.This research emphasizes the transformative impact of advanced technologies in agroforestry, significantly cutting down labor and time, and offering vital insights into how macroclimate shifts and land use affect microclimates.It extends beyond enhancing precision agriculture to broader realms, including environmental monitoring and climate change studies, underlining its extensive relevance.Moreover, our findings reveal the complex interplay between local microclimates and larger ecological systems, stressing the urgency for sustainable land use in response to global climate change.
Challenges and Limitations: Throughout the research, several impediments were faced.The location of the Sensor Node in the forest, along with the thickening canopy of pine plants, resulted in a notable weakening of the LoRa signal, thereby reducing the range of signal transmission.Additionally, the efficacy of the light and soil moisture sensors was less than ideal, as their accuracy did not meet the anticipated standards.In light of these findings, it becomes crucial to prioritize the integration of sensors with superior accuracy in future endeavors, to guarantee both the dependability and exactness of the data collected.
Future Research Directions: Regarding accuracy, the new equipment shows varying results for different parameters.For air temperature, soil temperature, and air humidity, the new equipment has demonstrated excellent accuracy.However, for measurements such as light intensity and soil moisture, the accuracy is less than satisfactory, only reaching an accuracy of around 80%.This shows that although the new system offers major improvements in data collection methods, there is still room for improvement in the accuracy of certain parameters, in particular light intensity and soil moisture.

Fig. 5 .
Fig. 5. LoRa sensor node (a) on testing (b) on site Journal of Robotics and Control (JRC) ISSN: 2715-5072 278 Heru Nurwarsito, Development of Microclimate Data Recorder on Coffee-Pine Agroforestry Using LoRaWAN and IoT Technology

Fig. 7 .
Fig. 7. Soil Humidity in BAU and LC Fig. 8 Show charts display a typical pattern of air temperature, starting from the early hours of the day (04:00) and extending into the late afternoon (16:00).The temperature rises as the day progresses, peaking at around midday, and then begins to fall slightly as the day advances towards the evening.

Fig. 9 .
Fig. 9. Light Intensity BAU and LC Fig. 10 shows the result of testing the connection to the internet and LoRa.Heru Nurwarsito, Development of Microclimate Data Recorder on Coffee-Pine Agroforestry Using LoRaWAN and IoT Technology

Fig. 10 .
Fig. 10.Result of testing connection to the internet and LoRa Fig. 10(a) shows that the gateway communication is connected to the internet via 3G/4G cellular properly (Cellactive) and in Fig. 10(b) has received an IP number [90].LoRa communication is also connected to the Sensor Node, likewise, the LoRaWAN protocol is also active (LoRa and LoRaWAN icons are active).Likewise, the WiFi on the Gateway is also active (WiFi -active) and Fig.10(b)shows WiFi has received an IP number, this WiFi is useful for monitoring and setting up the gateway[91].Overall, the Dragino OLG02 gateway delivers in terms of connectivity and stability[92].Its reliability and efficiency make it suitable for various applications, especially in recording coffee-pine agroforestry microclimate data where high reliability is demanded[90].These test results provide confidence in its use in long-term applications.

ISSN
of Microclimate Data Recorder on Coffee-Pine Agroforestry Using LoRaWAN and IoT Technology required for data transmission from the sensor node to the IoT Server via the gateway and The Things Network.

Fig. 13 .
Fig. 13.Results of the sensor node and the things communication

TABLE I .
CONNECTION SENSORS TO SENSOR NODE Heru Nurwarsito, Development of Microclimate Data Recorder on Coffee-Pine Agroforestry Using LoRaWAN and IoT Technology Process of Microclimate Data Recorder with LoRaWAN and IoT Technology on Fig.
Sensor Node Installation: Strategic placement of IoT sensors is determined for each plot-specifically, the LC and BAU plots in this research.The selected locations should typify the average conditions of the plot and be shielded from any potential physical interference.•Data Acquisition: The microclimate measurements captured by the IoT Sensor Nodes are systematically logged on the IoT Server (ThingSpeak.com),ensuring data is available for display and download.The recording process is continuous, capturing data from the initiation of the setup through to the end of the operation.Real-time data from the IoT Sensor Nodes are transmitted to the Cloud Server via an IP network through WiFi, Ethernet, or 3G/4G cellular connections.
Heru Nurwarsito, Development of Microclimate Data Recorder on Coffee-Pine Agroforestry Using LoRaWAN and IoT Technology •

TABLE II .
SUMMARY LC AND BAU MICROCLIMATE DATA RECORDING

TABLE III .
MICROCLIMATE MEASUREMENT RESULTS

TABLE IV .
CALIBRATION RESULTS AND ACCURACY SOIL MOISTURE

TABLE V .
RESULT OF LORA SIGNAL RANGE AND QUALITY TESTING

TABLE VI .
THE RESULTS OF THE PACKET LOSS TESTS

TABLE VII .
SAMPLE DATA RECORD IN THE IOT SERVER (THINGSPEAK)