So you think you want to produce a ZigBee application, but you have some questions. What's leading in a ZigBee development? What tools do I need? What steps are involved? How much time will it take? What kind of speculation is required? What are the unforeseen questions?
The tips presented here can't rejoinder all of these questions for everybody, but they will furnish a tutorial for the development of your ZigBee application.
Basic Microcontroller Architecture
The first and possibly most leading step in developing your application is to decree whether ZigBee is thorough for your product. The ZigBee radio thorough boasts many advantages over other wireless options. With a collective ZigBee profile and conformant platform, interoperability with other vendor devices is assured. ZigBee was defined to support extremely low power and remarkably long battery life. But the ZigBee data rates are low relative to other wireless options. And while substantially smaller than Bluetooth or 802.11/WiFi, the ZigBee stack is not a uncomplicated piece of software.
After choosing that you want to produce a ZigBee application, you must choose a ZigBee provider partner. A ZigBee partner will furnish the ZigBee stack software along with a radio chip and baseband microcontroller. Historically, these have been two chip solutions. Recently, though, vendors have been introducing particular chip ZigBee devices with plenty of added resources to support your application code. A capability ZigBee partner will also furnish you with continual updates on the most modern features.
Several ZigBee providers are available, and each has invested many person-years of development to arrive at their ZigBee solution. In choosing a partner, you should think technical aspects (the cost vs. capability of their chipset, supported features) and company aspects of the provider (company history, licensing costs, technical support). The ZigBee providers will also want to know about you - information such as your old stock development palpate and the estimate of devices that you plan to sell. When this transfer of information is complete, you should rather speedily be able to find a ZigBee provider willing to collaborate on your application.
After you have chosen a ZigBee provider, you must then decree how to implement the ZigBee radio - as a module associated to the rest of the theory or as a chip integrated into the circuitry of your board.
Using a ZigBee radio module offers many advantages. A module usually leads to a shorter development cycle. The Rf produce is already done for you - so you don't need to come to be an Rf expert. In addition, a module may carry Fcc Modular Approval, which means you won't have to take your stock straight through the Fcc's intentional radiator approval process.
Disadvantages to using a ZigBee radio module versus an integrated ZigBee chip consist of a higher per-unit stock cost. A module produce also requires more corporeal space inside the housing and imposes more constraints on the market produce of the product. What's more, a module may have minute antenna options, which may be unsuitable for your product.
The final architecture task is to completely define your ZigBee network structure. The ZigBee thorough supports many topologies for you to choose from. These consist of mesh, star, and knot tree network configurations, which are shown in figure 1.
The typical ZigBee network configuration is comprised of low power reduced function end point devices, ordinarily called sensors. The sensors retell with full function network operate devices that handle the routing of packets over the network.
ZigBee radios can be implemented in several Rf bands. Those operating in the 2.4 - 2.48 Ghz band are the most base since this is the only Rf band that is usable worldwide. In North America, 915 Mhz is available for ZigBee radios and offers a few advantages over 2.4 Ghz, such as slightly good range. Fewer chip providers are available who offer the lower frequency range, because antennas tend to be larger and the over-the-air data rate is lower. The 868 Mhz version of ZigBee also offers essential features, though it is available for use only in Europe.
Now that all the architecture decisions have been made, it is time to open the development theory provided by your ZigBee partner and dig in. An example is shown in figure 2. The development theory will have sample application code to reference. Your final application will likely look like this sample because you will apply the same Application Programming Interface (Api) that the sample uses. You may also use the same operating system, theory calls, and interrupts. Typical Api commands are "FormNetwork()", "JoinNetwork()", "SendMessage()", and "ZigBeeStackTick()." Learn to love this Api - you will live with it for the next integrate of months.
During the development phase, you will face many produce challenges. Many will involve typical embedded development issues, while others will arise because you've added a new produce element - the ZigBee stack.
ZigBee advertises ultra low power. This is great for the radio - but you have to advance that to consist of your whole theory design. To fully optimize power usage and battery life, the firmware, electrical, and Rf teams must devote a good deal of time to optimizing power consumption. As part of this effort, microcontroller sleep modes must be defined and implemented. Be aware that your development theory may not work properly while the theory is in sleep mode. You may need to use the old-fashioned "Gpio toggle and scope tracing" debug techniques.
If your theory will be battery-powered, keep in mind that ZigBee radios do not violate the laws of physics. ZigBee radios use the current required to transmit at the excellent power level - typically in the range of 20-50 mA. Achieving multi-year battery life is extremely dependent on the usage scenario. Pay particular attentiveness to how frequently the radio needs to wake up, how long it takes to wake up, and how much current it consumes while asleep. You may find that a ZigBee provider's data sheets are only helpful to a minute extent in this area, and you will end up production your own measurements on current consumption.
In general, the essential tradeoff you need to make is data latency versus battery life. It seems counterintuitive; however, since ZigBee transmissions are at low Rf power - in the range of a milliwatt - battery power usage while transmit and receive modes are similar. Don't assume that a radio mode will use minute power if it spends most of the time in receive mode.
The ZigBee development theory you start with will probably not match your final hardware. This means you will be designing new interfaces to your devices - buttons, displays, memory, etc. You may also need to add a communication channel to an additional one system, such as a theory monitor Pc program. This is where taking the time to completely understand the Api and your development system's starting point helps, because you will need to merge these new interfaces with the rest of the existing design.
In order to verify interoperability of your device, you may need to swallow your pride and buy a competitor's product. Use of an additional one ZigBee beloved theory while development may help you search for how your product's carrying out can best be optimized. an additional one option to test interoperability is to partake in one of the ZigBee Alliance's regular interoperability events called ZigFests. To partake in a ZigFest your company must be at least an Adopter class member of the ZigBee Alliance. There are also certification associates that can furnish a pre-certification testing environment.
Remember that, fortunately, the ZigBee radio is not a frequency hopper like Bluetooth. Before the network forms, the network coordinator scans the available channels to find the "clearest" one. A function to accomplish this self-acting frequency option is usually included with the ZigBee stack you purchase, but is easy to implement if not. The network coordinator can then be programmed to periodically test the network to decree if the excellent frequency remains the best option. If not, the network coordinator can move the network to a dissimilar channel without operator intervention. This insures the network will accomplish optimally at all times.
If data safety is required for your application, ZigBee includes provisions for strong data encryption. ZigBee data safety is based on the 128-bit Aes algorithm. If you are using a collective ZigBee profile then the safety decisions have already been made and are pre-defined in the profile.
For a practice application that requires data security, you have options concerning where the safety is applied - in the application code or in the lower layers of the ZigBee stack. If your application needs the strongest safety possible, regain it in your application code. The ZigBee stack defines optional safety in the lower layers of the stack, which can be used to validate each data packet that is exchanged on your ZigBee network.
Your development will most likely consist of the development of two ends of a theory - the sensors, which may be reduced functionality ZigBee end devices, and the devices with which they want to communicate. Each end of the theory will present its own produce challenges. Power optimization is ordinarily the largest produce issue for the sensors, while message administration is the largest for the ZigBee routers.
Message administration is an leading part of the application code. Your application code will retell with the ZigBee stack by sending messages to the stack by calling stack functions and receiving messages from the stack straight through callback functions. The application code will likely need to monitor these messages and may need to accomplish tasks, such as timing messages and purging "lost" messages, on top of its general network administration task.
As part of the application development planning process, be sure to consist of time to write test code. while your integration phase, test code will help identify and verify boundary conditions of the feature operations. Specialized test code may be required to put the gismo in perpetual transmit mode while hardware compliance testing. At the factory, properly designed test code can speedily and completely verify carrying out of each gismo as it comes down the line.
One tool vital to designing a ZigBee application is the ZigBee Rf sniffer/protocol analyzer. Even if your produce uses a ZigBee radio module and a collective ZigBee profile, you will eventually need to search for commands as they are sent over the air. Many protocol sniffers are currently available with a wide range of capabilities and cost. choosing the sniffer will depend on your palpate with protocol analyzers, the depth of protocol analyzing required, future thinkable, ZigBee work, and the cost of each unit. The most logical path is to start with a basic unit and upgrade later if you need added capabilities.
Time-to-Market
If time-to-market is a major requirement for the system, use of a ZigBee radio module is practically a given. A module-based produce will furnish the fastest development cycle.
Many projects wish fast time-to-market with a small estimate of devices to introduce a technology or a stock line. Often, higher volume output comes at a later date. If that is the case, it may be potential for a two-phase development - the "fast" phase using a ZigBee radio module and a "cost-reduced" integrated produce phase to follow. This cost reduction phase often involves merging functionality from modules into a particular circuit board. The timing of a two-phase advent also makes sense, because expertise is built with the technology before merging the radio chip on the circuit board. Plan ahead, and the optimal market rollout is achievable.
Like any other electronic gismo that is brought to market, your ZigBee application must meet regulatory standards. Since a ZigBee gismo is an intentional radiator, the gismo must meet global standards. As the owner of the design, you will be responsible for submitting the stock for compliance testing, adjusting the produce as needed to pass, and filing the final produce with the thorough agency. Plan for several rounds of testing as early as potential in the produce phase. This includes a pre-screening test on the radiated emissions.
Since most ZigBee designs transmit at the low Rf power of about one milliwatt, the basal Rf emissions are not likely to be problematic. However, requirements on emission levels - particularly the second and third harmonics that fall into Fcc "restricted bands" - need to be determined monitored. You must also screen less technical compliance areas, such as stock labeling requirements and antenna limitations.
To advertise your stock as being ZigBee compliant, your produce must go straight through ZigBee certified stock testing. To submit the stock for ZigBee testing, your company must be a member of the ZigBee Alliance. Joining the ZigBee Alliance is an inexpensive proposition and should be done immediately because membership will allow access to many ZigBee-related documents and discussions. Visit their website at http://www.zigbee.org for more information.
For each and every ZigBee product, you will need to create a unique 802.15.4 Mac address. The 802.15.4 Mac address is an eight-byte (64 bit) value. The first three bytes (the Organizationally Unique Identifier or "Oui") are licensed to your company by the Ieee Standards association for an yearly fee. Your company is then free to uniquely assign the remaining five bytes.
Finally, depending on the premise assembly and testing process, it may be desirable to have a software-based manufacturing test furnish the Mac address to agenda into each device. In this case, your application code may need to support a non-violate memory write function that may not otherwise be necessary.
Conclusion
ZigBee is a well-defined and feature-rich radio standard; however, developing a ZigBee stock is not a trivial exercise. Many engineering disciplines must work together to define, architect, design, test and ready the final stock for sale. Following the suggestions set forth in this argument will enable you to put in order a practical plan towards creation of a ZigBee radio application.
Tips for Designing ZigBee ApplicationsHigh Pressure Sensor Differential Pressure Sensors Absolute Encoders