Demeter: Reliable Cross-soil LPWAN with Low-cost Signal Polarization Alignment

Soil monitoring plays an essential role in agricultural systems. Rather than deploying sensors' antennas above the ground, burying them in the soil is an attractive way to retain a non-intrusive aboveground space. Low Power Wide-Area Network (LPWAN) has shown its long-distance and low-power features for aboveground Internet-of-Things (IoT) communication, presenting a potential of extending to underground cross-soil communication over a wide area, which however has not been investigated before. The variation of soil conditions brings significant signal polarization misalignment, degrading communication reliability. In this paper, we propose Demeter, a low-cost low-power programmable antenna design to keep reliable cross-soil communication automatically. First, we propose a hardware architecture to enable polarization adjustment on commercial-off-the-shelf (COTS) single-RF-chain LoRa radio. Moreover, we develop a low-power programmable circuit to obtain polarization adjustment. We further design an energy-efficient heuristic calibration algorithm and an adaptive calibration scheduling method to keep signal polarization alignment automatically. We implement Demeter with a customized PCB circuit and COTS devices. Then, we evaluate its performance in various soil types and environmental conditions. The results show that Demeter can achieve up to 11.6 dB SNR gain indoors and 9.94 dB outdoors, 4× horizontal communication distance, at least 20 cm deeper underground deployment, and up to 82% energy consumption reduction per day compared with the standard LoRa.


INTRODUCTION
Internet-of-Things (IoT) plays a critical role in precision agriculture [1,22,24,33,80,81,85], in which soil monitoring is an essential part.For example, understanding soil moisture levels in the crop root-zone area can benefit irrigation water efficiency [50]; in-soil nitrate monitoring leads to a deeper understanding of fertilization efficiency [9,11,22,81].Currently, commercial soil monitoring systems [16,29,39] deploy underground soil sensors while leaving communication modules on the ground.However, it is desirable to bury communication modules under the ground as well so that they will not interfere with other agricultural activities (e.g., mowing, harvesting, fertilization, irrigation) [2,68].Such cross-soil communication has become a key feature of agricultural IoT [45,70] and has attracted significant interests in recent years [33,36,67,71,94,97].
Considering the large-range and long-term deployment in rural farms, rather than ad-hoc wireless sensor networks (WSN) [66][67][68]87], Low-power Wide Area Networks (LP-WAN) naturally fit to enable agricultural IoT by embracing the wireless technologies featured by low energy consumption and long communication distance [51].LoRaWAN [3] is a popular LPWAN technology operating on the unlicensed band.It supports long-range data collection from LoRa nodes (typically with sensors) to a gateway.Compared to other cellular LPWAN techniques (e.g., NBIoT [52], LTE-M [37]), LoRaWAN provides a low-cost way to flexibly deploy new infrastructure in rural farm areas where the cellular infrastructure is not available.Some measurement studies [15,21,89,97] have shown the feasibility of adopting LoRaWAN to achieve cross-soil communication.However, achieving a reliable cross-soil LoRaWAN in practice is not trivial.In our infield measurement ( § 2.1), we observe that the soil condition changes (e.g., moisture, temperature) can lead to a significant signal-to-noise ratio (SNR) variation up to 19.2 dB over a cross-soil LoRa link.Moreover, according to our empirical study of the SNR variation in cross-soil LoRa communication ( § 2.2), compared to the variation of signal attenuation, polarization misalignment between the transmitter and receiver antennas contributes more, leading to 13.2 dB SNR variation.
For the available configurations on commercial off-the-shelf (COTS) LoRa nodes [34], such an SNR variation will shorten the communication distance by 4× ( § 5.2) and reduce energy consumption per day by up to 82% ( § 5.3).The reason for cross-soil polarization misalignment is illustrated in Figure 1.LoRa nodes and gateways adopt low-cost linearly polarized antennas.The polarization (i.e., blue arrows) of an electromagnetic wave emitted from an antenna specifies the geometrical orientation of its oscillations.The received signal power can be maximized if the polarization of the received signal is aligned with the receiver's antenna orientation (i.e., red arrows).However, the soil's microscopic structure and components keep changing over time, subject to different environmental conditions, such as weather and agricultural activity.Consequently, as shown at the bottom of Figure 1, when an electromagnetic wave travels through the soil with complicated scattering, refraction, and reflection [6,8,28,56,72], its polarization changes over time.Even if the LoRa node's antenna and the gateway's antenna are aligned in advance, the cross-soil transmission can cause polarization misalignment between the received signal and the LoRa gateway's antenna, degrading its power significantly.
Table 1: Qualitative comparison between Demeter and alternative methods regarding COTS compatibility (COTS.),cross-soil reliability, polarization selfalignment capability, and protocol overhead in soil communication."Pol." and "Dir-Ante."stand for "polarization" and "directional antenna", respectively.for the buried LoRa nodes to send their sensor data to a LoRa gateway over a long distance.We want a solution that is lowcost, interoperable with existing LoRa devices, reliable, and self-adjusting for polarization alignment, with low overhead, such that the LoRa nodes buried underground can operate uninterruptedly for a long time.For low cost and interoperability, we prefer a COTS-compatible solution.Specifically, the LoRa technology is commercialized by Semtech [59] only, with its proprietary radio chips, which all LoRa nodes and gateways in actual deployment use.We say a LoRa node (or gateway) is COTS-compatible if it can be made from the Semtech LoRa radio chips with other (possibly customdesigned) circuitry and computing/storage/signal processing components.A survey of relevant technologies from the literature shows in Table 1 that none of them is satisfactory in meeting all the challenges faced by cross-soil LoRa communications: COTS compatibility, reliability, polarization self-alignment, and low overhead, which we elaborate below.Challenge 1: COTS Compatibility.There is prior work using a dual-polarized antenna (consisting of two orthogonal polarization antennas) and two RF chains to fully collect the energy of arbitrary polarization signals [38].Although the work was not directly on LoRa, it is conceivable that its method could in principle be applied on a LoRa gateway to receive polarization-misaligned signals from an underground LoRa node.However, this method is not COTS-compatible because all existing COTS LoRa gateways [61][62][63] only have one RF chain in their radio chips, not two RF chains required in [38].Hence, not only does this method carry a higher cost, but it is not applicable to the existing deployments using COTS gateways.Challenge 2: Cross-soil Reliability.In aboveground and open-space communications, LoRa nodes can utilize circularly polarized antennas, which generate circular polarization signals, to mitigate the polarization misalignment problem [13,38].However, the signal reflection, refraction, and scattering of under-ground communications are much more complex, leading to dramatic axial ratio distortion of circular polarization [42,75,82,83].This distortion means the wave is no longer circular polarization and can result in a severe signal loss at LoRa gateways, degrading communication reliability [23,32,42,74,75,84].Challenge 3: Polarization Self-alignment Capability.Lowcost electronically switchable directional (ESD) antennas [26,40,43,44], providing antenna gain in a certain direction, can be equipped on LoRa nodes to enhance SNR.However, these directional antennas carry a higher cost in the LoRa band, and they are not capable of mitigating polarization misalignment.Moreover, the antenna gain from low-cost ESD antennas in the low-frequency band is usually too limited to tolerate the observed 13.2 dB SNR variation completely [4,27,57,73,96].Challenge 4: Protocol Overhead.LoRa nodes can estimate cross-soil links and schedule transmissions under favorable conditions for good polarization [35,91].However, considering the continuously changing soil conditions, maintaining an accurate estimation and scheduling the transmissions may bring considerable computation and energy overhead, particularly for low-cost LoRa nodes.
To address the above challenges, in this paper, we propose Demeter, a low-cost and low-power polarization-programmable antenna system on COTS-compatible LoRa nodes to enable reliable cross-soil LoRa communication.It is inter-operatable with the LoRa gateways in existing deployment.Our key idea is to design a single RF-chain compatible circuit to dynamically adjust the initial polarization of LoRa node transmission.As shown at the bottom of Figure 1, considering the polarization changes during underground signal propagation, the LoRa node adjusts the polarization of its transmitted signal dynamically to ensure the polarization of the received signal is aligned with LoRa gateway's antenna.
The design of Demeter involves three key problems.First, due to the single RF chain resource on existing LoRa nodes, it is not trivial to design a circuit that enables flexible polarization adjustment.To address this challenge, Demeter uses an RF splitter to split the raw signal from the single RF chain into two signals.In addition, Demeter adopts a dual-polarized antenna, which takes the two signals as the inputs of its two orthogonal polarization dipole antennas to generate a linearly polarized transmission signal.The polarization of the transmission signal can be adjusted by configuring the amplitude ratio of the two signals.
Second, considering the energy constraints on COTS LoRa nodes, energy-exhausting hardware components (e.g., voltage attenuator, amplifier) should not be involved in signal amplitude control.How to control the amplitudes of the two split signals with low-power hardware components is another challenge.To address this challenge, Demeter converts an amplitude ratio to a configurable phase offset between the two signals by utilizing a low-power digital phase shifter and a passive hybrid coupler.The phase shifter adds a preconfigured offset to the phase of one signal.Moreover, Demeter uses the hybrid coupler to mix the two signals to generate two new signals with the corresponding amplitude ratio for the two orthogonal dipole antennas and further customize the hybrid coupler for the LoRa frequency band.
Third, due to the occasional change of the soil condition, the polarization of cross-soil signals is changing over time.To lower link maintenance overhead while keeping agile to the polarization change, when to trigger and how to calibrate the end-to-end polarization alignment between LoRa nodes and gateways are not trivial.To address these challenges, Demeter triggers a calibration process adaptively according to potential soil condition changes in a day.A LoRa gateway initializes a polarization calibration process and asks the targeted LoRa node to transmit multiple beacons with different polarizations.Then we develop a heuristic algorithm to search the best polarization, balancing the searching accuracy and energy overhead on LoRa nodes.
We implement a Demeter prototype with a COTS digital phase shifter [49], a COTS RF splitter [93], a COTS dualpolarized antenna [92], and a customized hybrid coupler on a COTS LoRa node with Semtech SX1276 radio [60].We have conducted extensive experiments in various soil environments.Our results show that compared with standard LoRa, Demeter can achieve up to 9.94 dB SNR gain outdoors, 4× horizontal communication distance, and at least 20 cm underground buried depth improvement.
In summary, our contributions are summarized as follows: • To the best of our knowledge, we are the first to develop a reliable cross-soil LPWAN, which is an essential part of agricultural IoT and in-situ soil sensing for realizing precise agriculture in scale.

