Design and implementation of a flexible node for IoT supporting 6LoWPAN and a sensor shield for home automation application

The Internet of Things (IoT) and Industry 4.0 is evolving and has a high demand for reliable electronics. This work contributes to the creation of user-friendly and robust applications for the IoT. The topic is the development of a radio communication system regarding the requirements for the end user and concerning a high flexibility of the application. The result is a core board featuring USB programming capability to flash the user application, USB power delivery (USB-PD) for battery charging, a fuel gauge, as well as a Microcontroller Unit (MCU), and a Radio Frequency (RF) transceiver. This core board can be combined with different sensor or actor shields to increase the flexibility and reusability. To ensure proper functionality of all crucial design blocks they are analyzed and simulated with state of the art techniques. First, the system requirements are laid out and explained in detail. The implementation that satisfies these requirements is presented and necessary simulations are discussed, the results are presented. To complete the work, measurements of the system are shown and compared with the simulation.


Introduction
The chair of Integrated Analog Circuits and RF Systems (IAS) has developed a low complexity Multistandard dual band wireless transceiver (Mueller et al., 2017).This work intends to develop and provide a hardware platform in form of a sensor node, into which the RF transceiver can be embedded.
Therefore, this work's goal was to examine all function blocks of a wireless sensor node regarding their requirements and based on them design and implement a sensor node.Secondary setting up the integrated development environment (IDE) for the RIOT Operating System (OS) (Baccelli et al., 2013) and gain insight into the development procedure was intended.An additional objective was to implement all required drivers and modules in parallel to the hardware development.
Sensor nodes are mostly battery powered and thus require a power management.To address this a power management Integrated Circuit (IC) is implemented, which supports USB Power Delivery and therefore fast charging or powering shields with up to 15 W. The USB-C connector is symmetrical, which simplifies the usage a lot and supports USB-PD.Supporting up to 3 A of charging current at 5 V, pose a challenge for the implementation on a two-sided Printed Circuit Board (PCB), as well as the USB-C connector PCB design.So the implementation and simulations for power path and the Hi-Speed USB transmission lines are crucial.
The power consumption in different power modes must be considered when choosing a DC-DC converter.For a sensor node which is mostly in idle or standby the DC-DC converter must be efficient to reduce power dissipation, especially at low currents.A DC-DC solution is selected which offers tunable voltage and has two supply pins one for the core board and one switchable for the shield voltage.
The transceiver's RF path and the matching network must be considered and are examined with simulations, followed by the presentation of the measured antenna matching.
As a basic example a sensor shield is presented which features soil moisture, humidity, and temperature sensors and can be used as a plant sensor.
This work presents the considerations and simulations needed for the development of radio communication systems with state of the art features.

USB USB-controller ATmega16U2
PowerPath and charge controller bq24298

Battery
Fuel gauge LC709203F 2 System overview

Core board
The presented sensor node is designed based on the AT-mega256RFR2 (Atmel, 2014).It integrates an 8-bit microcontroller core as well as a 2.4 GHz transceiver, which supports the IEEE 802.15.4 (IEEE, 2011) standard including IPv6 over Low power Wireless Personal Area Networks (6LoWPAN).Furthermore, it includes different power save modes.It works with variable input voltages ranging from 1.8-3.3V with the lowest power consumption at 1.8 V.
A schematic representation of the system is shown in Fig. 1.It can be split into four sub-circuits.The main processor and an RF circuit containing the antenna diversity switch, the chip antenna and an ultraminiature coax connector (UMCC) for a second or external antenna.A USB part to program the main processor with an USB to Serial bridge using the ATmega16U2 (Atmel, 2012).And finally, a power management circuit to charge the battery, control the power flow and convert the voltage for the main processor and external shields.

Battery monitoring
In the application at hand it is very important to monitor the battery's state of charge to be able to warn the user of an upcoming system shut-down caused by low battery.In addition, it keeps track of the state of health of the battery to predict possible failure or to notify when it needs to be replaced.
The LC709203F (ON Semiconductor, 2017) fuel gauge by ON Semiconductor fulfills all requirements.It communicates with the main controller via a two-wire I 2 C interface and cal-culates the state of charge by measuring the voltage across the battery terminals opposed to the current from the battery.A current based measurement method and the high charge current would require a high power shunt resistor and therefore would increase losses.

