Analysis and Design of a Wireless Sensor Network Based on the Residual Energy of the Nodes and the Harvested Energy from Mint Plants

Nowadays, the use of sensor nodes for the IoT is widespread; nodes that compose these networks must possess self-organizing capabilities and communication protocols that require less energy consumption during communication procedures. In this work, we propose the design and analysis of an energy harvesting system using bioelectricity harvested from mint plants that aids in powering a particular design of a wireless sensor operating in a continuous monitoring mode. The system is based on randomly turning nodes ON (active nodes) and OFF (inactive nodes) to avoid their energy depletion. While a node is in an inactive state, it is allowed to harvest energy from the surroundings. However, while the node is harvesting energy from its surroundings, it is unable to report data. As such, a clear compromise is established between the amount of information reported and the lifetime of the network. To finely tune the system’s parameters and offer an adequate operation, we derive a mathematical model based on a discrete Markov chain that describes the main dynamics of the system. We observe that with the use of mint plants, the harvested energy is of the order of a few Joules; nonetheless, such small energy values can sustain a wireless transmission if correctly adapted to drive a wireless sensor. If we consider the lowest mean harvested energy obtained from mint plants, such energy can be used to transmit up to 259,564 bits or can also be used to receive up to 301,036 bits. On the other hand, if we consider the greatest mean harvested energy, this energy can be used to transmit up to 2,394,737 bits or can also be used to receive up to 2,777,349 bits.

sensor nodes are fitted with an on-board processor for carrying out simple computations and to transmit only the required and partially processed data [3]. Thus, nodes are not always required to send all the acquired information to the sink node. This allows nodes to be working in a low energy consumption mode (sleep mode), during which their energy levels can be replenished if energy harvesting is enabled [4,5].
Green self-sustainable operation is one of the most important issues in today's low-power electronics for smart environments (IoT, smart skins, smart cities, etc.) [6]. Energy harvesting technologies from ambient power sources-mainly radio frequency (RF) ambient energy-have recently attracted significant attention since the operation time of devices can be extended or even the energy depletion of batteries can completely be avoided. In this sense, numerous energy harvesting systems, devices, topologies, and circuitries have been developed [7].
The design of this networks is influenced by many factors such as fault tolerance, scalability, production costs, operating environment, network topology, hardware constraints, and transmission media [1]. Energy consumption is also a critical factor in the design, and the use of batteries with finite energy levels entails a finite operation time. In some scenarios, power recharging or battery replacement can be a very challenging task. Ongoing research is aimed at providing energy harvesting solutions for powering wireless sensor which can offer a significant advantage as these provide sustainable solutions to their power needs [8].
The main tasks of a wireless sensor node are sense environmental phenomena, perform quick local data processing, and then transmit the data. Each task implies a corresponding power consumption. If energy harvesting is implemented, a transducer is responsible for harvesting energy from the surroundings. Before its usage, harvested electrical energy should be conditioned by specialized circuitry. Conditioned electricity can be used directly or stored in rechargeable batteries or supercapacitors.
Power consumption of a wireless sensor is of great importance because it is functioning entirely depends on the energy supplied to the wireless nodes. Indeed, the failure of a few nodes due to lack of energy would result in significant topological changes that imply rerouting packets and reorganizing the network. Hence, the conservation and management of power take major importance. For these reasons, current researches are focusing on the design of power-aware protocols and algorithms for wireless sensors [9].
In the present work, we propose the design, analysis, and study of a Wireless Sensor Network (WSN) that allows its nodes to be turned ON and OFF, i.e., nodes are not required to transmit all the acquired information. When nodes are in the low energy consumption mode, data is neither acquired nor transmitted to the sink node. Specifically, we focus on extending the system's lifetime by taking advantage of energy harvesting techniques. Hence, we include the energy harvesting capabilities in our analysis where energy levels of nodes in the OFF mode are replenished.
Furthermore, we focus on a scheme that extends the lifetime of the system by assigning a higher (lower) packet transmission probability to nodes with high (low) residual energy levels. This also entails that low energy nodes report fewer data to the sink node. Applications for the proposed scheme can be found in the cases where the network must operate for long times even if data reporting is reduced after long operation periods. For instance, when nodes are not accessible or placed in dangerous or remote locations like polar regions, radioactive zones, wildfire monitoring in forests, or even space exploration missions where the objective is to obtain as much information as possible from the environment for as long as possible, and if energy is scarce, conserve it as much as possible even if only occasional reports are available. We study the performance of such a system and the limitations of our proposal. Our main contributions are: (i) We developed our design of a card compatible with the Arduino IDE (ii) The card is designed for very low power consumption and has all in one: radio, microcontroller, antenna, and sensor ports (iii) A protocol based on residual energy available in the network to power the nodes (iv) A mathematical analysis based on Markov chains to determine the lifetime of the network (v) A detailed study to determine very accurately how much energy is needed to send a single bit. Â°( vi) An efficient electronic design without the need of a very sophisticated antenna for radio links. However, the simple wire was measured and characterized to determine the optimal length (vii) An open hardware architecture design where all card details are provided (viii) Low cost and reliable card design that, compared to Zig-Bee, is very cheap