PRELIMINARY AND MOTIVATION
LoRa is a wireless communication technology that uses chirp spread spectrum (CSS) modulation to overcome the effects of narrowband interference and multipath fading [58].This allows LoRa devices to communicate over long distances with low power consumption [51,76].Figure 2 illustrates a typical cross-soil LoRa communication system, where LoRa nodes are buried in underground soil and LoRa gateways are deployed in aboveground air.The sensors on the LoRa nodes generate hourly/daily sensory data that is sent to the gateways over a cross-soil link.Many factors (e.g., rainfall, snowfall, temperature, animal activity, plant growth) incur significant soil condition changes over time, leading to unstable cross-soil LoRa links and resulting in packet loss and energy waste.

In-field Cross-soil Link Measurement
Agriculture soils are categorized into more than ten types, as determined by the ratio of three mineral components (i.e., sand, silt, and clay) according to USDA soil texture document [25,78].For example, clay soil consists of more than 50% clay while loam has about 40% sand, 40% silt, and 20% clay.In agriculture, loam soil holds a significant position due to its ideal balance of sand, silt, and clay particles.This balance affords loam soil excellent properties for plant growth, making it highly desirable for farming and gardening.We conducted a 9-day in-field experiment to explore the quality of cross-soil LoRa communication in a wheat farm.The soil is CvraaB-Conover loam.Its mineral composition is about 40% sand, 40% silt, and 20% clay, respectively [25,78,79].Rainfall comes on Day 2 and Day 9. A moisture sensor [47] connected to a COTS LoRa node is buried at 30cm depth underground, and we deploy a COTS LoRa gateway aboveground.The horizontal distance between the LoRa node and gateway is 10m.The LoRa node sends a soil moisture reading every 30 minutes.The gateway extracts RSSI (Received Signal Strength Indicator), SNR, and VWC (Volumetric Water Content) that measure the ratio of the volume of water to the unit volume of soil from each received packet.
Figure 3 shows the results.From VWC curve, we can observe two rainfalls (i.e., VWC shifting up) on Day 2 and Day 9. Correspondingly, the SNR and RSSI decrease sharply on Day 2 and fluctuate on Day 9.Moreover, we observe another RSSI and SNR drop and fluctuation on Day 6 and Day 4, respectively.Based on the historical weather record, abrupt temperature changes appear these days.Overall, the SNR and RSSI are extremely unstable across 9 days.The RSSI difference reaches to 21.32 dBm.The SNR ranges from 10.4 dB to -8.8 dB.The total 19.2 dB SNR variation verifies that soil condition (e.g., moisture, temperature) changes can degrade communication reliability in real-world deployments.

