Vous êtes sur la page 1sur 10

Use SerialNet application on both controller & endpoints, as in Figure 1.

Links on boards select whether board is controller, router or endpoint. Zigbee mesh network forms automatically. PC controls everything using AT commands - It is possible to write C under windows on a PC that can communicate with & control Zigbee boards, any language that can control COM (serial) ports will also be capable, Visual Basic, Python, Matlab, etc.

Figure 1 Serial Net

Two models of SerialNet usage are possible, see Figure 1. Both require Zigbit modules programmed with fixed SerialNet Firmware, and then configured (once only) via their serial host interface. Host-to-Host uses an additional microcontroller and therefore two host interfaces each using SerialNet commands to access the Zigbee network. Host-to-Zigbit uses a standalone module which must previously have been configured via its own host interface and a PC etc .

Zigbit IO limitations Nine Zigbit pins (GPIO0-8) may be configured as GPIO (separately inputs or outputs) Four different pins may be configured as analog inputs: BAT (normally used to measure battery) and ADC_INPUT1-3. The analog pins can be used as digital inputs if suitable voltage levels are provided. In fact if high input data rate is required a 3 bit D->A converter could be implemented with 4 resistors and used to input 3 digital values in parallel on one pin. Note that the 200us conversion time is much less than the time needed to transmit data back using SerialNet. Speed Data rate is limited by the host interface baud rate of 38.4kbit. In the Host-to-Zigbit model, changing the value of a single Zigbit output, or interrogating a single Zigbit input, takes roughly 5 bytes, or 1.2ms. Selecting a particular

remote node takes another 5 bytes so the data rate to GPIO pins is < 800 bit/s if all to the same node, or <400 bit/s if just one bit is sent or received from each node. A/D channels are input at roughly the same speed. This means that local processing will be much faster than controller-driven SerialNet , but this requires application code to be written under BitCloud running on the Zigbit modules, or host-to-host mode (see below). Host-to-Host Mode If remote node Zigbit modules have UART connected to a host microcontroller additional functionality is possible. The remote host microcontroller can use SerialNet commands to control its Zigbit module I/O, or alternatively can use its own I/O, with local processing, so that Zigbit I/O is not needed. The host controller PC and the remote microcontroller can exchange data by sending packets of data (D or DU commands) to each other. Data is received asynchronously and presented to the other host computer as a response sequence followed by the transmitted data which can be up to ~80 characters long. The code on the remote microcontroller (uC) needs only to set up a UART (if possible choose a uP with a built-in hardware UART) and receive and transmit SerialNet text commands, performing any necessary local processing - this is straightforward. Data for the uC inputs & outputs can be sent to or from the PC in a suitably compressed form - up to 30 times faster than that possible using Zigbit I/O. In a network with many nodes even Zigbit I/O, although slow, can be locally processed before transmission to/from the controller making network throughput much higher.

Method 2

Add a local microprocessor which interfaces with Zigbit module via USART. (For this c serial net usage) This method is much more flexible since I/O is no longer limited to that on Zigbit module and (more importantly) local processing is possible which allows much more efficient use of the Zigee channel. SerialNet makes Zigbee use easy.

Method 3

It is possible (but more complex) to write applications under BitCloud which run on Zigbit modules and perform local processing. This is much more work than method 2 but results in smaller hardware footprint. Not recommended for projects except for good programmers even then the fastest route to functional system will be method 2.

Method 4

A few projects will require much greater bandwidth than is available from Zigbee/SerialNet. The solution is to use the underlying 802.15.4 stack. This protocol is actually less complex (and therefore easier) than Zigbee. It allows star and tree topology but not mesh. SerialNet does not work. See Atmel web pages for available software. Support may be limited.

THROUGHPUT : average rate of successful message delivery over a communication channel Zigbee Network Information 1. Meshnetics Zigbit modules can implement the full Zigbee standard which allows dynamic mesh networks as well as tree & star topologies. 2. Each module is controller, router or endpoint 3. All roles can send/receive data. Only one controller is allowed, which initiates the network (multiple networks are possible using diferent channels). Any number of routers & endpoints can be used. 4. Routers must be powered up continuously and can be part of mesh topology forwarding packets from other nodes. Endpoints can be very low power, spending most of their time asleed, but cannot route packets. 5. Data is sent in packets of up to approx 80 bytes (longer packets are slower but more efficient). Data can be sent from any node to any other node though usually data is sent to/from the controller. On reception an automatic acknowledgement (ACK) can be sent back to the sender.

