Design and Application of a Low-Cost, Low- Power, LoRa-GSM, IoT Enabled System for Monitoring of Groundwater Resources With Energy Harvesting Integration

The rapid expansion of Internet of Things (IoT) devices and applications has accelerated research in various areas of human development. However, the cost of commercial instrumentation impedes the momentum of technological growth in developing regions. In this study, a low-cost, low-power, wireless sensor network for groundwater monitoring (LWNGM) was developed to provide near real-time groundwater level data to support prudent decision making in groundwater resource management in Zanzibar, Tanzania. The system is based on the ATmega328P microcontroller platform and incorporates MS5803-14BA and MB280 sensors. The I2C communication channels between the sensors and the microcontroller were extended using 25-meter PVC cables. The electronics were potted and protected in a waterproof aluminum cylinder. The Arduino UNO wakes up in six-hour intervals for measurements and data-logging to the SD card, and at twelve-hour intervals for relaying data (in batches) to the LoRa gateway, before it goes back into a deep-sleep mode for the rest of the time (duty cycle < 1%). The average power consumption for the end node was 104.081mW. The power autonomy of all nodes is provided by a 3.7V, 5000mAh rechargeable LiPo battery, and a 9V, 600mAh rechargeable Li-ion battery, respectively, which are supported by 6V and, 3W solar chargers. The data processing and storage components, as well as the data visualization dashboard, were created using free and open-source software. The LWNGM was reasonably priced, ranging between $\$ $ 350 and $\$ $ 400. Practical evaluation determined that, the system is reliable and transferable, particularly in areas with a limited budget for hydrologic management.


I. INTRODUCTION
Groundwater is a consistent source of drinking water, irrigation, industry, municipal water supplies, and environmental health. Billions of people worldwide rely on groundwater as their primary source of fresh water [1], a sizable portion (more than 400 million) of Africa's urban and rural populations rely heavily on this resource [2]- [5]. Globally, there has been an increase in the number of unsustainable groundwater abstractions over the years [5]. Groundwater has become the The associate editor coordinating the review of this manuscript and approving it for publication was Shaohua Wan. most accessible source of freshwater, because of the degradation of the level of freshness and safety, as well as the difficulties in accessing surface water [6]- [8]. Increased population growth, economic and industrial development, urbanization, and climate variability are all contributing factors to water scarcity in many aquifers. As a result, groundwater levels are declining in various parts of the world [9], [10]. In Sub-Saharan Africa (SSA), there are noticeable declines in groundwater, and it is estimated that many African countries might encounter water shortages by 2025 [11].
Better water resource management is a key concern in research and technological development [12]. The need VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ for timely, cost-effective, and energy-efficient groundwater monitoring is a significant challenge worldwide [13], [14]. However, there is data scarcity in many parts of the world [7], [15]. The problem is exacerbated in SSA, where there is a lack of long-term data and reliable infrastructure for groundwater monitoring and management [7], [16]- [18].
Nonetheless, a small amount of accumulated data suggests that SSA aquifers are declining locally [19]. This also calls for improved approaches to freshwater resource monitoring in order to maintain human and ecosystem health [20], as well as improved estimation of storage, abstraction, and replenishment amounts [21]. The advancement of ICT and communication technologies has created numerous opportunities to improve the management of natural resources. These new and appropriate technologies can provide useful information that aids in reducing the water crisis [6], [11], [22]. WSNs have a wide range of applications, including industrial [23], [24] smart cities [25], [26], traffic control [27], [28], healthcare [29], [30], agriculture [31], [32] and environmental monitoring [33], [34]. Self-powered WSNs deployed in remote areas and that provide data in a near real-time manner can potentially revolutionize groundwater table management. A comprehensive explanation of the various applications of WSNs for scientific and social purposes can be found in [35].
However, the high cost of these conventional commercial components reduces the rate of adoption of sophisticated WSN apparatuses in many fields [34], [36]- [39]. This has resulted in the emergence of low-cost wireless sensors (LCS), which provide a suitable alternative to the scientific community [34]. As a result, this technology is rapidly advancing, providing numerous benefits to beneficiary countries. Most mainstream LCS designs are restricted to above-water environments, most likely because of the difficulty in fully waterproofing the electronics. Notably, despite the lower costs and rapid adoption of LCS in various fields, deployment of these solutions in developing countries is uncommon [34], with technical and financial reasons among the barriers preventing wider adoption of LCS on that side of the world [36]. In general, the growing applications of LCS have seen a limited number of studies that provide open data in their reality and do not produce information for scientists and other potential stakeholders [38], [34].
It has been reported that low-cost sensors have been redesigned to provide more scalable and manageable instrumentation. The redesign of LCS has several advantages, including increased environmental spatial and temporal coverage, lower cost per sensor, and customization to a specific physical setting [38]. The simplicity, accuracy and robustness of these sensors have paved the way for promising alternatives in environmental monitoring [34], [40]. Furthermore, this has prompted more research and the development of scientific tools for monitoring environmental phenomena. Despite this, a better approach to providing and utilizing power and energy to the WSN is required [41], [42]. One widely accepted method for extending the life of a network is imposing restrictions on node operations [43], [44]. Another potential solution to the energy problems of WSNs is to harvest ambient energy. Solar energy harvesting is dependable and has a high energy capacity [45], [46]. The combination of the low-power scheme and energy-harvesting technology provides a solid solution for self-sufficient WSNs.
Hydrological data loggers are normally expensive. As a result, the adoption of IoT-based sensing applications in developing countries has slowed. According to studies, low-cost and open-source resources open up new avenues for hydrologic management and monitoring. Surprisingly, this instrumentation is a strong tool that allows scientists to adjust and tailor sensors to specific hydrological research needs [36]. The redesign of sensors used in time-series monitoring of groundwater depths provides an opportunity to improve research and development, particularly in areas where data and data collection infrastructure are limited.