Cross-soil Signal Polarization Study
For the cross-soil LoRa link in our in-flied measurement, the observed dramatic SNR variation consists of two parts.One part is from the change of signal attenuation determined by soil's dielectric properties [5,12,87] that keep changing along with the changes of soil condition (e.g., moisture, temperature).The other part is from signal polarization misalignment [13].COTS LoRa nodes and gateways adopt linearly polarized antennas.The polarization of an electromagnetic wave describes the orientation of the oscillating electric field.The electromagnetic wave of LoRa signals is transverse and travels in a specific direction.A magnetic field and an electric field are perpendicular to each other and the direction of propagation.The linear polarization indicates the orientation of the electric field, which oscillates in a fixed plane determined by the magnetic and electric fields and can be purely vertical, horizontal, or any angle in between.When the polarization of the received signals is well aligned with a LoRa gateway's antenna orientation, the energy of the electric fields can be fully captured by the receiving antenna.Consequently, the SNR of the received signals can be maximized.However, in cross-soil communication, signal scattering, reflection, and refraction are inevitable during signal propagation in soils, making the polarization variation at the receiving antenna [7,30,46,64,72], resulting inevitable polarization misalignment.
We have conducted controlled experiments to investigate the SNR variation incurred by polarization misalignment in cross-soil communication.In an indoor environment, we bury a COTS LoRa node in a plastic container of sandy soil (i.e., > 90% sand) and utilize a COTS LoRa gateway to receive packets.To imitate the soil moisture changes in our in-flied measurement, we change VWC from 0% to 48%.When VWC is 48%, the soil tends to be water-saturated, which only happens when flooding appears in the real world.Thus, we do not set a higher VWC.To verify the influence of polarization misalignment, for each VWC, we manually vary the polarization of the received signals by uniformly rotating the antenna of the LoRa gateway to 16 different orientations in a plane perpendicular to the direction of electromagnetic wave propagation.For each antenna orientation, the LoRa node will transmit 10 packets.Then, the LoRa gateway collects the packet SNR.
In Figure 4, the five-value boxes show the observed SNR distribution at different VWC configurations.We can see that the SNR variation between the maximum and the minimum SNR under a VWC configuration is 13.2 dB on average.Such a huge SNR variance is purely caused by polarization misalignment.Moreover, for each VWC configuration, the maximum SNR is achieved when the polarization is well aligned.Thus, the changes in the maximum SNR reflect the changes in signal attenuation.We can see the maximum SNR monotonously decreases from 7.0 dB to -5.6 dB, namely the signal attenuation increases 12.6 dB, when VWC increases from 0% to 48%.In our in-flied measurement, the VWC is in the range of [7.8%, 23.1%].The SNR variation caused by signal attenuation is about 5.8 dB which is 2.3× less than the 13.2 dB SNR variation brought by polarization misalignment.By adding both variations, the total SNR variation is 19.0 dB, which is relatively consistent with the observed 19.2 dB.
Furthermore, we verify that the signal polarization is indeed changed by soil condition change (i.e., VWC increase).The red, yellow, and purple dashed lines represent the SNR of three specific antenna orientations.If the cross-soil signal polarization is constant under different VWC, the trend of the three dashed lines should be similar to the monotonous decrease of the maximum SNR.However, the patterns of the three dashed lines are non-monotonic and totally different.Specifically, the standard deviations of the SNR difference between each dashed line and the maximum SNR are 4.66 dB, 4.2 dB, and 3.78 dB.The dynamic pattern and high deviation verify that the soil condition changes dramatically influence the quality of received signals.

Motivation
The observed reliability vulnerability motivates us to compensate for the polarization misalignment in cross-soil LoRa communication.On the other hand, a LoRa gateway may cover hundreds or thousands of LoRa nodes.Different LoRa links have diverse polarization misalignments.If we compensate for the polarization misalignment at the gateway side (e.g., rotating the gateway's antenna), the gateway has to assign different LoRa nodes' transmissions at different times.The calibration process, transmission scheduling, and network synchronization will consume considerable energy on LoRa nodes, compromising the energy benefits of the

Programmable Antenna
Cross-soil Propagation

SYSTEM DESIGN
Figure 5 provides an overview of Demeter.Demeter consists of three parts: 1) the hardware design of a programmable antenna that allows the LoRa node to configure its signal polarization; 2) a polarization alignment calibration algorithm that generates the optimal LoRa node's setting to achieve polarization alignment at the LoRa gateway; and 3) a link calibration scheduling method that optimizes system energy efficiency while keeping communication reliability.The simple structure makes it easy to manufacture and has been widely used in wireless communication.