Related Work
A wireless sensor is an electronic device equipped with certain characteristics of sensing and elementary functions for establishing wireless communication. These characteristics are governed by a basic computing system usually implemented in a microcontroller or a small microprocessor. In addition, a wireless sensor must possess capacities for efficient energy management and maybe the ability to harvest the energy from the surroundings, including solar, electromagnetic, or the energy from plants, see Figure 1.
In general, a wireless sensor is equipped with a small amount of energy stored in a battery or supercapacitor. The correct usage of this energy may lead to extending the lifetime of the wireless sensor. Eventually, such finite energy gets depleted, and the wireless sensor will be off the network until it acquires more energy in some way, for instance, by changing its batteries with new ones. This could be challenging if the wireless sensor is located in a difficult-to-reach position. In such cases, the network will lose nodes and eventually will be useless. Hence, determining the necessary power for 2 Journal of Sensors transmitting or receiving data is important for estimating the lifetime of the WSN. An estimation of the lifetime of a WSN can be obtained from a stochastic point of view, for instance, by using Markov chains [10][11][12][13][14], or from an energetic point of view [15][16][17] [18,19].
To estimate the energetic cost of transmitting/receiving data, we consider the following. By definition, the instantaneous electric power pðtÞ is the rate at which electric energy eðtÞ as a function of time is transferred to or from a part of an electric circuit [20,21], that is Cumulative energy E over a period of time T = ½t i , t f is the integral of the instantaneous power, Let us suppose that the instantaneous power p is a continuous function over the period T, then there exists an instant t m ∈ T such that where Δt = t f − t i is the duration of T and pðt m Þ has the physical sense of mean power in that period, which is denoted by Note that the mean power in T can be calculated from formulas (1) and (2), where Δe denotes the change of energy at the ends of period T, thereby W = Δe/Δt. By a unit of energy, we mean the energy necessary to perform a work by the wireless sensor (either transmit, receive, or sleep) during certain time. This includes, of course, the energetic cost of running some code by the microcontroller to control the communication tasks and to perform the corresponding networking functions. Let us assume that a wireless sensor performs a single operation of transmission or reception during a time slot of duration Δt slot seconds. Formula (4) provides a simple way to estimate the energy E Tx,slot , E Rx,slot , or E Sleep,slot per slot to perform such an operation where W Tx , W Rx , and W Sleep are the representative values of the power consumed during transmission, reception, or sleep, respectively. The rest of the paper is organized as follows: first, Section 3 describes the design of a wireless sensor; Section 4 presents the power and energy analysis in the wireless sensor; Section 5 is an analysis of the energy used by the WSN and the harvesting energy from mint plants; Section 6 develops the  Journal of Sensors mathematical model used to describe the system. The results are presented in Section 7 and finally our main conclusions.

Design of a Wireless Sensor
In this section, we show the design of a wireless sensor, including some simulations and related measurements. The objective is not to design a sophisticated device or to rival with some wireless sensors available in the market but to provide simple guidelines of design and to perform the measurements of energy and power necessary to evaluate its performance in a WSN.

