How to Implement a Mesh Network for the Smart Home

作者:European Editors

投稿人:DigiKey 欧洲编辑

Mesh networks are an ideal design solution for the home, but need some consideration in the design and implementation. Creating a mesh network allows new devices to be easily added as that new device connects to a nearest neighbor and easily extends the overall coverage of the network. However, this requires a more sophisticated authentication process that has to be implemented throughout the network rather than in a central hub. While adding new devices extends the range, it also reduces the bandwidth available to each node. This is because the data has to hop from one node to the next alongside the data from the neighboring nodes. If many nodes are active simultaneously, the bandwidth can drop dramatically. This can be a problem for high bandwidth applications such as streaming video for wireless security or monitoring cameras in the smart home, but for wireless sensors and actuators it does not have a noticeable impact.

The IEEE802.15.4 protocol is probably the most well established open standard for mesh networks in the home, with the ZigBee implementation used for millions of nodes around the world in the unlicensed 2.4 GHz band. With the latest version, it has been updated to include IPv6 addressing of each node and support for ultra-low-power operation by harvesting energy from the environment.

ZigBee PRO networks are built with several different types of devices. The ZigBee Coordinator controls the formation and security of the mesh networks, while the routers extend the range of the mesh and connect to end devices that are specific sensors or controllers in the smart home. These functions can be easily combined in a single device, for example with a device that controls a light fixture and also routes messages to the rest of the network. However, this also allows the end nodes to be as simple and low cost as possible.

Image of typical ZigBee mesh network in the smart home

Figure 1: A typical ZigBee mesh network in the smart home includes a number of different functions that can be integrated into a single device.

The example ZigBee topology shown in Figure 1 includes one coordinator, five routing devices, two end devices creating a control network and an optional combination coordinator/gateway providing access to the Internet. For example, in a smart home the coordinator may be a home theater control system with additional smart support for lighting and security around a house.

The ATmega2564RFR2 from Atmel is a low-power 8-bit microcontroller combined with a high data rate 2.4 GHz transceiver that can be used to build cost-effective ZigBee end points in the smart home. The controller uses the AVR Harvard architecture that allows the instructions to be executed in a single clock cycle and achieves throughputs approaching 1 MIPS per MHz. This allows the system designer to balance the power consumption, for example for a battery-based node, against the performance.

The radio transceiver provides data rates from 250 kbit/s to 2 Mbit/s that, along with the frame handling, can be used in the mesh to provide a minimum network data rate of 250 kbit/s. The transceiver provides a crystal stabilized fractional-N synthesizer and support for full Direct Sequence Spread Spectrum Signal (DSSS) processing with spreading and de-spreading that is fully compatible with the IEEE802.15.4-2011/2006/2003 protocol and with the ZigBee standards that sit on top. The -100 dBm receiver sensitivity and the programmable transmit output power from -17 dBm up to +3.5 dBm allow the designer to choose between a long range link up to 100 m or lower power operation throughout the smart home.

Diagram of Atmel wireless transceiver in the ATmega2564

Figure 2: The wireless transceiver in the ATmega2564 is directly connected to the AVR controller core to simplify node design.

The single-chip system includes all the elements to simplify the node design, from internal voltage regulation to the power management as well as direct connection to the AVR core. This has thirty-two general-purpose 8-bit registers that are directly connected to the Arithmetic Logic Unit (ALU). This allows two independent registers to be accessed with a single instruction executed in one clock cycle. This provides very efficient code to keep the RAM memory low while still achieving throughputs up to ten times faster than conventional CISC microcontrollers.

One key element for the ZigBee node design is the connection to the peripherals such as sensors or controllers. This is handled through the Two-Wire Serial Interface (TWI) shown in Figure 3 which allows the system designer to interconnect up to 128 different devices using two simple bi-directional bus lines, one for clock (SCL) and one for data (SDA). The only external hardware needed to implement the bus is a single pull-up resistor for each of the TWI bus lines. All devices connected to the bus have individual addresses, which simplifies the data transfers, and the resolution of any bus contention is handled directly in the TWI protocol.