Adjustable Polarization Principle
As shown in Figure 6, the raw signal transmitted by a LoRa node is  0 with amplitude  and phase , which can be expressed as  =  (, , ), where  is the time.First, we use the passive RF splitter to divide the raw LoRa signal into two identical signals with half amplitude: For the first way signal  1 , the digital phase shifter is used to add a phase offset .We assume the phase shifter is ideal without extra loss, the amplitude of  1 is still   2 .Then we have  1 =  (  2 ,  + , ).We can see that the phase difference between  1 and  2 is , too.
The port1 and port2 of the hybrid coupler take  1 and  2 as input, respectively.The output signals at port3 and port4 are  3 and  4 .To calculate the value of  3 and  4 , we use   to represent the partial output signal at port  from the input signal at port .As shown in Figure 6,  3 consists of two parts:  32 (i.e., the blue arrow at port3) and  31 (i.e., the red arrow at port3).The hybrid coupler adds a 90 • phase offset on  2 to generate  32 (i.e., the blue crossing line).Then,  3 can be calculated as follows: Port3 vector ì  3 (i.e., the brown arrow in Figure 6) is vectors sum of ì  32 and ì  31 .ì  32 , ì  31 compose a rhombus with same amplitude.Therefore, the phase value of ì  3 should be the mean phase of ì  32 and ì  31 .Let the amplitude of ì  3 be A3.We can simplify ì  3 as: Similarly,  4 is the combination of  42 (i.e., the blue arrow at port 4) and  41 (i.e., the red arrow at port 4).Based on  1 , the hybrid coupler adds a 90 • phase offset to generate  41 (i.e., the red crossing line).We have  4 as follows: Let us indicate the amplitude of ì  4 as A4, We can see that  3 and  4 have the same phase while their amplitudes A3 and A4 are different.We further feed  3 and  4 to the two feeding ports of the two dipole antennas of the dual-polarized antenna.Then the two dipole antennas produce two orthogonal electric fields.Generally, an electromagnetic plane wave that moves in the -axis direction has two components in -axis and -axis [69]. ) ì  = ì     + ì     represents for electric field and  means magnitude/amplitude.At the two dipole antennas in the dual-polarized antenna of Demeter, we have two orthogonal electric fields in the - plane.Both the wave phases in  and  are equal to  =  +  2 +  4 .We set the same  to 0 here.
According to the principle of vector composition, we can change the amplitude ratio 3 4 between  3 and  4 by adjusting the phase offset  to determine the degree of linear polarization  (i.e., the green arrow at polarization compose).The propagation direction (i.e., black dashed arrow) of electromagnetic waves is the normal of the polarization plane.Finally, we can generate signals with different linear polarization degrees.

Coupler Architecture
Some hardware components of our system, such as the phase shifter, the passive RF splitter, and the dual-polarized antenna are COTS devices that can be obtained easily.The hybrid coupler for a LoRa node should be low-cost with a small size without any power supply.However, the sub-1 GHz bridge coupler which meets our demand is limited on the market.Thus, we design the bridge coupler by ourselves.The purpose of the coupler is to produce 90 • phase difference between the signals of two output ports when the input signal is only from one input port and the other one is isolated.Three kinds of RF bridge couplers can achieve the target: codirectional, contradirectional, and transdirectional with different isolated port positions relative to input ports.Compared to the other two solutions, as illustrated in Figure 7(a), a transdirectional coupler can avoid crossover and direct current bias problems because the isolated port and input port are on the same side, making the coupler smaller and scalable for IoT devices [48].Transdirectional Coupled Line.We adopt an even-odd mode analysis [48] at four ports of the hybrid coupler in Figure 7. Port1 is input and port2 is isolated while port3 is the through and port4 is coupled.  (i=1,2,3,4) represents the voltage at port and  0 is the generator voltage.Let    be the input impedance at port1 for the even mode and    be the input impedance of the odd mode. 0 is the load impedance of the transmission line in this coupler.
According to the symmetrical structure of the transdirectional coupler, the voltage at port4 is Based on the definition of Combined with Equation 15.  is the coupling coefficient.
Similarly, we calculate  3 for port 3 as follows: We can notice that there is always 90 • phase difference between  3 and  4 due to the same denominator and orthogonal numerator.The scattering parameter  can be computed with voltage ratios (   = Periodically Loaded Design.For a conventional coupled line, we need to satisfy Equation 17 under the necessary constraint of the transdirectional operation: However, it is challenging to adjust   ,   ,  0 and  0 simultaneously because the spacing between the coupled lines would impact both the impedances and phase velocities.Inspired by transdirectional coupled-line couplers working on 3.6 GHz [65], we adopt periodically loaded coupled lines to overcome this challenge.We design multiple unit cells with capacitors between coupled lines.The unit cell, consisting of several capacitors and transmission lines, is shown in Figure 7(a).The orange rectangles are patch capacitors.Here  is the number of unit cells.Let  be the electrical length of each unit cell and  0 the characteristic impedance of the transmission line   as the equivalent circuit that Figure 7(b) shows. is the capacitance between the coupler transmission lines.  is the capacitance between the coupler and the ground.The shunt susceptances of periodic load on even and odd modes are   and   .According to the design in [65], we have: ) According to Equations 25, 26, 27, and 28, the electrical length for each unit cell can be assigned with a preconfigured value.Then we can calculate the capacitance value of   accordingly for the LoRa frequency band.HFSS Simulation: We use the High-Frequency Structure Simulator (HFSS) to perform electromagnetic simulation on our system.Initially, we use Roger5880 0.5mm thickness substrate with low signal energy loss to ensure high efficiency and verify the system.Figure 8(a) shows the efficiency of the coupler across the four ports in the US915 band. 31 and  41 can achieve -3.04 dB and -3.24 dB, which are consistent with half amplitude split of  31 and  41 .And the reflection loss in  11 and  21 are ultra-low as -28.13 dB and -26.52 dB, achieving high energy efficiency.However, Rogers5880 is expensive hindering us from deploying Demeter on a large scale.In addition, Rogers5880 is too soft to be distorted easily, causing unexpected circuit changes and high loss.
To benefit IoT deployment, we redesign our coupler with substrate FR4 at 1.6mm thickness, which is one of the cheap, hard, and easily processed substrate materials.In HFSS, by adjusting the geometrical shape and parameters like electrical length, bridge width, and capacitors, we successfully achieve a 90

Polarization Alignment Calibration
The calibration problem is to find the optimal phase offset configuration of the phase shifter that makes the signal polarization aligned between a Demeter node and a LoRa gateway, namely the observed SNR is the highest at the LoRa gateway.Instead of traversing all possible phase offset configurations, we design a heuristic SNR peak searching algorithm to minimize the control overhead.