Microcontroller Selection.
For the design of a wireless sensor, we employ the chip ATMega32U4, which is a lowpower CMOS 8-bit microcontroller, with an advanced RISC architecture. This microcontroller possesses 32 KBytes of in-system self-programmable flash program memory, 1 KByte EEPROM, 2.5 KBytes internal SRAM, and USB 2.0 full-speed/low-speed device module with interrupt on transfer completion, see Figure 2(a). Also, it possesses six sleep modes, namely, idle, ADC noise reduction, power-save, power-down, standby, and extended standby.
The microcontroller is set up in a stand-alone configuration, running with a 16 MHz crystal oscillator, see Figure 2(b). The configuration provides a set of pins that serve as I/O ports. These ports can be used for interfacing some sensors for sensing physical variables such as temperature, pressure, gases, presence, and light. If ports are configured as analog inputs, they internally use the analog-to-digital converter (ADC), which results in higher power consumption by the microcontroller.
The microcontroller can be programmed either by using the USB or SPI interface. USB programming requires a bootloader to enable built-in USB support. SPI programming does not require a bootloader, and well-known utilities such as AVRDUDE are available for programming the chip. For burning (flashing) a bootloader in the microcontroller, the SPI interface should be used as well.
3.2. Radio Chip Selection. The air interface of a wireless sensor involves a radio circuit for establishing wireless communications with other sensors of the network. There exist several commercial options that provide integrated solutions for configuring a wireless network like XBee, see Figure 3(a). XBee modules use the IEEE 802.15.4 networking protocol for fast point-to-multipoint or peer-to-peer networking; however, these modules have some drawbacks concerning the objectives of the present work. In the first place, they usually employ the 2.4 GHz ISM band for world-wide compatibility purposes. In this band of frequency, a wireless link reaches distances of some tens of meters in indoor environments [22,23] with some improvement in outdoors [24]. Some XBee modules improve their coverage range by transmitting with a higher power, like the XBee Pro that reaches up to 1.6 km in lineof-sight at 63 mW (18 dBm) [25], thereby increasing the overall power consumption of the module.
On the other hand, the 2.4 GHz ISM band is populated by the radiation of Wi-Fi and Bluetooth devices, as well as microwave ovens among others. These behave as interfering sources resulting in higher packet error rates [27][28][29], lower throughput [30,31], higher path loss, and fading [32]. For these reasons, some protocols and devices are moving to lower frequencies, which are less populated and offer higher coverage ranges. One example is found in the IEEE 802.11ah WLAN protocol, which uses the sub-1 GHz license-free ISM bands [33]. The XBee-PRO 900HP module works on the band of 902-928 MHz and reaches up to 15.5 km in line-of-sight by transmitting 250 mW (24 dBm) at 10 kb/s, [34]. Though the range of this module is quite broad, its power consumption is relatively high (290 mAmax × 3:6 Vmax = 1:044 Wmax).
Another drawback of the XBee modules is the impossibility to write custom firmware for specific applications. Though XBee modules are highly configurable, it is not possible to modify the way they transmit a single byte, not to mention his high price. On the opposite side, some RF modules are very cheap and lack firmware, thereby the user needs to write custom software to operate the modules via microcontrollers. An example is the RF modules of Figure 3(b), which can work in the ISM band of 315 MHz or 433 MHz. The transmitter (TX) module is indeed a simple Colpitts oscillator that is turned on/off by a transistor configured as a switch, which results in OOK modulation. The receiver (RX) module is a simple super-regenerative receiver equipped with an op-amp as a comparator for detecting digital symbols. RX and TX modules consume up to 20 mW and 10 mW, respectively, [35]. Even without antennas, the wireless link can be established with a range of some meters, but a single strand of wire as an antenna in the TX module may increase the coverage range to some tens of meters. Indeed, the coverage range can be extended to a few kilometers by using high gain well-matched antennas in both modules. Unfortunately, the PCBs of these modules are not designed to accommodate a proper RF connector for plugging external antennas. Another drawback is the large amount of source code for equipping the link with the essential functionality for deploying a basic WSN, thus occupying most of the microcontroller's program memory.
At the midpoint, we found commercial wireless modules based on the chips of the nRF24 Series from Nordic, which work in the 2.4 GHz ISM band, see Figure 3(c). Other popular wireless modules based on the CC1101 chip from Texas Instrument work in the sub-1 GHz ISM bands [36] at lowpowers. Such modules are highly configurable, and custom software can be written from standard libraries. Furthermore, their coverage range is quite high when using highgain well-matched antennas and transmitting at the maximum output power (up to 0 dBm for the nRF24L01+ at 2.4 GHz and up to 11 dBm for the CC1101 at 915 MHz).
For designing the wireless sensors, we have chosen the MRF49XA chip from Microchip [37], see Figure 3(d). This is a sub-1 GHz RF transceiver that can work in the 433, 868, and 915 MHz ISM bands. In particular, we opted for the 915 MHz ISM band for designing the wireless sensors. Few external components are needed for designing a 4 Journal of Sensors completely integrated RF transceiver. The chip employs FSK modulation with a data rate ranging from 1.2 kbps to 256 kbps. Since the chip can rapidly settle the carrier to the desired frequency, it can perform frequency-hopping and implement multichannel. The receiver is quite sensitive, with an increased receiving sensitivity of -110 dBm. The above allows the wireless link to be robust enough to surpass multipath fading and interference.

Journal of Sensors
The MRF49XA chip is configured via a SPI interface, see Figure 4(a), and needs few extra signals from the microcontroller to handling interruptions and other functionalities of the transceiver. The chip allows different sleep modes for a reduced overall current consumption. The RF interface (RFN and RFP pins of the chip) consists of an opencollector differential output that can drive a 50 Ω antenna using a suitable balun, see Figure 4(b). The output impedance of the RF interface at 915 MHz is 9 + i77Ω, which must be the input impedance of the balun. The datasheet of the chip [37] provides the appropriate values of the components the balun.