A. PRIMER ON LoRa RADIO TECHNOLOGY
Long-range communication (LoRa) is one of the most rapidly evolving wireless technologies, based on low-power widearea networks (LPWANs) and owned by Semtech [47]. It is intended to support the chirp spread spectrum (CSS) and forward error correction (FEC) with a large number of parallel channels. In this context, devices operating at different data rates can operate at various payload sizes ranging from 2bits to 255bits at a maximum rate of 50kbps.
LoRa is defined by the LoRa-Alliance [48] as a wide area network (LoRaWAN TM ), an open standard that is rapidly expanding. It operates in unlicensed bands (433, 868, or 915 MHz), but it has several advantages over other LPWAN-enabled protocols. These advantages include lower energy consumption and network security (end-to-end encryption). The basic LoRaWAN network architecture is star-of-stars, in which end-devices communicate with gateways via LoRaWAN. A network server is normally connected to a higher throughput network (WiFi, Ethernet, 3G or 4G) at the far end of the LoRaWAN and receives raw LoRaWAN frames from the end devices via the gateway. The FEC, bandwidth (BW), and spread factor (SP) are the three most important LoRa parameters to configure [49]. These parameters have a significant impact on network performance, with BW having the most sway.
Normally, one or more radio transceivers connect the two sides to the field nodes and the gateway. RFM95W is a widely used, low-power LoRa enabling transceiver. It consumes little current and is resistant to interference [50]. Table 1 presents the typical RFM95W LoRa modem specifications.
One or more radio transceivers are typically used to connect the two sides of the field nodes and the gateway. RFM95W based LoRa transceivers are not only recommended for its low power, but also for its impervious to interference.
Despite technological advancements, there are only a few telemetry-enabled water table depth monitoring systems [37]. There has always been a demand for simpler The principal goal of this study is to create and evaluate a low-cost, low-power, self-powered IoT-based water table depth monitoring system to aid in responsible groundwater management in Zanzibar, Tanzania. In this laboratory and field study, the WSN system was designed to provide near real-time water table data by utilizing LoRa and GSM network connections as well as solar energy harvesting. The deployment of the LWNGM to monitor Zanzibar groundwater tables is an important step toward efficient resource management in this region. Solar energy harvesting with low-power components generates a positive energy balance and improves the system's network sustainability. The proposed system visualizes and shares data with the community via an interactive web dashboard.

B. RELATED WORK
The adoption of low-cost instrumentation in wireless sensor technologies has significant potential. In recent years, the Internet of Things (IoT) has gained traction in environmental research. The application of WSN to surface water management has received a lot of attention [51]- [54] but less attention has been paid to its application in groundwater resources [33], [55]. According to previous studies, there are a limited number of deployments for low-cost groundwater sensing applications in both developed and developing countries [34]. Subsequently, we review studies on the subject and highlight some of the most recent ICT-enabled advancements in groundwater table management. Some studies have focused on the use of WSNs for groundwater resource monitoring [55], in order to address the lack of sufficient groundwater information for viable decision making.
In one of the earliest and closely related work, Anumalla et al. [56] studied pressure sensors and field programmable arrays were used to monitor the levels of groundwater tables in Western Nebraska aquifers in the United States. To relay data from a remote field to the data processing unit, the authors used a 2.4 GPRS/GSM communication scheme. The collected data were disseminated via a web application and text messages.
Calderwood et al. [37] created an open-source, low-cost WSN for real-time groundwater management using cellular network telemetry. The system consists of a proprietary data collection unit and an open-source data handling and visualization web application. Furthermore, Chan et al. [38] proposed a groundwater observatory model that includes a low-cost probe made with low-cost pressure sensors (NXP MPX5010DP and MS5803-02ba) to measure water table depths. The submersible sensor is housed in a waterproof (aluminum tube) enclosure and a common logger in a separate open to air enclosure sample atmospheric pressure. In that work, the authors established that the redesigned sensor performed better with accuracy, which was closely correlated to a commercial version.
Furthermore, a study [57] investigated the application of wireless sensors in a submersible environment, in which a low-cost Arduino-based data logging platform is proposed for monitoring drip rates and water flow in a flooded cave. The electronic components were housed in a 2inchies Polyvinyl chloride water pipe, and the system was powered by three AA batteries.
In this study, we created and tested a groundwater monitoring platform based on low-power, low-cost sensors, open-source tools, and low-power solar energy harvesters. The system periodically logs the water table depth data to an SD card on site, and then relays the recorded data to the LG01 LoRa gateway in batch, twice a day. This study will broaden the regional and global understanding of simple and low-cost WSN technology for hydrology management. It will also improve evidence-based consultation to assist decision-makers in making better decisions for sensible water resource management. Table 2 summarizes the analysis of the works on related topics.
According to Table 2, most of the analyzed studies used commercial pressure transducers and did not provide information on the overall cost, energy, and power analysis of the solutions reported in these studies. It is also evident that lowcost, long-distance communication technology (e.g., LoRa) were not used. Instead, high-power, high-cost networks were used.

