| So you think you want to develop a ZigBee | | | | purchase a competitor's product. Use of another |
| application, but you have some questions. What's | | | | ZigBee approved system during development |
| important in a ZigBee development? What tools | | | | may help you discover how your product's |
| do I need? What steps are involved? How much | | | | performance can best be optimized. Another |
| time will it take? What kind of investment is | | | | option to test interoperability is to participate in |
| required? What are the unforeseen questions? | | | | one of the ZigBee Alliance's quarterly |
| The tips presented here can't answer all of these | | | | interoperability events called ZigFests. To |
| questions for everybody, but they will provide a | | | | participate in a ZigFest your company must be at |
| tutorial for the development of your ZigBee | | | | least an Adopter class member of the ZigBee |
| application. | | | | Alliance. There are also certification companies |
| The first and perhaps most important step in | | | | that can provide a pre-certification testing |
| developing your application is to determine | | | | environment. |
| whether ZigBee is appropriate for your product. | | | | Remember that, fortunately, the ZigBee radio is |
| The ZigBee radio standard boasts many | | | | not a frequency hopper like Bluetooth. Before the |
| advantages over other wireless options. With a | | | | network forms, the network coordinator scans |
| public ZigBee profile and conformant platform, | | | | the available channels to find the "clearest" one. A |
| interoperability with other vendor devices is | | | | function to perform this automatic frequency |
| assured. ZigBee was defined to support | | | | selection is usually included with the ZigBee stack |
| extremely low power and remarkably long | | | | you purchase, but is easy to implement if not. |
| battery life. But the ZigBee data rates are low | | | | The network coordinator can then be |
| relative to other wireless options. And while | | | | programmed to periodically test the network to |
| substantially smaller than Bluetooth or 802.11/WiFi, | | | | determine if the selected frequency remains the |
| the ZigBee stack is not a simple piece of | | | | best option. If not, the network coordinator can |
| software. | | | | move the network to a different channel without |
| After deciding that you want to develop a ZigBee | | | | operator intervention. This insures the network will |
| application, you must choose a ZigBee provider | | | | perform optimally at all times. |
| partner. A ZigBee partner will supply the ZigBee | | | | If data security is required for your application, |
| stack software along with a radio chip and | | | | ZigBee includes provisions for strong data |
| baseband microcontroller. Historically, these have | | | | encryption. ZigBee data security is based on the |
| been two chip solutions. Recently, though, vendors | | | | 128-bit AES algorithm. If you are using a public |
| have been introducing single chip ZigBee devices | | | | ZigBee profile then the security decisions have |
| with plenty of additional resources to support | | | | already been made and are pre-defined in the |
| your application code. A quality ZigBee partner will | | | | profile. |
| also supply you with continual updates on the | | | | For a custom application that requires data |
| most recent features. | | | | security, you have options regarding where the |
| Several ZigBee providers are available, and each | | | | security is applied - in the application code or in |
| has invested many person-years of development | | | | the lower layers of the ZigBee stack. If your |
| to arrive at their ZigBee solution. In choosing a | | | | application needs the strongest security possible, |
| partner, you should consider technical aspects (the | | | | secure it in your application code. The ZigBee |
| cost vs. capability of their chipset, supported | | | | stack defines optional security in the lower layers |
| features) and business aspects of the provider | | | | of the stack, which can be used to validate each |
| (company history, licensing costs, technical | | | | data packet that is exchanged on your ZigBee |
| support). The ZigBee providers will also want to | | | | network. |
| know about you - information such as your | | | | Your development will most likely include the |
| previous product development experience and the | | | | development of two ends of a system - the |
| number of devices that you plan to sell. When this | | | | sensors, which may be reduced functionality |
| exchange of information is complete, you should | | | | ZigBee end devices, and the devices with which |
| rather quickly be able to find a ZigBee provider | | | | they want to communicate. Each end of the |
| willing to collaborate on your application. | | | | system will present its own design challenges. |
| After you have chosen a ZigBee provider, you | | | | Power optimization is generally the largest design |
| must then decide how to implement the ZigBee | | | | issue for the sensors, while message |
| radio - as a module connected to the rest of the | | | | management is the largest for the ZigBee routers. |
| system or as a chip integrated into the circuitry | | | | Message management is an important part of the |
| of your board. | | | | application code. Your application code will |
| Using a ZigBee radio module offers many | | | | communicate with the ZigBee stack by sending |
| advantages. A module usually leads to a shorter | | | | messages to the stack by calling stack functions |
| development cycle. The RF design is already done | | | | and receiving messages from the stack through |
| for you - so you don't need to become an RF | | | | callback functions. The application code will likely |
| expert. In addition, a module may carry FCC | | | | need to monitor these messages and may need |
| Modular Approval, which means you won't have | | | | to perform tasks, such as timing messages and |
| to take your product through the FCC's intentional | | | | purging "lost" messages, on top of its normal |
| radiator approval process. | | | | network management task. |
| Disadvantages to using a ZigBee radio module | | | | As part of the application development planning |
| versus an integrated ZigBee chip include a higher | | | | process, be sure to include time to write test |
| per-unit product cost. A module design also | | | | code. During your integration phase, test code will |
| requires more physical space inside the housing | | | | help identify and verify boundary conditions of the |
| and imposes more constraints on the industrial | | | | feature operations. Specialized test code may be |
| design of the product. What's more, a module | | | | required to put the device in perpetual transmit |
| may have limited antenna options, which may be | | | | mode during hardware compliance testing. At the |
| unsuitable for your product. | | | | factory, properly designed test code can quickly |
| The final architecture task is to completely define | | | | and thoroughly verify operation of each device as |
| your ZigBee network structure. The ZigBee | | | | it comes down the line. |
| standard supports multiple topologies for you to | | | | One tool vital to designing a ZigBee application is |
| choose from. These include mesh, star, and | | | | the ZigBee RF sniffer/protocol analyzer. Even if |
| cluster tree network configurations, which are | | | | your design uses a ZigBee radio module and a |
| shown in Figure 1. | | | | public ZigBee profile, you will eventually need to |
| The typical ZigBee network configuration is | | | | examine commands as they are sent over the |
| comprised of low power reduced function end | | | | air. Many protocol sniffers are currently available |
| point devices, generally called sensors. The | | | | with a wide range of capabilities and cost. |
| sensors communicate with full function network | | | | Choosing the sniffer will depend on your |
| control devices that handle the routing of packets | | | | experience with protocol analyzers, the depth of |
| over the network. | | | | protocol analyzing required, future expected |
| ZigBee radios can be implemented in several RF | | | | ZigBee work, and the cost of each unit. The most |
| bands. Those operating in the 2.4 - 2.48 GHz band | | | | logical path is to start with a basic unit and |
| are the most common since this is the only RF | | | | upgrade later if you need additional capabilities. |
| band that is usable worldwide. In North America, | | | | Time-to-Market |
| 915 MHz is available for ZigBee radios and offers | | | | If time-to-market is a major requirement for the |
| a few advantages over 2.4 GHz, such as slightly | | | | system, use of a ZigBee radio module is almost a |
| better range. Fewer chip providers are available | | | | given. A module-based design will provide the |
| who offer the lower frequency range, because | | | | fastest development cycle. |
| antennas tend to be larger and the over-the-air | | | | Many projects require fast time-to-market with a |
| data rate is lower. The 868 MHz version of | | | | small number of devices to introduce a |
| ZigBee also offers valuable features, though it is | | | | technology or a product line. Often, higher volume |
| available for use only in Europe. | | | | production comes at a later date. If that is the |
| Now that all the architecture decisions have been | | | | case, it may be possible for a two-phase |
| made, it is time to open the development system | | | | development - the "fast" phase using a ZigBee |
| provided by your ZigBee partner and dig in. An | | | | radio module and a "cost-reduced" integrated |
| example is shown in Figure 2. The development | | | | design phase to follow. This cost reduction phase |
| system will have sample application code to | | | | often involves merging functionality from modules |
| reference. Your final application will likely resemble | | | | into a single circuit board. The timing of a |
| this sample because you will apply the same | | | | two-phase approach also makes sense, because |
| Application Programming Interface (API) that the | | | | expertise is built with the technology before |
| sample uses. You may also use the same | | | | merging the radio chip on the circuit board. Plan |
| operating system, system calls, and interrupts. | | | | ahead, and the optimal market rollout is |
| Typical API commands are "FormNetwork()", | | | | achievable. |
| "JoinNetwork()", "SendMessage()", and | | | | Like any other electronic device that is brought to |
| "ZigBeeStackTick()." Learn to love this API - you | | | | market, your ZigBee application must meet |
| will live with it for the next couple of months. | | | | regulatory standards. Since a ZigBee device is an |
| During the development phase, you will face | | | | intentional radiator, the device must meet global |
| many design challenges. Many will involve typical | | | | standards. As the owner of the design, you will be |
| embedded development issues, while others will | | | | responsible for submitting the product for |
| arise because you've added a new design element | | | | compliance testing, adjusting the design as needed |
| - the ZigBee stack. | | | | to pass, and filing the final design with the |
| ZigBee advertises ultra low power. This is great | | | | appropriate agency. Plan for several rounds of |
| for the radio - but you have to expand that to | | | | testing as early as possible in the design phase. |
| include your entire system design. To fully | | | | This includes a pre-screening test on the radiated |
| optimize power usage and battery life, the | | | | emissions. |
| firmware, electrical, and RF teams must devote a | | | | Since most ZigBee designs transmit at the low RF |
| good deal of time to optimizing power | | | | power of about one milliwatt, the fundamental RF |
| consumption. As part of this effort, | | | | emissions are not likely to be problematic. |
| microcontroller sleep modes must be defined and | | | | However, requirements on emission levels - |
| implemented. Be aware that your development | | | | particularly the second and third harmonics that fall |
| system may not work properly while the system | | | | into FCC "restricted bands" - need to be carefully |
| is in sleep mode. You may need to use the | | | | monitored. You must also screen less technical |
| old-fashioned "GPIO toggle and scope tracing" | | | | compliance areas, such as product labeling |
| debug techniques. | | | | requirements and antenna limitations. |
| If your system will be battery-powered, keep in | | | | To advertise your product as being ZigBee |
| mind that ZigBee radios do not violate the laws of | | | | compliant, your design must go through ZigBee |
| physics. ZigBee radios use the current required to | | | | certified product testing. To submit the product |
| transmit at the selected power level - typically in | | | | for ZigBee testing, your company must be a |
| the range of 20-50 mA. Achieving multi-year | | | | member of the ZigBee Alliance. Joining the ZigBee |
| battery life is highly dependent on the usage | | | | Alliance is an inexpensive proposition and should be |
| scenario. Pay particular attention to how | | | | done immediately because membership will allow |
| frequently the radio needs to wake up, how long | | | | access to many ZigBee-related documents and |
| it takes to wake up, and how much current it | | | | discussions. Visit their website at for more |
| consumes while asleep. You may find that a | | | | information. |
| ZigBee provider's data sheets are only helpful to a | | | | For each and every ZigBee product, you will need |
| limited extent in this area, and you will end up | | | | to generate a unique 802.15.4 MAC address. The |
| making your own measurements on current | | | | 802.15.4 MAC address is an eight-byte (64 bit) |
| consumption. | | | | value. The first three bytes (the Organizationally |
| In general, the principal tradeoff you need to | | | | Unique Identifier or "OUI") are licensed to your |
| make is data latency versus battery life. It seems | | | | company by the IEEE Standards Association for |
| counterintuitive; however, since ZigBee | | | | an annual fee. Your company is then free to |
| transmissions are at low RF power - in the range | | | | uniquely assign the remaining five bytes. |
| of a milliwatt - battery power usage during | | | | Finally, depending on the factory assembly and |
| transmit and receive modes are similar. Don't | | | | testing process, it may be desirable to have a |
| assume that a radio mode will use little power if it | | | | software-based manufacturing test provide the |
| spends most of the time in receive mode. | | | | MAC address to program into each device. In this |
| The ZigBee development system you start with | | | | case, your application code may need to support |
| will probably not match your final hardware. This | | | | a non-violate memory write function that may |
| means you will be designing new interfaces to | | | | not otherwise be necessary. |
| your devices - buttons, displays, memory, etc. | | | | Conclusion |
| You may also need to add a communication | | | | ZigBee is a well-defined and feature-rich radio |
| channel to another system, such as a system | | | | standard; however, developing a ZigBee product is |
| monitor PC program. This is where taking the | | | | not a trivial exercise. Many engineering disciplines |
| time to thoroughly understand the API and your | | | | must work together to define, architect, design, |
| development system's starting point helps, | | | | test and ready the final product for sale. Following |
| because you will need to merge these new | | | | the suggestions set forth in this discussion will |
| interfaces with the rest of the existing design. | | | | enable you to prepare a practical plan towards |
| In order to verify interoperability of your device, | | | | creation of a ZigBee radio application. |
| you may need to swallow your pride and | | | | |