Design of a Simple
Antenna. For simplicity, the antenna for the wireless sensor is made of a single strand of 24 AWG wire (= 0:5106 mm). Its length ℓ was experimentally determined by successively shortening the wire up to observing the resonance at f 0 = 915 MHz. This was performed by using a vector network analyzer (VNA) MS46121B from Anritsu. Resonance is determined from the parameter s 11 , which is the reflection coefficient Γ at the input port of the antenna. In the logarithmic scale, the quantity 10 log js 11 j (dB) is often called return loss RL. Recall that the reflection coefficient at a load is defined as the ratio of the amplitude B of the reflected wave and the amplitude A of the incident wave, that is Γ = B/A. The lower the value of jΓj, the smaller the reflected power as well as the return losses. This implies that most of the power supplied to a load can be used to perform electric work. Resonance in the antenna is determined by the frequency at which s 11 reaches its minimum value. We determined two candidates of resonant lengths, namely, ℓ 1 = 10:3 cm and ℓ 2 = 25:8 cm. Other resonant lengths are indeed possible, but they are larger than ℓ 2 . In Figure 5, we observe the frequency response of the antenna for both resonant lengths.
The VNA performs a frequency sweep over a given bandwidth, and the measurements of s 11 = s 11 ðωÞ in the function of the frequency ω = 2πf are plotted on a Smith chart, see Figure 5(a). The central point of this diagram corresponds to s 11 = 0, which implies the best coupling. In the vicinity of this point, we have a region with an optimal coupling, which is indicated in the figure by a gray disc. As we approach the  Journal of Sensors outer circle, the coupling gets lost since js 11 j ⟶ 1; thereby, all of the energy is reflected. The measurements corresponding to ℓ 1 and ℓ 2 are closer to the central point at 915 MHz. In Figure 5(b), the same information is plotted on Cartesian axes. The band of frequencies at which js 11 ðωÞj reaches lower values is indicated by a gray stripe in the figure. We can see that the carrier frequency of 915 MHz indeed lies in this region. The plot corresponding to ℓ 2 = 25:8 cm has another resonance frequency of about 400 MHz but is not useful in the present design.
The working wavelength at f 0 = 915 MHz is λ 0 = 0:3278 m. An antenna of the kind considered here is often called monopole or Marconi antenna [38]. Its ideal resonant lengths are given by ł n = ð2n − 1Þλ/4, n = 1, 2, ⋯. This formula applies for an ideal filamentary antenna, that is, an antenna in which = 0. The real resonant lengths ℓ 1 and ℓ 2 are comparable to the ideal resonant lengths l 1 = λ 0 /4 = 8:195 cm and l 2 = 3λ 0 /4 = 24:585 cm, respectively. The differences are due to the circumferential currents established around the wire as well as the end effects. Finally at f 0 = 915 MHz, the antenna shows an impedance of Z in = 37:858 + i10:101Ω for the length ℓ 1 and Z in = 46:405 + i7:702Ω for the length ℓ 2 , which are closer to the impedance Z 0 = 50Ω at which the balun was designed.
3.4. Assembling a Prototype of Wireless Sensor. Based on the design considerations of previous subsections, a prototype for a wireless sensor was assembled in a PCB board with SMD components. The layout of the resulting PCB is shown in Figure 6. After soldering all of the components and burning a bootloader in the microcontroller, the prototype was proved both as a TX and RX by loading some testing programs via USB with the Arduino IDE. The spectrum of the prototype as TX was measured with a spectrum analyzer DSA710 of RIGOL, as is shown in Figure 7. Several units of the prototype were assembled and tested accordingly for the posterior deployment of a WSN.

Power and Energy Analysis in the Wireless Sensor
According to the previous design of the wireless node, in this section, we estimate the power used in the TX, RX, and OFF modes. To the antenna or balun Using supercapacitors instead of batteries in the wireless sensors would lead to a quasi-autonomous operation mode. Indeed, a bank of supercapacitors could be charged continuously by harvesting energy from the surroundings while the microcontroller is in sleep mode. A wireless sensor will awake only if it needs to transmit or receive data so that it will use some of the stored energy. Once TX/RX operations have finished, the wireless sensor will return to the sleep mode, and the supercapacitors will continue their charging process up to the next event.
Data transmission to the sink node is performed with slotted ALOHA protocol so that nodes with packets ready to transmit must wait for the beginning of the time slot and transmit with a probability τ. To further reduce the energy consumption, we let the probability τ to depend on the residual energy of each node. This is based on the fact that the highest energy consumption comes from transmission operations. Hence, nodes with the highest residual energy would perform more packet transmissions than those with the lowest residual energy levels. When nodes have low energy levels after long operation periods, this scheme would conserve energy by reporting very few events when nodes are in the active (ON) mode. Specifically, τ is determined by where E o is the initial energy of the node, which can also be considered as the maximum energy stored in the supercapacitor, e i is its residual energy, and γ is a parameter defined by the network administrator that controls the number of packet transmissions and consequently the system's lifetime.
For the considered wireless sensor, we have that E o = 139J. This value is estimated as follows. Figure 8 shows the behavior of a single supercapacitor of 15 F @ 4.3 V that feeds a wireless sensor that is continuously transmitting. The supercapacitor has the number part MAL219691203E3 from Vishay BCcomponents. Ideally, this supercapacitor can store up to U E = 1/2CV 2 = 138:67 J, though this energy cannot entirely be exploited by the wireless sensor. As can be seen in the figure, when the voltage of the capacitor is below 1.83 V neither the radio chip nor the microcontroller can work adequately. If this point is reached, the wireless sensor is unable to operate in the network unless the supercapacitor increases its energy in some way. Supercapacitors show an equivalent series resistance (ESR) that may consume some of the stored energy even if no load is connected to their ends. To reduce such power leakage, the value of ESR should be as close as possible to zero.
It is worth noticing that in a continuous transmission mode, a single supercapacitor can feed one wireless sensor for 40 min at the minimum transmitting power of -17.5 dBm and about 10 min at the maximum transmitting power of 0 dBm. Hence, a strategy must be to transmit small amounts of data and then send the wireless sensor to a sleep mode once its communication duties have finished and repeat this process if necessary. While the wireless sensor is in sleep mode the supercapacitor can be charged by harvesting energy from the surroundings. Furthermore, the sleeping of the wireless sensor favors the supercapacitor to "refresh" its available charge, as was observed in the experiments, which may be due to certain physicochemical processes that take place inside the supercapacitor [39,40]. Otherwise, the uninterrupted usage of the wireless sensor leads to the "drying" of the supercapacitor, and the point of 1.83 V will be  Journal of Sensors reached more rapidly. The refreshing and drying of the capacitors should be studied more rigorously in the laboratory.