C. CONTRIBUTIONS
Our key contributions include: • Conceptual design of low-cost, low-power, autonomous WSN for groundwater monitoring based on nonproprietary software.  • Developing an energy-harvesting wireless sensor network for continuous and near real-time monitoring of groundwater.
• Developing an integrated system that combines sensor-based remote monitoring with downstream units for open data sharing with policymakers, scientists, and the general public.
• A practical analysis and evaluation of the cost and energy expenditure for the water table monitoring model in order to better understand the cost and energy implications of affordable WSN technology.

D. ORGANIZATION
The remainder of this paper proceeds as follows. In Section II, we describe the materials and methods used in the current investigation. The experimental results are presented in Section III. Section IV presents the discussion of the experimental results. The limitations of this investigation are outlined in Section V. The study's conclusions and future work are outlined in section VI. Lastly, Table 3 provides the list of the abbreviations used in this article.

II. MATERIALS AND METHODS
In this section, we provide a detailed elucidation of the field sites, materials, and methods utilized for this investigation.

A. STUDY SITE DESCRIPTION
Bandamaji station is found in Donge Mnyimbi at −5 . 968399, 39.250488, with an elevation of approximately 37m in Zanzibar, Tanzania ( Figure 1). This area is approximately 25 km from the Zanzibar stone town. The groundwater observatory station is under the Zanzibar Water Authority (ZAWA) [59], [60], a government organization responsible for the management and distribution of water supply in the Isles. The station is situated approximately 87m from one of the huge ponds in Zanzibar. The majority of the people in Mnyimbi and nearby villages get their water from drilled wells.
Groundwater is the primary source of fresh water for more than a quarter (25%) of Tanzanians [61], and is the primary source of water (more than 70%) in the Zanzibar Islands [62], [63]. However, according to some studies, groundwater extraction in Zanzibar is unsustainable, and some boreholes are no longer operational [59], [64], [65]. At the end of each month, ZAWA monitors patrols across the country to collect water quality and quantity measurements from bored observational wells. Normally, the only available water table depth-monitoring tool is the beeper tape. These patrols are time-consuming, human-resourceintensive, and material-resource-intensive. Current monitoring practices and frequencies have a significant impact on the quality and availability of continuous water table data. As a result, there is a need for affordable and continuous groundwater monitoring in Zanzibar [59], [64].

B. DESCRIPTION OF THE SYSTEM DESIGN AND REALIZATION
One of the driving forces behind this study's attempt to create a WSN-based platform for monitoring of variations in water table depths is technological advancement in low-power sensors and telemetry. The system is intended to have low power and low cost in nature. To achieve this goal, the system comprises four low-cost, low-power main components: the terminal unit (end node), gateway, network server, and cloud application server. The low-cost and low-power components (shown in Table 4) are redesigned and used to realize the intended system.

1) GATEWAY HARDWARE AND PROGRAM
The gateway (GW) is the connection point through which end nodes send data to the server. The Dragino LG01-P gateway (Dragino, Shenzhen, Guangdong, China) embeds a Semtech SX1276 LoRa module with an RMF95 chipset (Semtech Corporation, USA), and connects the LoRa wireless network to the Internet protocol (IP). This gateway supports LoRaWAN protocol on a single channel and controlled by the customizable OpenWrt Linux-based platform. It has a 100mA current rating and a 12V voltage rating. The gateway operates at 868 MHz with a 3 dBi gain antenna, receives sensor data via LoRa radio with an average sensitivity of -148 dBm, and relays it to the local server via a GPRR/GSM backhaul. The Quectel 4G LTE EC25-EU USB dongle (Quectel, Shanghai, China) was connected to the cellular network at 50Mbps and delivered downlink data at 150Mbps. A 9V to 12V DC voltage booster module (Shenzhen iSmart, Guangdong, China) was connected to a 9V, 600mAh Li-ion rechargeable battery and two 9V, 3 W solar panels connected in series to power the LG01 gateway at 12V. Li-ion batteries have several advantages over other types of batteries, but the most important reason they were chosen to power the gateway is their high voltage capacity and longer life. The software that controls the gateway is written in the C programming language in an open source Arduino Integrated Environment (IDE), downloaded from the Arduino website (Arduino Somerville, MA, USA).
The gateway relays data to the local server using the message queuing telemetry transport (MQTT) protocol. The protocol is well suited to the size and format of the message sent to the server, as well as the processing devices [18], [29]. The messages are formatted in JSON format for ease of reading and to reduce server load. Fig. 2 depicts the scheme used to collect and relay data from the field to the network server. The configurations for the gateway and the 4G LTE USB dongle were completed on a Linux-based console using a secure shell connection (SSH), web user interface, and AT command (via the default IP address 10.130.1.1).