SNR Peak Searching Problem:
The digital phase shifter can provide  different discrete phase offsets, which generate different polarization degrees of the output signal.We use the term "phase index" (i.e., from 1 to ) to represent these phase offsets in ascending order.We aim to find out the phase index that enables polarization alignment, namely obtaining the highest SNR at the gateway side.Intuitively, a LoRa node can send  probing beacons that cover all available phase indexes to a LoRa gateway.Then, the gateway feedbacks the one with the highest SNR to the node.For example, in Demeter prototype, we have 45 phase indexes.Figure 10 shows the SNR changes (e.g., blue dots) for a cross-soil link deployed in the real world.We can see phase index 13 with the highest SNR 4.6 dB should be selected.Heuristic Calibration Algorithm: Demeter transmits beacons with varied polarizations in a short duration.The crosssoil communication links are quite stable during a short period [55,88].Therefore, in Figure 10, the SNR changes comply with a sine wave approximately, where only one valley and one peak exist.By noticing this property, we can reduce the transmission number of probing beacons of current SF in a heuristic way.The algorithm contains two parts.First, we use six uniformly distributed phase indexes to determine the optimal phase index's range.Then, we use binary search to find the optimal phase index in this range iteratively.For example, Figure 10 shows that the LoRa node first transmits six probing beacons using the phase indexes marked by the red circles.The gateway feedbacks that the optimal phase index is in the range of either [1,2] or [2,3].Then, the node sends another two probing beacons with phase indexes 1' (i.e., the middle of [1,2]) and 3' (i.e., the middle of [2,3]).The gateway feedbacks that the new search ranges [1',2] and [2, 3'].The node and gateway repeat this process to find the optimal phase index.In practice, we control the number of iterations to balance the polarization accuracy and the energy cost at the node side.

Link Calibration Scheduling
In our empirical study in Section 2.1, we observe that the SNR of a cross-soil LoRa link is influenced by the changes in soil conditions (e.g., moisture, temperature) significantly.When soil conditions change, the SNR is also degrading or fluctuating.With this observation, we need to trigger link calibration more frequently if soil conditions change fast.In Demeter, LoRa nodes and gateways periodically trigger the polarization alignment calibration Θ times in a day.If the soil condition (e.g., rainfall, snowfall, fertilization, irrigation) changes frequently, we set a large Θ.Otherwise, we keep Θ small to reduce the energy costs.Therefore, based on the weather report, agriculture activity plan, and soil sensory data, we empirically configure Θ every day.

IMPLEMENTATION
We implement a prototype of Demeter 1 with three COTS hardware modules and a customized hybrid coupler operating on the US915 band.The COTS hardware modules include a 3 dB XRDS-RF 698-2700MHz passive RF splitter [93], an ANT627-NF-PANEL-MIMO-OD [92] dual-polarized antenna, and a digital phase shifter PE44820 [49] with 45 available phase offset indexes.Considering the loss of the phase shifter, 1 The source design are available at https://github.com/YDRen001/Demeter.
we apply another identical one with no phase offset to the other signal, balancing the strength of the two split signals.
We implement the hybrid coupler on two kinds of substrate: FR4 with 1.6 mm thickness and Rogers5880 with 0.5 mm thickness.The 0402 patch capacitors with values of 4.3pF and 3.3pF are used in Demeter on the Rogers5880 and FR4 coupler, respectively.As shown in Figure 11(b), the length and width are 63 mm and 25 mm, which is a relatively compact size for the IoT device working in sub-1G frequency.We use a vector network analyzer to measure the S parameters of our hybrid couplers.The phase difference between  31 and  41 is 89.6 • and the phase difference between  32 and  42 is 90.7 • .The signal loss of Demeter is 1.5 dB.The extra transmission power consumption of Demeter is 600 W, which is neglectable compared with COTS LoRa nodes' tens of mW transmission power.Moreover, since we use a wide-band dual-polarized antenna and phase shifter, the total cost of the Demeter prototype is 150 US dollars.We can lower the cost to about 20 US dollars by integrating all these modules into a unified circuit with a US915 band RF-front.The cost can be further lowered with volume production.
As Figure 11(a) shown, we implement a Demeter node by connecting Demeter to a COTS LoRa node with Semtech SX1276 radio chip [60].For LoRa gateways, we use UHD and GNUradio to control a USRP N210 [54] with an SBX 400-4400 RF daughterboard [53].We also use a COTS LoRa gateway with Semtech SX1302 radio chip [61] and SoilWatch 10 moisture sensor [47].We implement the polarization alignment calibration algorithm using the standard LoRaWAN Class A MAC, which is the default and most energy-efficient one.We run a heuristic algorithm script at the gateway to evaluate the SNR from the LoRa node in soils.We set RECEIVE_DELAY as 10 s to give enough response time for the gateway to generate feedback.We adopt 2 iterations and send 7 probing beacons in total in each calibration process.At the receiving window, the LoRa node turns off the phase shift function but keeps receiving signals through the phase shifter, which does not influence the signal reception.

EVALUATION
We evaluate the communication reliability of Demeter in both indoor and in-field environments.In addition, we demonstrate the energy efficiency of Demeter regarding different calibration trigger frequencies.Performance Metrics: We use two metrics to evaluate the performance of Demeter.The first is SNR of the received packets, which is a widely used metric in wireless communication to indicate communication reliability.The higher the observed SNR is, the more reliable the communication is [19].
All the SNR gain values are net gain.The second is Energy Consumption per Day.We use Joule per day (J/Day) to present energy consumption under various settings.Baseline Method: We compare Demeter with the default linear polarized antenna without polarization alignment.In our implementation, we only use one dipole antenna of the dual-polarized antenna to generate the baseline signal with the same power as Demeter.

Indoor Experiment
Experiment Settings: We conduct indoor experiments to verify the SNR gain of Demeter in polarization alignment for cross-soil communication.We bury a Demeter node in a plastic container of sandy soil and utilize the COTS LoRa gateway to receive packets as Figure 11(a) shown.The distance between the antenna and the gateway is 20 m and the in-soil distance between the antenna and the edge of the container is 0.6 m.Then we gradually add water and stir the soil evenly to change VWC from 0% to 48%.For Demeter, we calibrate the polarization, and the antenna orientation is randomly placed, then we calculate the average SNR of 10 packets.For the baseline method, we collect and estimate the SNR of 10 packets from the LoRa node for each of the 16 different orientations of the manually rotated antenna of the LoRa gateway.
For each VWC level, we keep the same wireless link between the two methods by switching the transmitter connected to the antenna ports without changing soil conditions.The spreading factor (SF) of LoRa transmission is 10.
Results: Table 2 shows the maximum (i.e., Max SNR) and minimum (i.e., Min SNR) SNR values of the baseline method at different antenna orientations and the average SNR value of Demeter at different VWC levels.We can see that the Demeter's SNR is 0.21 dB higher than Max SNR on average.

In-field Experiment
We evaluate the performance of Demeter under five different configurations in terms of environment and deployment outdoors.We conduct experiments on a wheat farm as shown in Figure 11(c).In the experiments, we dig a hole and bury a battery, a LoRa node, and our prototype of Demeter RF components (as mentioned in Section 3) in a plastic box to protect devices.Considering the potential ultra-low SNR outdoors, we utilize the USRP as the gateway to collect raw signals and compute average SNR among multiple symbols.After the polarization alignment calibration, we collect 12 packets to measure the average SNR value for Demeter.For the baseline, we also collect 12 packets to measure the average SNR.We set a 45 • inclined antenna (Figure 14) of the gateway towards to underground node in baseline and Demeter.The default moisture is 11%, and the default soil type is loam soil.the polarization alignment directly.In this experiment, the gateway antennas with vertical and horizontal orientations are selected to explore the impact of antenna orientation for Demeter.SF is set as 10, and the depth is 35 cm. Figure 14 shows the three kinds of antenna orientation.

Results:
The measurement results are illustrated in Figure 15.
We can observe that compared to the baseline, the average SNR gain of Demeter in the vertical antenna (Figure 15     to use SF12, we can use SF10 for packet transmission.Given different link budgets and SF settings, the energy saving for each packet ranges from 0.0569 J to 0.5786 J with 3.3 V voltage.
First, we make a LoRa node sending six packets per hour to evaluate the energy efficiency of Demeter compared to the standard LoRa under different polarization calibration frequencies.Based on the fact that significant fluctuations in SNR occur only 5 times over a 9-day period in Figure 3, we set Θ from 0.5 to 6. Specifically, Demeter 1 triggers the calibration once every two days.Demeter 2, 3, and 4 trigger the calibration 2, 4, and 6 times per day.By default, the payload size is set to 26 bytes.We calculate the energy consumption per day under four different link budgets from SF9 to SF12.
To further verify the performance of various payload lengths, we adopt six payload sizes from 10 bytes to 30 bytes.For each payload size, we calculate the average energy consumption per day of 144 packet transmissions under link budgets from SF9 to SF12 (i.e., 36 packets for each link budget).We compare Demeter 2 with the standard LoRa and Fixed-SF12, which always applies SF12 to transmit packets no matter the current link budget.Results: In Figure 18(a), Demeter 1-4 outperforms the standard LoRa under different link budgets.For example, compared to the standard LoRa, Demeter 2 reduces energy consumption per day by 68.3% and 57.9% for SF12 and SF9, separately.Moreover, we can see that energy consumption per day increases when calibration trigger frequencies increase.Demeter 1's average energy consumption per day under the four SF settings is 34.1% of the standard LoRa while Demeter 4's increases to 48.5%. Figure 18(b) illustrates the energy consumption under different payload sizes.Demeter 2 reduces energy consumption per day by 82.0% compared to Fixed-SF12 and 63.4% compared to the standard LoRa.For a LoRa node with a 4,400 mAh energy store (i.e., two mid-grade Alkaline AA batteries), this would extend the system lifetime roughly 5.5×.The results indicate the energy benefits of polarization alignment are far more than the energy cost incurred by alignment calibration in Demeter.

RELATED WORK
Cross-soil IoT Systems: Ad-hoc Wireless Underground Sensor Networks (WUSN) [66-68, 77, 90] is well studied for cross-soil IoT.For example, Wang et al. [90] propose a soil measurement system based on WUSN.Dong et al. [17] and Silva et al. [68] present autonomous precision irrigation systems with WUSN.Compared to ad-hoc WUSN, we focus on cross-soil LPWAN, a parallel IoT paradigm.Moreover, some works [10,36,97] utilize COTS LoRa and NBIoT to demonstrate the feasibility of cross-soil LPWAN.In comparison, Demeter further enhances the reliability, communication range and depth, and energy efficiency of LoRa cross-soil communication.
In-soil Communication Method: Some works [67,71,86,95] focus on extending the depth a sensor can be buried at with electromagnetic waves [67,86], magnetic coils [71], and acoustic signals [95].For example, Sun et al. [71] adopt magnetic induction to reduce signal path loss in soils.The communication system [95] can achieve up to 50 m buried depth with a low-cost acoustic transceiver.Although magnetic and acoustic signals are able to tolerate the signal loss brought by soils, they cannot enable long-range communication over the air, which hampers the farm-scale agricultural data collection needs.In contrast, Demeter is able to achieve much longer cross-soil communication distance for generalpurpose agricultural IoT systems.Polarization-aware Communication for IoT: LLAMA [13] implemented a reconfigurable meta-surface to rotate the polarization of signal between transmitter and receiver.Polartracker [91] and Polarscheduler [35] propose a polarizationaware link model to communicate in polarization-aligned periods.In comparison, Demeter enables adaptive polarization alignment by a customized RF front-end for cross-soil LPWAN with low protocol overhead.

DISCUSSION AND FUTURE WORK
VWC range in our field study.Our in-field experiments were conducted just after a wheat harvest.Therefore, no irrigation was applied, leading to lower VWC values than those reported in the growing season [14,31,41,98] in our field study.Although the controlled experiments (e.g., Table 2, Figure 16) demonstrate a consistent performance gain when the VWC increases to 48%, we plan to conduct a large-scale deployment in the next growing season to evaluate Demeter performance in a more realistic VWC.Hobbyist soil moisture sensor.The soil moisture sensor [47] we used to measure the groundtruth VWC is a hobbyist-level sensor.Although it can correctly report the trend of soil moisture changes, the accuracy of soil moisture measurement is not guaranteed.Since the specific characteristics of the soil greatly influence the accuracy of soil moisture sensors, a more accurate sensor with a soil-specific calibration would be used.In our future work, we will employ a calibratable and accurate professional-level soil moisture sensor for exploring soil-specific polarization calibration.Adaptive polarization calibration for large-scale deployment One of our future works is to go beyond the physical layer design in this paper to build a reliable and energy-efficient network stack for achieving large-scale deployment.Considering environment and soil diversity in large-scale deployment, different LoRa nodes may need to be calibrated with different schedules.Instead of our periodical polarization calibration, on-demand polarization calibration will play a significant role in large-scale deployment as it allows a LoRa node to calibrate its polarization adaptively.A machine learning based method may be feasible to determine the trigger for a polarization calibration by taking multi-dimensional environmental and soil property changes as inputs.However, it is challenging to balance inference accuracy and computation cost on energy-limited LoRa nodes.Moreover, we will integrate RF front-end circuit design of Demeter to facilitate large-scale deployment and quantify the performance and cost benefits compared to other crosssoil communication solutions.

CONCLUSION
In this work, we present Demeter, a novel system that enables reliable cross-soil LPWAN communication.The main contribution of Demeter is a low-cost antenna system that aligns the polarization between LoRa node and gateway antennas and works with COST single RF-chain LPWAN radios.We also develop a low-cost hybrid coupler to encode and change polarization degrees with phase information.Furthermore, we propose a heuristic algorithm to calibrate the polarization alignment automatically.We implement Demeter with customized PCB circuits and COTS devices to evaluate its performance in various soil conditions and scenarios.Demeter can work with various soil types and different environmental conditions.The results show that Demeter can achieve up to 9.94 dB SNR gain outdoors and 11.6 dB indoors, 4× horizontal communication distance, at least 20cm underground depth improvement, and up to 82% energy reduction compared with COTS LoRa node.

Figure 1 :
Figure 1: The illustration of polarization misalignment problem (top) and the idea of cross-soil communication and programmable polarization in Demeter (bottom).

Figure 5 :
Figure 5: System Overview of Demeter.achieved reliable data transmission and incurring new scalability concerns.This motivates us to compensate for polarization misalignment at the LoRa node side compatible with the standard LoRaWAN media access control (MAC).
Equivalent circuit for each unit cell

Figure 7 :
Figure 7: The illustration of the hybrid coupler design.

Figure 10 :
Figure 10: The illustration of peak search algorithm of Demeter for polarization alignment calibration.

Figure 11 :
Figure 11: The implementation of Demeter prototype and experiment environments.The box containing a battery, a LoRa node, and our prototype of Demeter RF components is buried in loam soil at the top right corner of subfigure (c).Moisture experiments with additional moisture sensor are shown in the bottom right corner of (c).

Figure 12 :
Figure 12: Impact of horizontal distance to Demeter.

1 )
Horizontal Distance Experiment Settings: As shown in Figure 11(c), we conduct experiments in multiple horizontal distances from 50 m to 350 m.Orange triangles represent the locations of the gateway at various distances.The blue star is the location of the buried node.The buried depth is 35 cm.We set different SFs from 7 to 10 in the experiments.Results: As Figure 12(b) and Figure 12(a) shown, compared to the baseline, the SNR gain of Demeter is at least 8.87 dB and 9.94 dB with SF-8 at 150 m and SF-7 at 100 m respectively.The average SNR gain of SF9 and SF10 are 6.16dB and 6.55dB, respectively.The average SNR gain of Demeter achieves 6.86 dB across different configurations.We can observe that the SNR difference between Demeter and the baseline varies because the polarization of the baseline is

Figure 13 :
Figure 13: Impact of depth to Demeter.

Figure 14 :
Figure 14: The three different antenna orientations.random when Demeter achieves polarization alignment.Due to terrible polarization, the baseline signals may drop lower than the required SNR for successful decoding.Standard LoRa may increase SF to adapt.Instead, Demeter can recover wireless communication without varying SF.In Figure 12, if the distance is beyond 250 m, the baseline suffers from misalignment polarization, and Demeter trigger polarization alignment calibration to improve the signal SNR from under threshold to above threshold.Every time SF is added by one, the distance of Demeter can be enlarged by 50 m.For SF7, SF8 and SF9, distance promotion is 4×, 2.5×, 2× and 1.75× respectively in the Figure 12(a), Figure 12(b) , Figure 12(c) and Figure 12(d).Based on the results, Demeter can achieve 2.5× communication range on average compared with COTS LoRa.It is equivalent to a 6.56× coverage area gain.2) Depth Experiment Settings: To verify the performance of Demeter in different underground depths, we placed the Demeter node into three depth levels underground, 15 cm, 25 cm, and 35 cm, as SF is set from 7 to 10.We evaluate Demeter under the horizontal distance as 100 m and 300 m.Results: Figure 13(a), Figure 13(b), and Figure 13(c) show the results.In all settings, we can see the SNR gain of Demeter compared to the baseline.Under 300 m horizontal distance and SF-10, the baseline signal can be detected only when the depth is 15 cm.Demeter make the LoRa signal appear again when depth is 25 cm or 35 cm as shown in Figure 13(d).The depth of Demeter can be extended to 2.33× compared with the baseline.In Figure 13(b), the SNR gain is only 2.2 dB at 25 cm depth while the SNR gain is 8.67 dB with 35 cm depth.This indicates the wireless link is unstable when depth changes.The average SNR gain of Demeter achieves 5.30 dB across different configurations.Besides horizontal distance, Demeter can also improve maximal soil depth by polarization alignment calibration for cross-soil wireless communication.3) Antenna Orientations Experiment Settings: The different antenna orientations of the gateway can influence