Power Budget in the Designed Wireless Sensor.
In this subsection, we report the power consumption of the wireless sensor in the TX, RX, and sleep modes. This is performed by measuring the current I T consumed by the wireless sensor, which is fed by a voltage V sensor applied at x the sensor's feeding terminals. Let I μC and I radio denote the current consumed by the microcontroller and the radio chip, respectively, so that I T = I μC + I radio . The power consumption of the sensor denoted by W sensor is calculated by the customary formula W sensor = I T V sensor . Tables 1 and 2 show the results of the power consumption of the wireless sensor in TX mode at V sensor = 5 V and V sensor = 3:3 V, respectively. In both cases, the wireless sensor is operating in a continuous form. The first columns of these tables show the available transmitting powers in the radio chip, being -17.5 dBm and 0 dBm the lowest and highest available powers, respectively. On the other hand, Tables 3 and 4 show the power consumption of the wireless sensor in RX and sleep modes, respectively, for V sensor = 5 V and V sensor = 3:3 V. In the RX case, the wireless sensor is operating in a continuous form.

Journal of Sensors
According to the results shown in Tables 1-4, we observe that using a feeding voltage of V sensor = 5 V is energetically more expensive than using V sensor = 3:3 V. Hence, the supercapacitors must be chosen to work in a regime close to 3. With respect to the radio, the average current consumption is I radio,TX = 14:78 mA (13.6 mA) at V CC = 5 V (3.3 V) in TX mode and I radio,RX = 13:9 mA (12.8 mA) at V CC = 5 V (3.3 V) in RX mode. These values do not show substantial differences regarding the operation mode or feeding voltage and are below the typical value indicated in the datasheet of the radio chip, of about 17 mA. However, a substantial reduction is observed in the sleep mode, with a current consumption of I radio,Sleep = 726 μA (552 μA) at V CC = 5 V (3.3 V). In other words, a reduction in the overall power consumption of the wireless sensor mainly depends on reducing the current in the microcontroller. There exist several strategies to achieve this including setting the clock frequency to a value lower than 1 MHz or less, disabling the brown-out detector (BOD), disabling the ADC if not used by sensors, and among others. Also, it is possible to choose another microcontroller with a lower current consumption without altering the design of the wireless sensor too much.
In Table 5, we show the values that are used to model our mathematical proposal.

An Analysis of the Energy Used by the WSN and the Harvesting Energy from Mint Plants
In this section, we estimate the energetic cost of transmitting/receiving data by the designed wireless sensor from an empirical point of view based on the measurements of Section 4. Then, we consider recharging the supercapacitors of the wireless sensors by harvesting energy from mint plants.
From the obtained results, we establish the viability of such a harvesting configuration for a real WSN.

