# Design and Implementation of a Mixed IoT LPWAN Network Architecture
## 4 Electronic Design
### Gateway Intended to Areas without Sigfox Network Coverage  
The device described here and shown in Figure 14, allows solving link faults detected in some locations without Sigfox network coverage. Installed in an intermediate location with suitable Sigfox network coverage and with a point to point LoRa link to the meter devices, it is able to send to the network the data from multiple meters. In addition to enabling the link, there is a saving in the number of network access licenses, since only the bridge device needs one. In the link to the meters, LoRa is used in physical layer due it is an IoT radio technology that allows long range and immunity to interference without sacrificing consumption. In addition, the link is possible in both 868 MHz and 434 MHz ISM bands.  
As can be seen in the flowchart of Figure 15, device operation has a waiting state until a water-meter data frame is received by the LoRa radio module. If a frame is received and its format is validated, it is stored in a pool in non-volatile memory to be sent later to the Sigfox network at the delivery interval established.  
Figure 14: Gateway device to enable link in locations without Sigfox network coverage: (**a**) External view; (**b**) Antenna connectors; (**c**) Internal view.  
Figure 13: Embedded software functions diagram by level.  
This gateway device is compatible with the meter device frame format already described in the previous Section 4.2. Figure 16 shows the full operation diagram of both the counter and the gateway. There are two possible cases. In the first one, corresponding to a type 1 frame, the consumption data is sent from meter to the gateway using the point to point LoRa radio link and new configuration parameters are requested. Upon receiving a frame of this type, the gateway forwards the data to the Sigfox network requesting a downlink answer. This message will contain the configuration parameters that the user has previously established and it will be forwarded to the meter device via LoRa. The meter device will update operation parameters described in Section 4.2. In the second case, corresponding to a type 2 frame, the counter device only sends the consumption data without waiting for a response. The gateway forwards this data to the Sigfox network without requesting a downlink message.  
Figure 16. Operation diagram using the gateway.  
Figure 15. Flowchart of gateway embedded software.  
The device consists of a Waspmote motherboard [38] where are located the microcontroller, the non-volatile memory, a real-time clock (RTC), voltage regulator and battery charge controller. These main board servers are a physical support and electrical interconnection for two communication modules, the first of them complies with LoRa radio specification and the second one with Sigfox radio and link layer protocol specification. Both radio modules include antenna connector, so using coaxial cable this signal has been feed to SMA type connectors placed outside the box enabling three external antennas to increase the link range, one of them for Sigfox in 868 MHz band and two for LoRa in 868 and 434 MHz bands. USB port of the main board is also available outside the box using an industrial type connector. In this way, the device can be powered, recharge the internal battery or perform firmware updates. The built-in 6600 mAh Ion-Lithium battery allows maintaining the operation in case of lack of external power supply. It is also possible to perform autonomous operation without external power supply connecting a solar panel with voltage range of 6-12 V and minimum current of 280 mA. Built-in battery will be charged using the power supplied by the solar panel.  
All the elements that are part of this design are shown in the block diagram of Figure 17. The set is protected by a box made of ABS plastic with IP54 protection degree and antennas and power supply connectors located on the sides.