Figure 15 :
Figure 15: Impact of antenna orientations to Demeter.
(a)) is 6.41 dB, which is close to the 6.34 dB SNR gain of the horizontal antenna (Figure15(b)), and 6.55 dB of 45 • inclined antenna in Figure12(d).This verifies that even if the gateway antenna is put in different orientations suffering from beam mismatching and polarization plane changes, Demeter can work perfectly to provide reliable communication.4) Moisture Experiment Settings: We explore the impact of different moisture levels (11%, 16%, 25%, 36%, 47%).We use a moisture sensor to measure the VWC before we bury Demeter node underground.The measurement depth of VWC sensor and Demeter node is 35 cm.SF is set as 10.Results: As illustrated in Figure16, the average SNR gains with 16% VWC and 25% VWC are 6.41 dB and 6.24 dB respectively compared to the baseline.Both values are close to 6.55 dB gain in Figure12(d) with VWC 11%.The SNR gains decrease slightly due to VWC growing up as the attenuation also increases.The SNR gains in Figure 16(b) range from 3.54 dB to 8.64 dB while SNR gains range from 4.25 dB to 8.49 dB in Figure 16(a).With higher moisture levels in Figure 16(c) and Figure 16(d), the overall SNR decreases because of the moisture-caused attenuation.But Demeter can still compensate 5.29 dB SNR on average when VWC=36% and enlarge 4× horizontal distance in flooding status with VWC=47%.This indicates Demeter can accommodate different soil environments with various moisture conditions to achieve polarization alignment.

