# An Autonomous Wireless Device for Real-Time Monitoring of Water Needs
## 4 Results
### Experimental Laboratory Setup  
In the first experiment, real measurements of consumption were taken in the different modes of operation, as well as the time that each one remains active. We used a Digital Multimeter JHS MY-64 [39] to realize the current measurement. To ascertain the state of the end-device, we added a light-emitting diode (LED, sleep mode indicator) to monitor it. The consumption shown takes all the parts of the node (antenna, all sensors, processing, etc.) into consideration. The measurements were performed by averaging. The statistical procedure of one sample \(t\)-test was used to determine if the sample of observations could have been generated by a process with the experimental average value. The results obtained are summarized in the table below.  
In Table 3, we can see how the node spends most of the time in \"sleep,\" mode with a consumption of 0.036 mA. This consumption increases up to 9.4 mA while the microcontroller is in active mode, acquiring data through the sensors. Finally, while the information is sent through the LoRa module, the consumption is 22 mA for approximately one second.  
From the data shown in Table 3, we can calculate the average device consumption for this time interval between data collection as follows:  
\[Consumption=\frac{9.4\text{ mA}\times 4\text{ s}+22\text{ mA}\times 1\text{ s}+0.036\text{ mA}\times 88\text{ s}}{93\text{ s}}=0.674\text{ mA}\]  
Figure 4: Node with ECH2O soil moisture sensors.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**MODE** & **CONSUMPTION (mA)** & **TIME (s)** & **\% TOTAL TIME** \\ \hline Active & 9.4 & 4 & 4.30\% \\ \hline Sending & 22.0 & 1 & 1.07\% \\ \hline Sleep & 0.036 & 88 & 94.62\% \\ \hline \hline \end{tabular}
\end{table}
Table 3: Average power consumption (mA) for the different modes.  
Once the average consumption of the node is obtained, and knowing the capacity of the battery, we can calculate its theoretical duration:  
\[Duration=\frac{2000\text{ mAh}}{0.674\text{ mA}}=2967\text{ h}=123\text{ days}\]  
As will be seen later, this theoretical duration is only useful for performing a first estimate. Normally, the actual duration of the battery is well below the theoretically calculated value.  
The second test had as its objectives obtaining the discharge curve of the battery and its real duration. Thus, measurements of the voltage supplied by the battery were taken periodically during the operation of the device. In this way, we were able to estimate its state of charge, as well as the time for which the device can operate without needing maintenance or battery change. Next, the voltage values measured against the number of days that it was in operation were plotted on a graph.  
As can be seen in Figure 5, the voltage supplied by the battery starts at 4.1 V and decreases rapidly during the first few days. Meanwhile, as we get closer to the nominal voltage of the battery (3.7 V), the curve decreases more slowly toward this value. Once the voltage drops below the nominal value of the battery, it drops drastically. This behavior is typical of lithium batteries, as is the case here.  
During the experiment, the node ran for a total of 72 days, during which it took measurements every 93 s. In this time period, more than 49,000 measurements were taken.  
If we compare the battery life obtained in the real experiment with the theoretically calculated one, we can verify that its real life is approximately 60% of the theoretical one. These data may vary depending on the characteristics or battery and environmental conditions. For example, in [1], a value of 70% is taken to estimate the duration of the battery. In contrast, [6; 13; 38] did not use any correction factor to calculate battery life.