2) FIELD SENSOR MODULE HARDWARE AND PROGRAM
An Arduino Uno R3 microcontroller (MCU) served as the foundation for the field-sensing node (Fig. 3). The MCU board communicates with the LoRa transceiver version 1.4 (Dragino, Shenzhen, Guangdong, China) and the   using a separate power source from a long-lasting 3V lithium coin cell battery [66], [67], whereas the micro SD card (SD) module is powered through a 3.3V pin of the MCU.
The ATmega328P microcontroller was embedded in an Arduino Uno. Uno has a voltage rating of 3.3V to 5V and a maximum current of 50mA, according to the datasheet. VOLUME 9, 2021 The RFM95W module on-board the Dragino transceiver (version 1.4) is specified to accept 3.3V or 5V input voltage. In this case, a 3.3V supply is used to meet the low-power scheme. The entire field node is powered by a rechargeable 3.7V, 5000mAh LiPo battery via a 3.7V to 5V DC power boost converter (Shenzhen iSmart, Guangdong, China), which is supplemented by a 6V, 3 W solar energy harvester. Because the applied power level (less than 12V) is safe for the MCU, it is fed to the Arduino via a 5V pin, avoiding any potential voltage regulator losses.
The program that controls the end-node was also developed using the C language in Arduino IDE, Arduino, Somerville, MA, USA. The Arduino UNO microcontroller is programmed to spend most of the time sleeping to save power and meet low-power operational constraints.
Every six hours (6h), the RTC sends triggers (programmable interrupts) to wake up the MCU, allowing the water table depth sensor and atmospheric pressure sensor to perform measurements (see Figure 2). Before the data was temporarily logged into the SD card (16 Gb ScanDisk) as a CSV file, each record was timestamped and the measuring node identification number was attached. The end node returns to sleep. The RTC wakes up the MCU every twelve hours (12h) to initialize and read data from the SD card. The LoRa shield is then activated to send values to the gateway. After successfully sending the data, the LoRa radio is turned off. Then the end-node returns to sleep. In this scheme, the end node spends the majority of its time in the low-power mode.

3) PREPARATION OF WATER TABLE DEPTH PROBE
The following procedure was used to adapt the MS 5803-14B sensor (TE connectivity) for the desired task. To make the sensor and the I2C differential connector (PCA9615) waterproof, they were potted in epoxy resin. Following the sensor and the I2C differential connector (PCA9615) waterproof, they were potted in epoxy resin. Following the wired connection of the PCA9615 and the MS5803 sensor, both devices were enclosed in a watertight metallic tube measuring 9.5cm (3.74in) length and 4.5cm (1.772in) diameter for waterproofing reinforcement. A 6mm hole was drilled at one end of the metallic tube to expose the pressure measuring diaphragm to the water in the well. Another 6 mm hole was drilled on the opposite end of the tube to allow us to draw in the UTP cable that connects to the differential I2C breakout that uses the PCA9615 integrated circuit, as shown in Fig. 4(b). This cable connects the sensor to the microcontroller board via two I2C extenders (PCA9615 converters). The tube was also potted to prevent water from leaking through the joints and drilled holes. The MBE280 climatic pressure sensor was epoxy-potted and hung 3m from the top of the well casing in the bored well. As shown in Fig. 4(d), the Arduino UNO board, LoRa shield, and all connected electronics were enclosed in a waterproof PVC enclosure. The unit was mounted on a pole 1.5m above the ground, corresponding to the height of the end node. This position allowed the 868 MHz LoRa board's 3dBi gain antenna to establish a line of sight with the 868 MHz GL01-P LoRa gateway's 3dBi antenna, which was positioned 3m above the ground.
The three common bus protocols for communications between digital sensors and microcontrollers are the serial peripheral interface (SPI), one-wire, and integrated-integrated communication (I2C). All of these protocols are supported by both hardware and software libraries. The SPI and one-wire protocols can transfer large amounts of data at higher data rates, but they have drawbacks such as the SPI requiring dedicated communication pins and a one-wire with complex data synchronization at the receiver side. Moreover, the one-wire scheme is unpopular among hardware manufacturers and is susceptible to cable capacitance and noise. Despite the fact that the I2C has slow data and a shorter data transfer distance (<1m) [57], we chose it for prototyping because of its ability to share and save communication pins. The most difficult task in the redesign and preparation of the end device was to pot the sensor and the I2C differential interface with epoxy for underwater applications. Although the diaphragm of the MS5803 is contained and protected by a stainless steel cap, it may be easily damaged if it comes into contact with glossy and sticky materials such as the potting epoxy resin during the potting process. Several devices were damaged during the potting and testing phases before we came up with a viable solution. For example, when we potted and enclosed the MS sensor in a plastic container and housed the container in a PVC cylinder (see Fig. 4(a) and 4(c)), the attempt was unsuccessful, allowing water to enter and damage it.
(Sparkfun, Electronics, Colorado, USA) were used on Cat 6, UTP cable to overcome the limitation of the I2C protocol (capacitance effects on the signals increase with cable length). To extend the wire up to 25m, one differential convertor was attached at each end of the cable (see Fig. 5). Unlike most of the studies that used the MS5803 sensor family with cable length <10m [38], [57], [68], this study successfully applied MS5803-14BA with a cable length of 25m and overcome the limitations of the I2C protocol. As a result, a high-pressure sensor (MS5803) could be installed in the borehole at a depth of 15 m below ground. RJ45 connectors were used to connect the PCA9615 devices to both ends of the UTP cables. The serial data line (SDA), serial clock line (SCL), 3.3V input line, and ground terminal point (GND) on the PCA9615 device correspond to the four connection pins on the MS5803 sensor. Hence, only four of the eight cores of the UTP cables were used to transfer data between the sensor and the UNO board via PCA9615 devices using the I2C protocol. Likewise, MBE280 used the same connection arrangements and protocols. Potting was done to protect the sensor from water and moisture during the construction of the barometric pressure probe using a BME280 sensor (MBE), but the length of the cable was set to 10m, which is significantly shorter than the length of the underwater MS5803 cable. This is primarily due to the fact that the BME280 for atmospheric pressure measurement is hung inside the borehole three meters (3m) from the borehole casting rather than being submerged in water.