USB type-C connector
Wireless sensor nodes are mostly placed at the location of operation until the battery must be recharged.In most cases the battery is charged seldom and thus the lifetime is restricted by the shelf aging of the lithium ion battery.Hence, fast charging does not impact the lifetime drastically but increases the comfort (Digi-Key's North American Editors, 2016).Designing the node to support as much charge current as possible also increases the usability, as charging batteries with higher capacities within a manageable time becomes a possibility.
As an additional feature, the core board can then be used without battery supporting shields with higher current demand.With backwards compatibility to USB 2.0 and reversible plug-ability the USB Type-C connector is very convenient.In combination with the USB Power Delivery standard it supports currents of up to 3 A at 5 V without protocol implementation and can be implemented without additional overhead.Figure 8 shows the core board mounted on the shield and the front side of the shield after assembly.

Power management
Implementing a power path IC, which manages charging of the battery and power source control, is the best choice as it reduces part count and enables power path configuration.As power management controller the bq24298 by Texas Instruments is chosen.It features a power source selection and a battery charger.The two input power sources, the USB power line, and the battery, are connected to the controller.The algorithm decides if the power from the USB port is good and if so, it starts charging the battery with a constant current-constant voltage method.The controller is able to charge Li-ion batteries with up to 3 A of current in the constant current phase.Settings like the constant current phase charge current can be set in internal registers via a two-wire I 2 C interface.If only battery power is present the controller feeds it through to the system (Texas Instruments, 2016).
As there are no miniature mechanical switches that can handle currents up to 3 A a power switch IC TPS27082L (Texas Instruments, 2014) is used to implement a power on/off function.
The implementation challenges for both ICs are the high currents in relation to the tight space available.This includes fitting large traces to minimize resistive losses on the power lines as well as providing large ground planes for sufficient cooling while the controller operates in step-down mode.

Power consumption and supply
Power conditioning for the main processor and the external shield is done by a dedicated DC-DC step-down converter.The input of the converter is the output of the power management controller which can range from 3 to 4.2 V.
The power consumption of the main controller in its different power modes is listed in Table 1.In deep-sleep mode the controller uses extremely low power, so special care has been taken when choosing the controller in regard to very high efficiencies at low loads.Table 1 also shows that the lowest possible power consumptions can only be reached if a supply voltage of 1.8 V can be offered.The maximum supply current calculates to 18.6 mA.
These requirements led to the TPS62740 by Texas Instruments.The input voltage can be stepped down from 2.2-5.5 to 1.8-3.3V in 100 mV steps.This voltage range is within the input range of the main processor of 1.8-3.6V.The interface for voltage selection are 4 pins that can be controlled by the main processor.The external shield is connected via a  dedicated load pin, that allows to deactivate the shield completely.It supports output currents of up to 300 mA.The DC-DC converter has a power efficiency of 90 % from the maximum output current of 300 mA down to 10 uA and still 60 % at 1 uA (Texas Instruments, 2014).The Power Down Mode with almost everything powered off is unlikely to be used at a sensor node as at least a RTC will be active to be able to wake up in intervals.

Layout rendering
Figure 2 shows the layout and highlights the different functional parts.

Power lines
The power lines are designed to handle the aforementioned 3 A of system current.To keep the costs of the board low, it is designed as a two-layer PCB.As there is no space for large current carrying power planes, the high current traces must be designed as a trade-off between available PCB space and power loss due to immoderate resistance.
Following the IPC-2152 (IPC, 2009) standard, the high current traces were designed to be 0.8 mm wide to allow a maximum temperature rise of 20  Special investigations were carried out for the power paths, which lead from the battery or USB connector to the power management IC and then to the external shield.On these the maximum current can flow to either charge the battery or to power a large external load.These paths are simulated with the power integrity tool included in Agilent's ADS.The scale for the Figs. 3 and 4 is chosen from 0 in blue to 120 A mm −2 in red, where 120 A mm −2 is the current density of 3 A on a 0.8 mm trace.
The current path to the load and the ground plane was designed to be capable to support high currents.All Ground paths where designed to be in one corner of the board and have the least resistive path by avoiding cuts and place dedicated vias for the back current.
Figure 3 shows the power path from the battery connector on the bottom side to the power management IC and then to the external shield on top.It is important to design the traces so that there are no sharp corners in the high-power path to prevent local current density maxima.
Also, the return currents from the pin-header, connected to the ground planes, distribute evenly.Avoidance of plane cuts allows for a direct path back to battery.
The power path from the USB type-C connector to the power management IC is shown in Fig. 4. The small pitch of the USB connector prohibits an easy trace layout.Therefore, this part was simulated extensively.
From these simulations it is expected to achieve a good performance of the power traces and no complications due to no excessive power loss on the traces.

Thermal considerations
The goal of designing a small sized board conflicts with high current support to enable different kinds of applications.
As described by Edwards and Nguyen (2003) the in manuals specified parameter R θJA cannot be used to estimate junction temperatures even though often is used by system designers to plan the cooling.Calculation based on it will result in extremely erroneous values as it depends 70-95 % from the test board layout.
When designing the thermal flow from the devices based on JB defined by JEDEC (2008b) the calculated copper area needed for cooling is still very large.Thus, the heat dissipation for the two critical devices, the charge IC and the switch IC, is considered by adding many vias to the thermal pad and usage of very wide traces connected to the ICs, to ensure the best feasible cooling.
The power switch IC has no thermal pad and must be cooled by the traces or from the IC casing directly to air.With a turn-on resistance of approx.50 m and a current of 3 A the power to dissipate is 450 mW.Calculated with a R θJA of 106 • C W −1 this results in at least 47.25 • C temperature rise if the board design is as good as the test board used for measuring R θJA .
This cannot be the case as this board is only doublelayered while the test board is a four-layer PCB.This board is also smaller and has shorter traces connected to the IC.

USB data lines
For communicating to an attached PC only the USB 2.0 standard is implemented.Therefore, the data lines are designed following the USB-IF (2000) specification.The transmission lines have a differential impedance of 90 and 15 series resistors as current limiter.The data lines are protected against Electrostatic Discharge (ESD) by a dedicated USB ESD protection IC.The differential pair is designed to have the same length and is as short as possible.The layouts of the lines are with Agilent ADS.The resulting Eye Diagram is shown in Fig. 5. Compared to the USB 2.0 eye diagram mask (USB-IF, 2000, p. 136) the signal is according the specification and a reliable communication is expected.This is confirmed as the USB communication of the PC and the AT-mega16U2 works flawlessly.

RF lines
The RF lines are designed to guarantee maximum RF power transfer.They are designed as 50 line impedances to match the output impedance of the transceiver and the matching network of the antenna.This is done by manipulating the geometry of the signal traces.For an in-depth mathematical derivation see Wadell (1991).The traces are calculated to be 0.47 mm wide with a clearance of 0.1 mm to the ground plane.
Furthermore, the matching network used to bring the input impedance of the antenna to 50 has been simulated with ADS.Simulating the transmission line layout with the antennas S-parameters given by the manufacturer show a good return loss, dotted red plot in Fig. 6.
Nevertheless, to achieve better matching and increase the transmit power also for the outer bands, a π -shaped matching network was designed as close as possible to the antenna.
To get representative simulation results the ideal components are substituted for the nearest possible real component with S-parameters of the manufacturer.With one shunt and one series matching component the input impedance is shown as dotted blue line in Fig. 6.

RGB LED
The integrated red, green, blue light emitting diodes (RGB LED) for general status indication is powered by the system voltage output of the power management IC and switched by three low-side n-channel MOSFETs.Connecting the LED to V pp,main is necessary, as the output of the DC-DC converter can be set to 1.8 V which is lower than the threshold voltage of the LEDs.
Additional the MOSFETs where chosen to prevent V pp,main to be applied to the pins which only supports 3.6 V.In contrast to sinking the led current into the MCU pins, us- ing additional transistors allows the LED status to be controlled by pulling the MCU pin high.Thus, no pins will need to be kept high in deep-sleep while the LED is off.
The LEDs can also be controlled by a dedicated hardware timer generating hardware-controlled pulse width modulation (PWM) for these pins.Thus, keeping the LED illuminated does not require a software PWM which would result in MCU load.It also enables the LED to work in stand-by mode.

Power path
The different power paths described above are verified with thermal imaging while in use.
The path from the battery to the external load via the power management IC and the switch IC is shown in Fig. 7a, b.As expected the main heating is focused at the switch IC.While powering the load from the USB connector the power management IC and the attached power inductor heat up as www.adv-radio-sci.net/16/67/2018/Adv.Radio Sci., 16, 67-75, 2018 seen in Fig. 7c, d.All possible currents and their respective temperature are listed in Table 2.
Calculating the junction temperature for the maximal supported current based on the measured temperature with Eq. ( 1) from JEDEC (2008a) results in an acceptable value for both ICs in battery charging mode.
As stated in the DIN (2008) burning temperature for different materials are listed in Table 3.To avoid burning, a device that is handled by the user should not use charging currents above 1.5 A. If the device is inaccessible proper functionality for 2 A is guaranteed, the full support of 3 A charging current cannot be supported.At a load current of 3 A the power management IC goes into thermal limit and reduces the output current keeping the temperature at 123 • C.
Powering external circuits cannot exceed 2 A if USB is used as source.Using 3 A current can be supported from the battery.

Antenna matching measurment
The measuring and optimization of the antenna matching network is done with the ZVL network analyzer from Rohde & Schwarz.A special antenna matching measurement board was produced which contains only the traces of the balun and the antenna: the RF path, the RF switch IC, the matching network and the antenna.The balun was replaced with an landing pad for an UMCC connector to be able to connect the network analyzer.First the PCB has been deembedded by measuring the return loss of the traces up to a 0 jumper before the antenna with no matching components installed.This measurement is stored in the internal memory of the network analyzer and will be used as divisor for the measurement of the matching network as explained by Cantrell (2010).
To measure the antennas S 11 a 0 jumper is installed and the measurement is deembedded with the stored value.The measured return loss for the antenna is not as the simulated one with the S 11 from the supplier, shown as solid red line in Fig. 6.
Based on the measured and deembedded S 11 the ADS smith chart utility was used to match the antenna successively.A shunt capacitance of 0.9 pF and a series inductance of 1.2 nH are used, the resulting performance is shown as solid blue line in Fig. 6.
With that the characteristic of the transmittance is shifted to the required frequency range of 2400-2483.5MHz, and results in a return loss of at least −12 dB at the outer bands and up to −21 dB at the center frequency.Resulting in a transmission of 93.7-99 % of the applied power in the desired frequency range.

Power consumption
The measurement of the system shown in Table 4 indicates that the chosen DC-DC converter fits perfectly and the losses are kept as low as possible.In power save mode with active RTC the power consumption is in the area where the DC-DC converter has an efficiency of at least 90 %.

Conclusions
This work shows all considerations which have been made while designing this low power wireless node.It describes the requirements and explains the chosen solution.All necessary simulations are shown and discussed in detail and validated by measurements.Relevant standards and regulations are discussed and fulfilled.
As shown in Fig. 1 the external shield can use two power domains.Firstly, directly from the battery or from the USB, enabling higher current applications.Secondly, the regulated and configurable power supply from the core board's DC-DC.The board is designed to be as efficient as possible in a low power state by disabling shield power and reducing supply voltage to 1.8 V.But it is also able to supply higher currents when the application demands it.With this unique feature the core board is highly flexible and enables a multitude of applications.
The board supports adjustable charge currents for different battery sizes.It can be used battery powered or can be powered directly via a USB mains adapter or power pack.With battery charging and monitoring capabilities the core board fulfills all requirements of a wireless sensor node.
A USB programmer is implemented which allows easy flashing of an application into the main processor without requiring an additional costly ISP programmer.The programmer is completely shut down when no USB power supply is available.
Featuring a transceiver with antenna diversity for usage with two antennas enables the core board to be used with a second antenna which has a directional radio pattern or when placed in a housing.
Temperature measurements show that it was not possible to ensure highest power in all supply scenarios, as the size constrains did not allow for better cooling of the devices.An additional cooler, applied to the power switch and the power path IC, could increase the thermal flow but where not tested.Nevertheless, 2 A charging currents are supported and up to 3 A for high current loads can be used.
As the board works properly this work is a well-built achievement.Based on this a shield with the transceiver of the Institute can be developed and a network based on it can be implemented.
Parallel to the hardware design, software has been implemented.This includes the USB to serial bridge that is used to flash the main MCU.For the main MCU a bootloader was implemented, and RIOT OS was ported.All drivers and modules needed to control the power path IC, the fuel gauge, the RGB LED and the transceiver module where realized.
Also, drivers for all sensors on the shield where implemented.This includes modules for the humidity sensors SHTC1 (Sensirion, 2015), SHT21.Also, the driver for the comparator and timer, required by the soil moisture sensor, were implemented.

Figure 2 .
Figure 2. Layout rendering with description of the functional parts.

Figure 3 .
Figure 3. Current density simulation battery to power management IC to external shield, PCB (a), PCB (b).

Figure 6 .
Figure 6.Simulated (dotted) and measured (solid) return loss of the antenna (red) and the antenna with matching network (blue).

Figure 7 .
Figure 7. Thermal images of the board with different currents.

Figure 8 .
Figure 8. Core board mounted on shield and front side of the shield board.

Table 1 .
Datasheet specification for current consumption of different modes and resulting power consumption for different voltages.

Table 2 .
Board temperature at different load currents at 23 • C.

Table 3 .
Burning temperature human skin

Table 4 .
Measured system current consumption at 3.7 V of different modes and resulting power consumption.