Diagram of two-wire interface (TWI) in a ZigBee mesh node 

Figure 3: The two-wire interface (TWI) simplifies the connection of peripherals in a ZigBee mesh node.

The address packets on the TWI are 9 bits long, with seven address bits, one READ/WRITE control bit and an acknowledge bit. If the READ/WRITE bit is set, a read operation is to be performed, otherwise a write operation should be performed, and this avoids any bus contention.

The other key element is the power consumption. This is addressed in the chip through a series of different power management modes. The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, TWI port, and interrupt sub-system to keep functioning so that external sensors can still deliver data to the device. The Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next interrupt or hardware reset. In the Standby mode, the RC oscillator is running while the rest of the device is sleeping, and this allows a fast start-up.

ZigBee networks support up to 64,000 individual devices, which for the smart home may be overkill. Bluetooth is now looking at how existing Bluetooth receivers can be used to provide a mesh capability similar to that of ZigBee through a software upgrade. This would allow the Bluetooth network around the home to be accessed via a smartphone linking to one device and then connecting via the mesh to all the other nodes. 

Texas Instruments' CC2564 standalone Bluetooth transceiver is aimed at both traditional Bluetooth links and at the latest Bluetooth Low Energy (BLE) 4.1 protocols. To simplify the node design, a royalty-free software Bluetooth stack is already integrated with TI's MSP430, ARM Cortex-M3 and Cortex-M4 microcontrollers that connect to the transceiver. This architecture allows third party developers to add their own mesh capabilities on top of the BLE stack for smart home connections.

Diagram of CC2564 from Texas Instruments

Figure 4: The CC2564 from Texas Instruments connects to an external microcontroller that can be used to implement a mesh network protocol.

To further simplify the design of a Bluetooth node in the smart home, the BGM111 Bluetooth Smart module from Silicon Labs brings the transceiver and controller together in a module that that can also host end user applications. This means no external microcontroller is needed, allowing the wireless node to be smaller and cheaper. It is also designed to have flexible hardware interfaces to easily link to different peripherals or sensors.

The module can be powered using a standard 3 V coin cell battery but also provide up to +8 dBm transmit power to allow the node designer to tradeoff range and power consumption. Often a module has a strictly defined set of I/O pins, which can limit the options for a design to interface to external sensors. With the BGM111 module, the twenty-five pins can be organized into ports with up to sixteen pins each, and these can be individually configured as either an output or input pin, and also used in an open-drain, open-source or glitch filtering configuration.

Image of Peripheral Reflex System in the Silicon Labs BGM111 module (click for full-size)

Figure 5: The Peripheral Reflex System in the BGM111 module is an internal cross bar that allows a highly flexible I/O structure in a Bluetooth network node.

This comes from an internal signal crossbar called the Peripheral Reflex System that is shown in Figure 5. This crossbar allows various peripheral functions to be assigned freely to any GPIO pad, simplifying application board layout. This means that the same module can be easily used for a wide range of nodes in the mesh network, with the GPIO lines reconfigured to support varying board layouts in the different applications. 

Conclusion

Mesh networks are becoming increasingly popular as a way of delivering a smart network through the home at a reasonable cost. While ZigBee devices continue to innovate and build on the existing base of network controllers and well-tested mesh software, Bluetooth is now also moving into this area with both dedicated transceivers and modules. This is opening up more opportunities for designers to modify and optimize the Bluetooth stack for mesh applications, or make use of flexible, integrated modules. All of this helps to bring more smart wireless functionality into the home.

 
DigiKey logo

免责声明:各个作者和/或论坛参与者在本网站发表的观点、看法和意见不代表 DigiKey 的观点、看法和意见,也不代表 DigiKey 官方政策。

关于此作者

European Editors

关于此出版商

DigiKey 欧洲编辑