Power and Energy
Estimates in the Wireless Sensor. As a numerical example and using formulas (6)-(8), let us assume that the wireless sensor is fed by V sensor = 3:3 V, and let Δ t slot = 5 ms, which is a typical value for a time slotted communication system, see e.g., [41].
We can also estimate the energy needed to transmit/receive a single bit or byte. For instance, assume that the data rate of the radio is 256 kbps. This implies that a 5 ms slot has 768 bits or equivalently 96 bytes. Therefore, the energy for a single byte is All these values can be used for specifying units of energy in WSN. The above values indeed depend on the data rate of the radio and on the duration of the time slot Δt slot .    [42]. Researchers are finding ways to tap into the power of photosynthesis to generate small amounts of electricity from microalgae [43], cyanobacteria [44], and living plants [42]. The plant cells generate electrical potentials, which can propagate along the plasma membrane on long distances in vascular bundles and short distances in plasmodesmata and protoxylem [45]. Plants translate external stimuli into electrical signals, e.g., to regulate a variety of physiological functions, to mediate defense reactions [46], and to communicate with other plants [45].
Peppermint or mint (Mentha piperita L.), a perennial aromatic herb belonging to the Lamiaceae (Labiatae) family, is a natural hybrid between spearmint (Mentha spicata L.) and water mint (Mentha aquatic L.) [47]. Peppermint oil is of great economic value due to its uses in medicine [48], cosmetics [49], and food industry [50]. Indeed, for these reasons, peppermint is extensively cultivated both in temperate and tropical countries. Mint grows particularly well in lands with high water-holding capacity soil [51]. In 2014, world production of peppermint was 92,296 tonnes [52].
There exist three main pathways of carbon assimilation by plants, namely, C3, C4, and CAM. During the CO 2 fixation, when the photosynthetic plant produces 3-carbon acid as the first product, it is classified as C3 pathway. When the photosynthetic plant produces a 4-carbon compound as the first stable product, it is classified as C4. If the plant absorbs the energy of the sunlight at the day time and uses this energy for the assimilation or fixing of the CO 2 at night time, it is classified as crassulacean acid metabolism or CAM. Plants that use the C3 pathway tend to thrive in areas where sunlight intensity and temperatures are moderate, with CO 2 concentrations around 200 mg/l or higher and plentiful groundwater. Contrarily, C4 and CAM pathways are adaptations to arid conditions due to their improved water use efficiency [53]. On this basis, mint is classified as a C3 plant.
Photorespiration is an important process for energy dissipation for protecting plants against high light intensity to prevent excess water loss [54]. It consists of the uptake of molecular oxygen O 2 concomitant with the release of CO 2 from organic compounds. The gas exchange resembles respiration and is the reverse of photosynthesis where CO 2 is fixed and O 2 released [55]. The C4 pathway is an adaptation to the ancestral C3 photosynthetic pathway that acts to mitigate the effects of photorespiration that can occur in response to ecological pressures in C3 photosynthesis [56]. The first product of photorespiration is the phosphoglycolate, which is produced by enzyme Ribulose-1,5-bisphosphate carboxylase/oxygenase, and the final product of photorespiration is NH + 4 in the roots. Ammonia (NH + 4 ) is oxidized to nitrite (NO − 2 ) and subsequently to nitrate (NO − 3 ) for bacterial ammonia oxidizers in a microbially catalyzed process called nitrification. This behavior generates an increase of electrons and protons in the system, resulting in a decrease of system internal electric resistance and the increasing of electric generation [57]. Excessive loss of N due to NO − 3 leaching is a serious problem in peppermint cultivation [58]; however, this disadvantage for plant growth can be exploited in energy harvesting.
In this work, we report the energy harvested from mint plants and evaluate the possibility of using this microsource of energy for recharging the supercapacitors of a wireless sensor. The experiment was carried out as follows. In a small plastic pot of 9 × 10 −4 m 3 , we place a 7-turn helix made of 25 AWG copper wire, with a length of ℓ helix = 0:9 m. This will be the cathode of the microsource. Next, near the helix but without touching, we place a zinc-plated wire mesh with a surface of 0.010 m 2 , which will act as the anode of the source, see Figure 9(a). These electrodes are connected to female banana plugs that traverse the pot, see Figure 9(b). In the inner space of the helix, the roots of a mint plant (mentha spicata) are located, and then, the pot is filled with potting soil mix such that the electrodes and the roots get covered. This plant pot generates bioelectricity because of the microbial oxidative metabolism of the soil (see, e.g., [59][60][61][62]), which is measured externally at the female banana plugs by means of a multimeter, see Figure 9(c).
The experiment was carried out during four days from 10 : 00 to 18 : 00 Hrs. In the first day, the plant pot was watered at 9 : 00 Hrs. During sunning, the bioelectricity was measured hourly in each pot as follows: open-circuit voltage v open ðt n Þ was measured with a multimeter as voltmeter, and shortcircuit current i short ðt n Þ was measured with a multimeter as ammeter, where t n = 3:6 × 10 3 ðn + 10Þ s, n = 0, ⋯, 8. The   From the set of data points ðt n , pðt n ÞÞ, we construct an interpolating functionpðtÞ depending on the time t ∈ ½t 0 , t 8 . In Figure 10, we observe the plots of the instantaneous powerp m ðtÞ for each mint pot (m = 1, ⋯, 7) as functions We consider that the minimum value of energy necessary to work is 5% of initial energy E 0 E max It is the maximum energy stored in the node In general, the highest measurements of power occurred on the day when the plants were watered. Was observed a strong correlation between the solar irradiation and the generated electric power, as was expected. On the other hand, during the afternoon hours, electric power was also generated, reaching even higher values than during the morning hours. This electric power is due to other chemical processes previously described. Nonetheless, such small power levels will not be able to drive a small device or even a single LED. However, these small powers can replenish a supercapacitor of a wireless sensor while it is in sleep mode. Accord-ing to (2), the cumulative energy harvested from the plant pot is given approximately bỹ The integration can be calculated directly from the interpolating functionp m . In Table 6, we observe the values of the cumulative harvested energy calculated from this integral. Also, we observe the mean and total harvested energy, the total being calculated by summing the energy values from the four days. Plots of the energy as functions of the number of days can be seen in Figure 11. We observe that energy tends to decrease. This may be because the plants were only 14 Journal of Sensors watered the first day of the experiment, and no other water was supplied daily for not to flood the plants. Also, during days 2, 3, and 4, the experiment was carried out in cloudy conditions so that irradiation greatly diminished compared to day 1.