6. If ACK is enabled and sender waits for ACK before sending the next packet the maximum throughput with one router (two hops) is 50kbit/s. This goes down to 25kbit/s with 5 or more hops. These figures assume maximum length packets. 7. Beacon networks allow better performance in some circumstances, and routers can sleep as well as end-nodes. however these are only supported using the underlying 802.15.4 protocol. Meshnetics Zigbee modules support this as well, but you lose mesh capability (star is still possible). Use of this is not documented here, as although 802.15.4 is simpler than Zigbee it is less well packaged for easy use.

Difference between xbee and zigbee


ZigBee The first is relying on a very reliable, low-range wireless technology, the IEEE 802.15.4 Specification. This specification is a very modern, robust radio technology built on over 40 years of experience by IEEE. It uses what s called Offset-Quadrature Phase-Shift Keying (O-QPSK) and Direct Sequence Spread Spectrum (DSSS), a combination of technologies that provides excellent performance in low signal-tonoise ratio environments. ZigBee uses what s called Carrier Sense Multiple Access Collision Avoidance (CSMACA) to increase reliability. Before transmitting, ZigBee listens to the channel. When the channel is clear, ZigBee begins to transmit. This prevents radios from talking over one another, causing corrupted data. CSMA-CA is similar to what people do in conversations.(Or at least should!) They wait for the other speaker to finish, and then talk. ZigBee uses a 16-bit CRC on each packet, called a Frame Checksum (FCS). This ensures that the data bits are correct. Each packet is retried up to three times (for a total of four transmissions). If the packet cannot get through after the fourth transmission, ZigBee informs the sending node so something can be done about it. Another way that ZigBee achieves reliability is through mesh networking. Mesh networking essentially provides three enhanced capabilities to a wireless network: extended range through multi-hop, ad-hoc formation of the network, and most importantly automatic route discovery and self healing. XBee XBee Product Registered Brand name of ZigBee Standard Module by Maxstream now it changed to Digi

It uses Carrier Sense Multiple Access with Collison Avoidance for Channel Access. The security method used is AES-128.

Has message acknowledgement and a host of other features. Zigbee Applications Zigbee technology is based on IEEE 802.15.4 industry standard. It incorporates the standard, adding the logical network, security and software to it. It supports up to 3 network topologies namely STAR, MESH and CLUSTER tree. Developers need only have to focus on application while the MCU/Microprocessor/RF Transceiver makers and Zigbee Alliance take care of the RF Transmitter, RF Receiver, RF Channel and its protocol. There are 3 types of traffics that can be used. a) Periodic data An example of this traffic is a wireless sensor to read the water meter. The sensor is programmed to wake up at certaininterval to transmit the information needed and goes back to sleep after this is done. b) Intermittent data An example of this traffic is a wireless light switch to ON or OFF a light manually. It is triggered only by external inputand hence wakes up to transmit the message to the network. When done, it is disconnected to the network and hence saveenergy. c) Repetitive data An example of this traffic is the security system monitoring. The devices are time multiplex to return its status to the network. This type uses more energy. There are numerous applications that can be implemented using Zigbee. Amongst others are in the industry and home applications. In the industry, the applications include utility and metering where gas/water/electricity meter readings are automated andsend back to utility headquarter for further action. This saves the time it takes for their personnel to come to the premisesto take its reading. In the area of warehousing/inventory management , the wireless technology will enable accurate andhassle free management of goods. Security and access control, building management system and lighting control are amongthe applications that can be implemented with ease. In the home, a total home automation system to control lightings, blinds, air conditioning, security system, remote control and appliances can be implemented.
A ZigBee Router is not a standard wireless network distributor. Getting into ZigBee requires more indepth knowledge about new technology. Likewise, ZigBee is not a company but a group of companies that has created a system enabling wireless networks that work over radio frequencies, usually to send

signals between small, single-use appliances. ZigBee is mainly used in industrial technology, but consumer-oriented products are coming onto the market for those with a lot of savvy. The Zigbee Coordinator is the kingpin of the Zigbee system. It "owns" the network and distributes signals to all of its network components.

How Does ZigBee Work?