4) DATA CORRECTION AND STORAGE DESCRIPTION
The local server (LS) receives sensor data from the LG01 gateway twice a day via a wired connection. When data are received from the gateway, the Python script written in Python 3.6.6 Integrated Development Environment (IDE) runs to perform data processing by enumerating daily averages from raw data and then correcting the data for the influence of cable length and barometric pressure. The calculations of the measured water table depths was carried out in the following manner. Each averaged value of the water column pressure was first compensated for the average value of the atmospheric pressure using (1).
where W d (t) refers to the depth of water at time t, P w (t) is the water column pressure on the submersible sensor at time t, and P b (t) ambient pressure at time t. We also need to calculate the actual length of the cable (C l ) attached to the sensor. The (C l ) is computed in (2).
where C l (0) refers to the length of the cable at time t = 0, P w (0) is the pressure of the water column above the submersible sensor at time t = 0, and D w (0) is the depth to water at time t = 0. From (1) and (2), the actual water table height is subsequently obtained as follows.
where A h (t) refers to the actual depth of the water table at time t, S d is the average sea level data in the study area. The processed groundwater data are saved in the MySQL database. MySQL is a well-known, open-source, highperformance database that can be used for both on-premises and cloud-based IoT applications [69]. The data are then copied and uploaded to cloud storage for backup, sharing, and visualization (as explained in the next subsection). The database design allows for scalability, allowing for the addition of data from new observational stations. It can handle data from multiple stations while requiring only minor changes to the database configurations.

5) CLOUD SERVER AND DATA VISUALIZATION
Sharing information among stakeholders and end users is a significant step toward resource management coherence [34]. The LGWMN cloud-based web portal was created to allow data sharing with potential stakeholders. The MySQL-powered website was created using the PHP and Java scripts. The monitoring dashboard has four primary functions: A map that allows the user to navigate the location of the borehole well, charts that show the trends and patterns of the water table depth variations over a specified period, and downloadable data in a CSV file format. The database also includes a configuration with information about the location and data rendering.

6) ENERGY AUTONOMY OF THE LWNGM
Energy autonomy is a critical requirement for IoT systems, particularly those deployed in remote and difficult-to-reach locations [70]. The chosen solar panels have a 3W, 6V solar VOLUME 9, 2021 charger that serves as a backup to a 3.7V, 5000mAh LiPo battery (Fig. 6) that powers the end node. The gateway is powered by a DC-to-DC power booster with a constant output voltage of 12V and a current rating of 1A. This booster is linked to a 9V, 600mAh Li-ion battery, which is recharged by two mini solar panels (6V, 3W each) connected in series to produce a total output voltage of 12V. Despite the fact that we have two solar energy harvesters, we now only consider the estimation of charge and discharge statistics for the end node solar panel and battery. The CN3791 charger module charges the LiPo battery via a connected solar panel. The module also protects the battery from overcharging. The open circuit voltage (V cc ) of the solar panel is 6V, the specific load voltage (V l ) is 4.2V, the short circuit current (I cc ) is 2000mA, the typical current at load (I l ) is 500mA, and the maximum power is 3W. When fully charged, the LiPo outputs 4.2V, which is connected to the Arduino board's 5V pin. This pin was selected as the power input pin for the microcontroller.
Weather conditions are one of the most important factors influencing the performance of solar panels [71]. According to the data we collected on the power efficiency of the solar panel connected to the end-node, the panel operates at 5.5V/338mA, 4.3V/205mA, and 4.0V/123mA for sunny, cloudy, and rainy hours, respectively. Tanzania has a high level of solar energy, with 2800-3500 hours of sunlight per year and global horizontal radiation ranging from 4 to 7 kWh per m 2 per day [72]. Based on this information, we assume that the study site has an average of eight sunny, one cloudy, and one rainy hours per day. The average energy (C av ) produced by the solar panel is then calculated using our solar performance data, as given in (4).
The results computed in (4) can be used to estimate the time required to charge the battery (t ch ); however, we must first calculate the amount of energy produced by the battery. Given a battery with a charge capacity (Batt cap ) of 5000mAh and a voltage rating (Batt vt ) of 3.7V, the energy of the battery (Batt en ) as a function of Batt cap and battery voltage Batt vt is computed as given in (5).
The t ch is then calculated by dividing the battery energy by the energy produced by the solar panel, as shown in (6).
Batt en C av = 66, 600J 58, 483.8J = 1.139 days (6) According to the calculation in (6), it takes approximately 1.139 days (27 h) for the solar energy harvester to fully charge the battery. As a result, the LGWMN will be powered on a daily basis by this power source (solar charger).
The LWNGM architecture is depicted in Fig. 7, with the sensor devices connected to the microcontroller board via I2C differential interfacing and the RTC directly connected to the microcontroller's I2C connections. The SPI bus connects the micro SD card component and the LoRa breakout to the MCU. Underwater and ambient pressure sensors were installed in the well. A LoRa-based connection is provided between the LoRa breakout and the gateway. The GW is outfitted with a 4G LTE dongle that connects it to the network server, which is linked to the cloud-based application server. Rechargeable solar-powered batteries power the nodes. The local server handles data processing, whereas the cloud server handles data backup, sharing, and visualization.