Mathematical Model
In this section, we develop a mathematical analysis based on a discrete-time Markov chain (DTMC) that models the main dynamics of the system, i.e., the nodes turning ON and OFF, the transmission of packets with probability τ, reception of packets, and collisions. The time slot duration will serve as the reference time structure for the proposed DTMC. Changes in the system may occur only at the beginning of the time slot, and no events can occur in between slots. The valid state space of the Markov chain is where n is the number of nodes in the system, e i is the residual energy of the i-th node, and the state S i indicates whether the node is OFF (S i = 0) or ON (S i = 1). We assume that nodes change from state ON (OFF) to OFF (ON) with prob-ability ρ. It implies that nodes remain an average time of 1/ρ seconds in each state. As such, the valid state transitions are as follows: with a probability ð1 − ρÞ n ð1 − τÞ n . This transition corresponds to the case where all nodes are in the ON state (S i = 1 for 1 ≤ i ≤ n) but none of them transmit packets. In this way, each node consumes an amount of energy Δ Rx corresponding to be active (listening and receiving) but not transmitting.
(ii) From the state ðe with probability ð1 − ρÞ n τð1 − τÞ n−1 . This transition corresponds to the case where all nodes are in the ON state (S i = 1 for 1 ≤ i ≤ n) but only the node i (i = 1, 2, ⋯, n) transmitted one packet. As such, the transmitting node i consumes an energy Δ Tx , and the other nodes consume the energy Δ Rx corresponding to be active (listening and receiving) but not transmitting.
(iii) From the state ðe with a probability ð1 − ρÞ n τ 2 ð1 − τÞ n−2 . This transition corresponds to the case where all nodes are in the ON state (S i = 1 for 1 ≤ i ≤ n) and only the nodes i and j (i, j = 1, 2, ⋯, n) transmitted one packet each one. As such, the transmitting nodes i and j consume an amount of energy Δ Tx , and the other nodes consume the energy Δ Rx corresponding to be active (listening and receiving) but not transmitting and so on.
(iv) From the state ðe with a probability ð1 − ρÞ n τ n , in which all nodes transmit. In this way, each transmitting node consumes an amount of energy Δ Tx .
(v) From the state ðe with a probability ρð1 − ρÞ ðn−1Þ ð1 − τÞ n . This transition corresponds to the case where the node k (k = 1, 2, ⋯, n) goes to the OFF state while the rest remain active (listening and receiving) but not transmitting, each of which consumes the energy Δ Rx . As such, the sleeping node k consumes the energy where E H is the harvested energy from the surroundings and E Sleep is the energy consumption during the sleep mode, both during a time slot. The condition E H > E Sleep means that the energy employed during the sleep period is actually replenished and not drained. For the case in which two or more nodes go to the OFF state, the transition probability is calculated accordingly.
(vi) All possible combinations of nodes going to the ON (OFF) state and transmitting or receiving while being active are derived similarly.
As examples, Tables 7 and 8 show the possible transitions in the case where the network is formed by two and four nodes, respectively. In the case of two nodes, Figure 12 shows the corresponding Markov chain where nodes are assumed to be in the OFF state and can change to nine different states.
The aforementioned chain corresponds to an irreducible Markov chain. As such, the steady-state probabilities can be calculated by solving the linear system Π = ΠP, where P is the transition probability matrix formed by calculating all possible valid transitions among states and Π is the steadystate vector Π = π ðe ðS 1 Þ 1 ,⋯,e