The ZigBee Alliance is a group of companies that produce wireless communication devices that are reliable, inexpensive, and have very low power requirements. ZigBee standards were created in the late 1990s, when it became evident that Bluetooth was not going to be appropriate for certain applications. It was intended as a lower-cost, lower power, version of a personal wireless network. Currently, ZigBee devices serve very different needs than Bluetooth devices, and thus do not interfere with the Bluetooth market share. These devices have extremely low power consumption, which extends their battery life considerably. ZigBee devices have many applications. They are ideal for home automation, and are used for smart-home security systems, automated appliances, wireless smoke and carbon monoxide detectors and environmental controls. They can also be used to control the opening and closing of drapes, as well as providing lighting control. Medical monitoring of residents is also possible, using devices with ZigBee wireless enabled. ZigBee devices offer transmission distances of up to 100 meters, depending on how much power is available and whether there is anything physically blocking the signal. ZigBee devices do not interfere with WiFi devices, but operate under the 802.15.4 Institute of Electrical and Electronics Engineers (IEEE) Standard. 802.15.4 is titled by the IEEE as the "Standard for Information technology-Telecommunications and information exchange between systems- Local and metropolitan area networks- Specific requirements-Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low Rate Wireless Personal Area Network (LR-WPANS)" ZigBee, as a low-rate wireless personal area network protocol, is governed by this standard. It operates on several different bands, including 2.4GHz, 915Mhz, and 868Mhz, sending wireless signals to communicate between nodes.

ZigBee is a communication standard for home automation. It works with low frequency radio waves as a method of controlling home appliances by remote control. The standard is a proprietary protocol available only to subscribing members of the ZigBee Alliance.

1. Lower Layer Protocols


The Institute of Electrical and Electronics Engineers specifies standards for networking, including the Ethernet and Wi-Fi standards. Its standard IEEE-802.15.4 is the basis of one of the layers in the ZigBee protocol stack. The protocol defines the physical requirements for a low-rate wireless personal area network and the method for transmitting data over it. The network access method used is Carrier Sense Multiple Access/Collision Avoidance. This requires a device to listen for free space. If the channel isn't available, the transmitter waits for a random period and then tests again.

ZigBee Layers
ZigBee is a wireless mesh network. One node can route through several neighboring devices within range. This creates redundancy, which means a duplication of paths. Rather than having one clear path between transmitter and receiver, the mesh network can bounce off any ZigBee enabled device to route around any blocking object or radio wave dead spots. The more ZigBee enabled appliances a home has, the better chance there is of a signal arriving at its intended destination. The routing element of ZigBee is the lowest layer of the ZigBee specific protocols, sitting on top of the CSMA/CA Logical Link Layer.

Routing
ZigBee uses the Ad-hoc On-Demand Distance Vector routing algorithm. ZigBee sensors may be attached to movable objects, like lamps. This means that there's no guarantee that a node in the network will be in the same place whenever a transmitter seeks a route. For this reason, there's no point in maintaining a database of routes. The routing method requires a transmitter to broadcast a need for a route to a destination. This is received by all nodes within range and passed on by them to all nodes within range of them. This process ripples through until the required node is contacted. Messages then chain back to the originator of the request. The transmitter chooses the route with the least number of hops.

ZigBee Applications
The top layer of the ZigBee protocol stack is the application layer. This contains a variety of messaging formats for different situations. These fall into five categories: home automation, health care, building management, retail services and energy management. The choice of application depends on the environment and the category of device implementing the ZigBee protocols.

Here are a few examples that demostrate some common functionality: Turn on an I/O port on a remote Series 2 (ZNet/ZB Pro) XBee:
XBee xbee = new XBee(); xbee.open("COM5", 9600); // this is the Serial High (SH) + Serial Low (SL) of the remote XBee XBeeAddress64 addr64 = new XBeeAddress64(0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0, 1); // Turn on DIO0 (Pin 20) RemoteAtRequest request = new RemoteAtRequest(addr64, "D0", new int[{XBeePin.Capability.DIGITAL_OUTPUT_HIGH.getValue()}); xbee.sendAsynchronous(request); RemoteAtResponse response = (RemoteAtResponse) xbee.getResponse(); if (response.isOk()) { System.out.println("Successfully turned on DIO0"); } else { System.out.println("Attempt to turn on DIO0 failed. response.getStatus()); } // shutdown the serial port and associated threads xbee.close();

Status: " +

Receive I/O samples from a remote Series 1 (802.15.4) XBee:


XBee xbee = new XBee(); xbee.open("COM15", 9600); while (true) { RxResponseIoSample ioSample = (RxResponseIoSample) xbee.getResponse(); System.out.println("We received a sample from " + ioSample.getSourceAddress()); if (ioSample.containsAnalog()) { System.out.println("10-bit temp reading (pin 19) is " + ioSample.getSamples()[0].getAnalog1(); } }

Vous aimerez peut-être aussi