III. EXPERIMENT EVALUATION AND TEST RESULTS
This section describes the process and results of an experiment related to this case study in the adoption of low-cost, low-power WSN-based equipment. The end node, gateway, and web dashboard were designed, built, programmed, and tested to realize the proposed LWNGM prototype. After the system was deployed in the field, it was evaluated. At the time of our prototype's deployment, there were no sensors in the case study, and monthly measurements were taken with a beeper tap. The tap is normally lowered into the borehole and makes a sound when it comes into contact with water.
We used a beeper tap to measure the depth to water prior to installing the electronic sensor in the Bandamaji observation well to establish a reference point for automatic measurements. Fig. 8(b) depicts the field node of the deployed system. Each water table depth and air pressure measurement, as well as the identification number of the associated measuring sensor and the timestamp generated by the DS3231 clock, are temporarily logged into the SD card memory by the node. The recorded values are then relayed to the gateway (shown in Fig. 8(a)) at the scheduled time before the data are transmitted from the gateway to the network server.

A. LWNGM SYSTEM DEPLOYMENT
The LoRa-GSM-based logger was deployed between May 2 and 15, 2021. The system continuously sampled and transmitted data to the local server over a two-week period. The locations of the end-node and the gateway were carefully chosen to provide the best possible line of sight through the area with minimal vegetation at the study site.
At the distance of 125m from the end-node, the gateway is located in the doors near an open window. The vegetation and tall trees slightly shaded the line of sight between the gateway and end nodes. The line of sight is clear in most of the time. Table 5) The deployment also considered the possibility of scaling up the network while retaining the single-hop topology. This allows for the addition of more end nodes to share the gateway while ensuring network longevity. To maximize the energy of the system, the solar energy harvesters were placed in areas where there was no shade or materials such as tree leaves that could block the surface of the solar panels.