Results
In this section, numerical results are presented to evaluate the performance of the WSN when we use the harvesting energy The two nodes remain in the same state. 1 If S i = 0 ⟹ S i ′= 1, then P T x = τ, and P R x = 1 − τ. If S i = 1 ⟹ S i ′= 0, then P T x = 0, and P R x = 0. 2 If a node changes from OFF to ON state, it can transmit or receive data and consume an amount of energy related to being active (listening or receiving) or transmitting, respectively. If a node changes from ON to OFF state, it harvests energy. (iv) Probability of successful transmission is the probability that one node of active nodes transmits a packet (v) Probability of idle slot is the probability that none of the active nodes transmits a packet (vi) Probability of collision is the probability that more than one of the active nodes transmits a packet First, we study the system lifetime for different numbers of nodes in the network and P ON of 0.1, 0.3, and 0.5. In Figure 13, we show the system lifetime when the energy harvesting  Figure 13: System lifetime for the system with no energy harvesting and node harvesting energy from plants. We consider that τ < 0:1, so we use the values of γ = 0:001, 0.005, 0.009, 0.01, 0.05, 0.09, and 0.1 and P on = 0:1, 0.3, and 0.5. Journal of Sensors system is not considered and when the nodes harvest the energy from mint plants. As we expected, when the energy harvesting system is not considered and P ON increases, the operational time decreases. However, when the energy obtained from plants is considered, the node never runs out of energy. Indeed, the energy obtained from either the plants is sufficient to power the nodes indefinitely. In the figure, we represent this with the value 0, since in fact, the system lifetime goes to infinity which is difficult to represent in the figure.
In Figure 14, we show the system active time. In this case, when there is no energy harvested and P ON increases, the active time decreases because there is more probability that a node change from the OFF state to the ON state and consumes more energy. However, when we consider the energy obtained from the mint plants, we observe that active time increases. This is because the energy harvested in the system is enough to regenerate the energy consumed in the process of transmission and reception of packets providing

18
Journal of Sensors nodes with more functional time and transmitting more data to the sink. This behavior is reflected in the offline as shown in Figure 15. When the system has no energy harvesting capabilities and P ON increases, the offline time increases because there is a higher probability that a node change from the OFF state to the ON state and consume more energy. When energy harvesting is enabled, the node never enters the offline mode, which, for simplicity, we represent by 0 in the figure.
In Figures 16-18, we show the probability of successful packet transmission for different numbers of nodes in the network and P ON = 0:1, 0.3, and 0.5, respectively, and

19
Journal of Sensors different probability that a node can transmit a packet (τ). As expected, when τ increases, also the probability of successful transmission increases. This is because the probability that a node going from the OFF state to the ON state and transmits a packet is higher.
In Figures 19-21, we show the probability of idle slot for different number of nodes in the network and P ON = 0:1, 0.3, and 0.5, respectively, and different probability that a node can transmit a packet (τ). When the τ value increases, the probability of free slot decreases because it is more likely that a node transmits a packet.
In Figures 22-24, we show the probability of packet collision for different number of nodes in the network and P ON = 0:1, 0.3, and 0.5, respectively, and different probability

20
Journal of Sensors that a node can transmit a packet (τ). As expected, when the probability that a node changes from the OFF state to the ON state and transmits a packet increases, also the probability of collision increases.
In Figure 25, we show the available nodes in the network over time when we consider a value of τ fixed = 0:05 and a value of τ variable depending of residual energy of the network. As we expected, the lifetime of the network increases when

Conclusions
In this work, we study, analyze, and design a WSN that can operate indefinitely by harvesting energy from two separate sources. In the first case, an antenna is used to capture energy from pervasive electromagnetic sources, i.e., radio frequency signals, in urban and suburban areas. In the second case, we consider the energy that can be extracted from plants in rural areas, for agricultural applications, or animal or fire monitoring in forests where solar energy nor RF signals are abundant. We prove that by using either one of these energy harvesting

22
Journal of Sensors systems, the nodes in the network can operate without depleting their energy. Also, we propose a node design for these applications and schemes. According to Table 6, the harvested energy is of the order of few Joules; nonetheless, such small energy values can sustain a wireless transmission if correctly adapted to drive a wireless sensor. For instance, let us consider the lowest mean harvested energy from Table 6, namely, E mean,1 = 0:1093 J, corresponding to plant pot 1. Such energy can be used to transmit up to 259,564 bits, 32,452 bytes, and 3375 ms-slots; this energy can also be used to receive up to 301,036 bits, 37,637 bytes, and 391 slots of 5 ms. On the other hand, let us consider the greatest mean harvested energy from Table 6, namely, E mean,5 = 1:0084 J, corresponding to plant pot 5. This energy can be used to transmit up to 2,394,737 bits, 299,406 bytes, and 3,118 slots of 5 ms; it can also be used to receive up to 2,777,349 bits, 347,245 bytes, and 5 ms-3,616 slots. Note that these amounts of data can be used to transmit not only the payload from the sensors but also the stack of protocols involved in the networking functions.   However, note that in this mathematical model, when we consider 2 nodes in the network, there is 36 possible valid states, and with 4 nodes, there are 1296 possible valid states. Hence, computational complexity and running times greatly increase with the number of nodes. Hence, the model is not scalable. In future work, we plan to develop a new model that can be scalable considering the energy of the entire network and not of each node.

Data Availability
The simulations, tables, and figures data used to support the findings of this study are available from the corresponding author upon request.