Figure 16 :
Figure 16: Impact of moisture to Demeter.

Figure 17 :
Figure 17: Impact of soil type to Demeter.

Figure 18 :
Figure 18: The analysis of energy consumption per day under various settings.touse SF12, we can use SF10 for packet transmission.Given different link budgets and SF settings, the energy saving for each packet ranges from 0.0569 J to 0.5786 J with 3.3 V voltage.First, we make a LoRa node sending six packets per hour to evaluate the energy efficiency of Demeter compared to the standard LoRa under different polarization calibration frequencies.Based on the fact that significant fluctuations in SNR occur only 5 times over a 9-day period in Figure3, we set Θ from 0.5 to 6. Specifically, Demeter 1 triggers the calibration once every two days.Demeter 2, 3, and 4 trigger the calibration 2, 4, and 6 times per day.By default, the payload size is set to 26 bytes.We calculate the energy consumption per day under four different link budgets from SF9 to SF12.To further verify the performance of various payload lengths, we adopt six payload sizes from 10 bytes to 30 bytes.For each payload size, we calculate the average energy consumption per day of 144 packet transmissions under link budgets from SF9 to SF12 (i.e., 36 packets for each link budget).We compare Demeter 2 with the standard LoRa and Fixed-SF12, which always applies SF12 to transmit packets no matter the current link budget.Results: In Figure18(a), Demeter 1-4 outperforms the standard LoRa under different link budgets.For example, compared to the standard LoRa, Demeter 2 reduces energy consumption per day by 68.3% and 57.9% for SF12 and SF9, separately.Moreover, we can see that energy consumption per day increases when calibration trigger frequencies increase.Demeter 1's average energy consumption per day under the four SF settings is 34.1% of the standard LoRa while Demeter 4's increases to 48.5%.Figure18(b) illustrates the energy consumption under different payload sizes.Demeter 2 reduces energy consumption per day by 82.0% compared to Fixed-SF12 and 63.4% compared to the standard LoRa.For a LoRa node with a 4,400 mAh energy store (i.e., two mid-grade • bridge with center frequency at the US915 band for LoRa.A hybrid coupler divides the signal of each input port into two signals with the same amplitude and 90 • phase difference, then crossly combines two signals from two different input ports to generate the signals at two output ports. [49]re 6 illustrates Demeter's hardware architecture, which consists of four components as follows:Passive RF Splitter: To achieve an adjustable polarization degree with only one RF chain and dual-polarized antenna, the first step is to split the single-channel signal into two channels.We use a 3 dB wide-band 2-way passive splitter to divide a signal into two identical signals, each with half the amplitude of the raw signal.Phase Shifter: An adjustable phase shifter adds a phase offset to the input signal.Demeter adopts a programmable digital phase shifter[49]which can be embedded into COTS LoRa nodes with a 3.3 V voltage supply.Hybrid bridge Coupler: The hybrid coupler is implemented as a four-ports (i.e., two inputs, two outputs) 3 dB 90 22) Then, to keep the absolute value of  31 ,  32 ,  41 , and  42 identical for generating the designed  3 and  4 signals, we set  as √22 .The  parameter of our coupler becomes: • phase offset with low loss as shown in Figure 9.The phase difference between  32 and  42 range from to 89.85 • to 90.22 • in the US915 band and  32 and  42 range from to 90.6 • to 90.92 • .Figure 8(b) shows that  31 and  41 are -3.35dB and -3.24 dB.And the reflection loss in  11 and  21 are -22.23 dB and -22.29 dB, still very low levels.The performance is comparable with Roger5880.

5) Soil Type Experiment Settings:
To explore the influence of soil type, we evaluate our system under three agricultural soil types: loam soil, clay soil, and sandy loam soil.The percentages of silt, sand, and clay can categorize soil.Loam has balanced components and good fertility.It holds moisture and nutrients well, drains excess water easily, and allows air to circulate around plant roots, which is ideal for gardening and agriculture.Clay takes the most percentage of clay soil, which has smaller and fewer pore spaces than loam soil, which means that water drains slowly and can cause waterlogging and compaction.Sandy loam soil has more sand compared to loam.It has a coarse texture and a loose structure that allows water and air to flow through easily.In the experiments, the depth is 35 cm and SF is set as 8.Results:The results for loam soil are shown in Figure12(b).Figure17shows the results for sandy loam and clay soils.Demeter achieves higher SNR in sandy loam of Figure17(a)than loam with the same horizontal distance while Demeter achieves lower in clay soil of Figure17(b) than in loam.Baseline signals in sandy loam yield the best performance, while clay soil ones are the worst.The SNR difference between these two types of soil is 3.39 dB.The SNR gain is 6.9 dB, 6.93 dB, and 7.08 dB in loam, sandy loam, and clay soils, respectively.This indicates Demeter can work in multiple types of soils and achieve good communication quality and similar SNR gains.By leveraging the SNR gain of Demeter, we can increase the data rate with a lower SF to save energy compared to the baseline under the same link budget.
[18,20,34,60]riment results indicateDemeter can achieve at least 5 dB SNR gain, which means we can reduce SF by 2 grades with a lower SNR threshold compared to the standard LoRa[18,20,34,60].For example, if the standard LoRa has