B. CONFIGURATION, KEY PARAMETERS, AND NETWORK PERFORMANCE
The optimal efficiency for the LoRa link was achieved with key parameter settings of 14 dB, 4/5, 868 MHz, 125 kHz, and 7, respectively, for transmission power, coding rate, transmission frequency, bandwidth, and spread factor (see To evaluate the performance of our network, we sent  a series of packets from the end node to the gateway and computed the packet delivery ratio (PDR) for those packets. The PDR is calculated as the ratio of the total number of packets that successfully arrive at the receiver (gateway) to the total number of packets that leave the source (end node). We also measured the received signal strength (RSSI) and airtime for packet transmission in addition to the PDR. Table 6 and Fig. 9 depict the performance of the LWNGM system.

C. SYSTEM TESTING AND DATA
The deployment in the field allowed the LWNGM to be tested. The mean water level was enumerated in six-hour (6h) VOLUME 9, 2021  intervals of data sampling cycle and twelve-hour (12h) intervals of data forwarding cycle to provide daily average levels. Each send had an average airtime of 19ms. Fig. 10 depicts the   FIGURE 10. A plot of daily average water depths at bandamaji monitoring well over a two-week deployment period.
recorded daily average water table depths over the two-week period, and Fig. 11 shows a web dashboard that updates the groundwater depth data every six hours.
The front and back ends of the LWNGM web portal were designed to be flexible enough to accommodate data from additional observational stations. The user interactive map is being developed, which will allow the navigation and visualization of data from multiple stations.

D. COST AND SIMPLICITY OF THE SYSTEMS
The costs of the components used to construct the LGWMN are summarized in Table 7. It is worth noting that the prices of these devices vary depending on the supplier chosen. These prices include shipping costs. The system is simple and easy to replicate. Although the project consists of multiple domains, a moderate wireless network and electronics skills and tools can accomplish the development of the system presented here.
The total cost of the components used to construct the LWNGM was USD 310.168. This means that this system can be built for less than 400 USD.

E. ENERGY AND LIFETIME OF THE END NODE
The experimental evaluation of energy dissipation by the sensors and the general network is explained below. In all scenarios, we estimated the average power expense (data sampling state, data transmission state, and deep sleep state). We also estimated the lifespan of the battery that powers the end node. A battery that powers the end-node has voltage rating of 3.7V at power capacity of 5000mAh.
To calculate the energy expended by the end node, we consider the current drawn by each of the individual components at the various aforementioned states. According to the current ratings of the devices, the standby current of the pressure sensors is less than 0.15µA for MS5803 and 0.5µA for MBE280. The MCU's standby current was 28mA. The RTC was powered by a backup coin cell at 3V. 0.19A. The sleep currents for the UNO board, MBE280, MS5803-14BA, and LoRa transceiver breakouts are 27.9mA, 0.1µA, 0.1µA, and 1mA, respectively. The MBE280 sensors have an average data sampling duration of 1s at 1.8µA and the MS5803-14BA sensors have an average data sampling duration of 1.1ms at 1µA. Unlike writing to an SD card, the UNO takes an average of 7ms to complete at a current of 31mA. In contrast, the SD card draws an average of 0.11mA while sleeping. The sleep state consumed a total current of 28.0112mA in this case. The node remained in deep sleep (t sleep ) for 3598.653 s.
We can calculate the amount of charge consumed as the product of sleep duration and the current drawn while sleeping. As a result, the charge expended (C sleep , in mAs) was 100,801.869mAs. Similarly, the end node enters a data sampling state for a sampling time (t samp ) of 1.007s and the consumption (C samp ) of 31.282mAs. Here, we define the data-sampling state as the process of measuring data and logging it to an SD card. Furthermore, relaying the sampled data to the gateway consumes an average current of 28mA at a transmission time (t tx ) of 0.34s, with a total charge consumption (C tx ) of 9.52mAs.
The complete cycle of the operation includes both the active and sleep times of the end node. During duty cycle d, the amount of energy consumed by this node reaches a maximum value, which is given as.
where T refers to the total time spent in the entire cycle, t act denotes the time at which the device is in the wake state.
The LGWMS records two (2) measurements (N samp ) in each data-sampling period, with an average sampling time (t avsamp ) of 0.34s. The total charge consumption over the cycle (OC cycle ) is expressed in (8) and the battery cycle in (9).
The number of battery cycles that would be performed on this battery with a given battery capacity (Batt cap ) is.

Batt cycle =
Batt cap OC cycle (9) Because we need to estimate the battery's lifespan (L batt ), the number of battery cycles Batt cycle must be multiplied by the battery cycle time (t cycle ). The cycle time is defined as the sum of the sleep time (t sleep ), measurement time (t samp ), and data transmission time (t tx ) in seconds (10).
By substituting (8), (9), (10), and (11), the life span of the battery (L batt ) that provides energy to the end node is enumerated as follows.
Using the capacity of the battery used in the experiment and previous numerical values, (12) produces 177.948h, which is approximately equivalent to 8 days for the estimation of the battery's lifetime in hours.
The total energy expended by the end node (E T ) is the sum of the energy expended in data sampling (E samp ), data transmission (E tx ), and sleep mode (E sleep ).
Given that the end-node is powered by a 3.3V supply voltage and that the average sampling time is 1.007s, the energy expended in data sampling will be.
For the transmission duration of 0.34s, the energy consumed for relaying data to the gateway is enumerated as given below.
Because the node sleeps for 3598.653s, the energy spent while sleeping is.
Consequently, the total energy spent by the end node (E T ) per day is.
Based on the energy calculations, the end node's total daily energy consumption in both active and sleep modes was 7977.249 J.

IV. DISCUSSION
Groundwater monitoring on a regular and affordable cost serves as the foundation for estimating, assessing, and forecasting the quantity of this resource. The high cost of commercial instrumentation is one of the major impediments to the rapid adoption of WSNs in wider hydrologic applications, particularly in developing countries [17], [21], [24]. Ordinary water depth electronic sensors are relatively expensive. For example, the Van Essen diver sensor costs approximately $830, and the HOBO water depth probe costs approximately $495 per unit. Our redesigned water table depth probe, on the other hand, costs approximately $55. The use of potting of high precision electronic sensors and I2C extenders is essential for the success of the construction of water-depth probes for the LWNGM system. Moreover, the application of free and open source software has also bring down the establishment and operational cost for and may improve sustainability aspect of the LWNGM. This is consistence with the findings reported in [37]. Furthermore, the LWNGM development procedure is relatively simple and does not require advanced technical skills.
Incorporating user-redesigned LoRa tools in the monitoring of environmental phenomena, on the other hand, lowers the overall cost of the system while improving efficiency and reliability. The game changer that has provided a wider community with LoRAWAN tools is an open-source instrument and software [73].
The redesign of off-the-shelf instruments and the deployment of low-cost WSNs allow communities and organizations with limited resources to adopt this technology more efficiently. The LWNGM offers another opportunity for wider adoption in hydrology and other fields at a cost less than ($500) comparable commercial solutions (i.e., monitoring systems that use the Van Essen water depth probe, which costs approximately $830).
Sending the sensor node into a sleep state lowers the duty cycle and increases battery life, which is especially important in low-cost and low-power nodes. Ideally, with a sleep mode that brings low duty cycle (<1%), our system used approximately 1.343 percent of the battery energy. This is consistent with the findings in [71]. Although it takes approximately 1.1 d to fully charge the chosen battery using a mini solar cell, it can power the end node for approximately 8 days before it needs to be recharged. Connecting two 6V panels in series to charge the 9V battery that powers the gateway via a 9V-to-12V booster, on the other hand, produced a promising resource optimization result. This not only saved money, but also allowed the gateway to be deployed in off-grid areas. This dependable source of power also allows for the prevention of data loss due to power outages.
Fine-tuning and configuration of network parameters can result in the effective use of LoRa technology for efficient communication. The tuning parameters, among other things, allow for the optimization of power consumption, signal distance, and data rate. The greater the SF, the greater the PDR, and the greater the observed airtime. Similarly, as the airtime lengthens, so does the power budget [73].
Furthermore, the topography and local environment at the site influence signal reception quality. Despite its strong modulation technique, LoRa is sensitive to the presence of reflections and obstacles. Mnyimbi is a rural area with little vegetation and fewer signal obstacles and reflectors. These favorable conditions allowed for the majority of the time to be spent installing LWNGM nodes in positions that maintain a clear line of sight between LWNGM nodes. The line of least resistance to tree leaves was established at 1.5m for the end node and 3m for the LoRa-4G-based gateway.
Despite the slight signal attenuation (due to the tree branches moving with the wind), the LoRa signal was found to be stable and reliable. No significant impact on the received signals was observed due to the moderate weather conditions, with the mean air temperature and onboard temperature both below 40 • C and rain rates below 100mm/h. The results of our experiments show that signals from the LWNGM's end node arrive at the gateway node correctly (RSSI = 83 percent) with a low number of retransmissions. The vast majority of packets arrive at the gateway correctly (PDR > 80%) and with a reasonable airtime (40ms). This was accomplished with SF7, CR4/5, a TX of 14 dB, a BW of 125, and the CRC enabled. Two possible explanations for these results are the distance (125m) and the slightly clear line of sight (light vegetation) between the gateway and the end node.
The accuracy of the samples collected by the sensors has a direct impact on the measurement quality. According to the results, the MS5803-14BA sensor data deviated by 1.1 % from the standard measurement performed with a beeper. Furthermore, the MBE280 data deviated from standard atmospheric pressure by 0.37 %. The linear calibration produced the most accurate results in filling the gaps between the standard measurements and the Arduino-based measurements in this case. As a result, data collected by the LWNGM system has become more reliable. This is consistent with the results of the study in [37], which confirms the applicability of linear calibration in sensor data correction. Furthermore, in order to maintain the accuracy of the measurements over time, the effective cable length must be recalculated every six months [36].
Unlike manual data collection, where the cost of labor and field visits is a significant barrier to informed groundwater management, low-cost, automated monitoring with energy harvesting creates the potential for continuous observations, especially in low-and middle-income countries. Similarly, the quality and reliability of data collected by LWNGM are far superior to data collected using traditional methods. This is due to the fact that in traditional data collection practices, errors are easily introduced, and missing data points are a common occurrence.

V. STUDY LIMITATIONS
The use of a single-channel gateway limits the number of end nodes that can communicate with the LoRa-enabled gateway simultaneously. A wireless network scaled to a large spatial area typically includes several nodes that must constantly communicate with the gateway at all times. One or more multichannel gateways may be required in this context. Similarly, only one observational well was used for this study, which does not adequately represent a large distribution of bored wells in the area surrounding the studied borehole. Furthermore, a longer data collection period is required to gain a deeper understanding of the characteristics of aquifers. Two weeks of data are insufficient to generate comprehensive information that is free of the bias caused by the pumping effect of nearby wells.

VI. CONCLUSION AND OUTLOOK
An autonomous low-power, low-cost IoT-based system with energy harvesting was designed and evaluated to provide a proof-of-concept for practical monitoring of water table depths. The LWNGM consists of four parts: data acquisition, data management, energy harvesting and management, and data storage and visualization. The developed low-cost solution is built on an open platform. The LWNGM generates critical information for more efficient assessment and management of groundwater tables. Furthermore, the system's information down streaming capability allows for additional research in the fields of hydrology and sensor networks.
We potted the electronic sensor and extended the I2C-enabled communication channel up to 25m via a PVC cable, for underwater application in the borehole. The system runs on batteries supported by the reliable tiny solar cells. The outstanding efficiency and low cost of redesigned sensor nodes and energy harvesters have evaluated to be the promising alternatives to conventional instruments.
The prototype system was used to monitor groundwater wells at the Bandamaji station in Zanzibar, Tanzania. The system is easily transferable, even to least developed countries, because it is built with low-cost components and does not require advanced technical skills. The system performed admirably and allowed for near real-time monitoring of changes in water table depth; in the future, we intend to extend this automatic monitoring system to all groundwater monitoring wells in Zanzibar. This will be accomplished by deploying multichannel outdoor LoRa gateways to connect several end nodes spread across the Zanzibar Islands. We also intend to develop and incorporate low-cost water quality sensors into the LWNGM system in order to enhance the monitoring and assessment of the aquifers.

ACKNOWLEDGMENT
The authors would like to thank Zanzibar Water Authority for their invaluable assistance throughout the study. They would also like to thank the anonymous reviewers for their invaluable suggestions and comments on how to improve this article. VOLUME 9, 2021