Electronics notes/802.15 (including zigbee)

From Helpful
Jump to: navigation, search
This is for beginners and very much by a beginner. It's meant to try to cover hobbyist needs, and as a starting point to find out which may be the relevant details for you, not for definitive information.

Some basics and reference: Volts, amps, energy, power · Ground · batteries · resistors · changing voltage · transistors · fuses · diodes · varistors · capacitors · inductors · transformers · baluns · amplifier notes · frequency generation · skin effect


And some more applied stuff:

IO: IO and wired communication · localish communication · wireless (ISM RF, GSM, RFID, more) · 802.11 (WiFi) · 802.15 (including zigbee)


Sensors: General sensor notes, voltage and current sensing · Knobs and dials · Pressure sensing · Temperature sensing · humidity sensing · Light sensing · Movement sensing · Capacitive sensing · Touch screen notes

Actuators: General actuator notes, circuit protection · Motors and servos · Solenoids

Some stuff I've messed with: Avrusb500v2 · GPS · Hilo GPRS · Bluetooth serial · JY-MCU · DMX · ESC/POS notes

Audio notes: basic audio hacks · microphones · amps and speakers · device voltage and impedance, audio and otherwise ·

Less sorted: Common terms, useful basics, soldering · Microcontroller and computer platforms · Arduino and AVR notes · ESP series notes · Electronics notes/Phase Locked Loop notes · mounts, chip carriers, packages, connectors · signal reflection · pulse modulation · electricity and humans · Unsorted stuff


See also Category:Electronics.


802.15.4

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)


802.15 in general describes wireless personal area network (WPAN), including many things on a localish scale. See http://en.wikipedia.org/wiki/802.15

You're likely looking specifically for 802.15.4, "Low Rate WPAN"



Useful for sensor networks, usually more so than other options (such as Bluetooth), because of things like meshing, and the option to use little power.

The most basic protocol attempts to ensure proper delivery (checksum, ACKs, retransmission), which is a whole bunch of work you don't have to do yourself.


Range is ~100m in theory, some variants more, though in general you shouldn't count on more than two dozen meters - much like WiFi. Range is usually limited by antennae (often the thing you can change most), by ISM regulations on transmit power, and other factors.


Data rate is lowish - a few dozen kbps user-usable speed on 2.4Ghz (verify), ~9kbps on 900MHz (verify)


On names, protocols, (xbee) series, firmware, and other variations

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

Some of the basic terms:

  • 802.15.4 (protocol)
    • There are currently two revisions, IEEE 802.15.4-2003 and IEEE 802.15.4-2006
    • mostly specifies the physical communication layers (PHY, MAC), which allows basic point-to-point and broadcast communication. The module being sent to must be in sight (no relaying of messages). Anything more complex than that has to happen by additional protocols provided on top, such as ZigBee, MiWi, WirelessHART.
    • http://en.wikipedia.org/wiki/802.15.4
  • ZigBee (protocol)
    • A protocol specification defined by the ZigBee Alliance
    • There are currently four versions, ZigBee 1.0 (2004), ZigBee 2006, ZigBee 2007, and ZigBee 2007/Pro
    • a mesh network; nodes can relay messages. That is, end devices talk only to routers, routers can relay, and and a network must have one coordinator. All nodes could be set up as routers (though that takes more power)
    • Compared to basic 802.15.4, ZigBee adds that mesh routing, some extra encryption, node association (and can require authentication to do so)
    • http://en.wikipedia.org/wiki/Zigbee
  • XBee is a brand name from Digi International (formerly MaxStream), mainly referring to a line of products with a shared pinout (but not all of which are compatible on-air)


  • XBee Series (mostly seen: 1 and 2) basically refers to products with different chipsets
    • terminology specific to Digi. Mostly seen on 2.4GHz Xbees, and seem more rarely used on other modules.(verify))
    • Firmware is made for a specific chipset. As a result
      • Series 1 (freescale chipset) can run 802.15.4-compliant firmware and Digimesh, and is often sold with a name including 'Series 1' or '802.15.4'
      • Series 2 (ember chipset) can run ZNet 2.5 and ZB (ZigBee implementations) and maybe sold with names including ZNet 2.5, ZB, and S2B.
    • Series 2B seems to be a physical redesign of series 2 (its pro variants) to squeeze out a little more power. Otherwise equivalent to Series 2.
    • Series 2C - (verify)
    • Series 3 seems to refer to XSC (verify) (the reference is not seen much)
    • Series 4 seems to refer to to 900MHz devices. (verify) (the reference is not seen much)
    • Series 5 seems to refer to to 868MHz devices. (verify) (the reference is not seen much)
    • You cannot communicate between series 1 and 2 xbees (but apparently almost entirely because of because of protocol differences. (verify))
  • XBee Pro versus plain XBee
    • most of the difference lies in transmit power and range
    • Not to be confused with Zigbee Pro
  • ZigBee Pro
    • is about ZigBee 'stack profiles': Plain zigbee (ZigBee stack profile 1) is simpler and enough for most home and many commercial uses. ZigBee Pro (ZigBee stack profile 2) adds multi-casting, many-to-one routing and has some more security options. (verify)
    • Both non-pro and pro can do mesh networking, but Pro seems to be a little better at it larger-scale networks (verify)
    • It seems you can mostly mix Pro with non-Pro (unless you use Pro's high security mode) (verify)


This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

Some of the most confusing details come from the fact that chipset, Xbee series, usable firmware and resulting protocols are all entangled.

Also, even within the same protocol you can use firmware to make nodes take different roles

(note also that Digi XBees are not the only devices that speak 802.15.4 or ZigBee, though if this summary focuses on them)


On protocols:

Protocol-wise, a device can speak speak bare 802.15.4, ZigBee, or something else. For example, XBee also sees use of DigiMesh. These are distinct protocols, and most are incompatible on the air.


  • 'raw' 802.15.4 protocol
    • Talks to (all) neighbouring devices.
    • sleeps most of the time. Does time synchronization so that everything talks in bursts (which saves power, particularly when there is little to communicate)
    • The easier option for point to point (and broadcast, a.k.a. point to multi-point) communication, but it doesn't do all the things ZigBee can, particularly meshing
    • for Xbee: firmware that speaks this is made only for Series 1 (freescale), not for Series 2 (Ember) chipset.
  • Digimesh protocol
    • A meshing protocol, functionally much like ZigBee, but not compatible with ZigBee
    • Originally only available for 900MHz devices.
    • Now also usable by Series 1 XBee, but not with series 2 Xbees (you want ZigBee instead)
    • Allows sleeping routers, saving power.
    • (some extra notes about digimesh and versions of series 1: [1])
  • ZNet protocol - an implementation of Zigbee by Ember
    • Can be considered an interim implementation; you probably want ZB instead
    • XBee: usable by series 2, not by series 1. Series 2 (which use Ember chipsets) seems shipped with Znet 2.5 (perhaps more recently shipped with ZB?)
  • ZB protocol - an implementation of ZigBee, coded to the 2007/Pro version of ZigBee - a better feature set than ZNet
    • Xbee: Usable by series 2, not series 1.
    • (based on Ember ZNet 3?)
  • There was a beta version of a freescale ZigBee stack (i.e. ZigBee for Series 1) but it was discontinued. [2]

See also:


On firmware:

You can load various types of firmware into the modules. This defines both what protocol it speaks. In ZigBee meshing it also defines what role it takes (and note that a ZigBee network must have one coordinator) The rest of the devices can be routers, or endpoints (which can use less power).

For XBees, the series represent different chipsets:

  • Series 1 can run basic 802.15.4 or Digimesh
  • Series 2 can run Znet 2.5 or ZB (implementations of earlier and later spec of ZigBee)


What you can do is restricted by

  • the hardware chipset (when keeping to Digi's XBees, series 1 and series 2 refers to different chipsets)
  • the implementation details of the firmware you can load on specific devices/chipsets (e.g. digimesh was originally available only on 900Mhz modules, now also on series 1 Xbees (2.4GHz))

...which mean you can get meshing on Series 1 - but only by using DigiMesh, so which won't talk to ZigBee meshes.


From the perspective of XBee hardware:

  • XBee Series 1
    • comes with 802.15.4 compliant firmware. Can be configured to interact with different-brand 812.15.4
    • can use DigiMesh
    • cannot use ZigBee(verify)
  • XBee Series 2
    • comes with ZigBee-compliant firmware.
    • cannot use plain 802.15.4 firmware(verify)
    • cannot use DigiMesh(verify)


See also:



802.15.4 specific notes

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

PHY-level notes

  • 2.4GHz band, or 915MHz / 868MHz bands (see #ISM_bands_and_such).
    • 2.4GHz is faster and works worldwide, but has shorter range (50mW for up to 1.6 km. best case 7km?). Speed ~250kbps on air, a few dozen kbps of throughput you can use, 16 channels
    • 915MHz (US): slower, more range (best case 24km?). Only in pro variant?(verify), ~40kbps, 10 channels
    • 868MHz (Europe), slower, more range (best case 40km?(verify))though ISM regulation limit transmit power. ~20kbps, 1 channel.


MAC-level notes

  • 802.15.4 defines FFD (Full function device) and RFD (Reduced functionality device). FFD can talk to everything and can be coordinators, RFDs can only talk to coordinators, and are end devices (which, because of this, can be lower power and cheaper).
  • Coordinators remember network details, and handle routing. Needs more memory and RAM. (XBee firmwares choice: coordinator, or router/endpoint)
  • Association with PAN coordinator (basically to avoid overloading the coordinator)
  • Discover devices listening to beacons
  • Addressing can be 16-bit (local - within PAN associated nodes?(verify)), or their full 64-bit address
  • Encryption


ZigBee specific notes

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)
  • Node types:
    • ZigBee coordinator - FFD acting as a PAN coordinator in the network
    • ZigBee router - FFD that is not the PAN coordinator, but acts as a local coordinator (routing between devices, supporting associations)
    • ZigBee end device - RFD / FFD that is neither coordinator or router. Talks only to coordinator or router, not to other end devices (Can be lower power since the interesting routing is done elsewhere)
  • Routing:
    • Star
    • Cluster Tree - sort of like spanning-tree, subnet-style routing. Seems deprecated, not part of Pro
    • Mesh - (FFDs) can talk to everything in sight, algorithm figures out paths. Part of ZigBee and ZigBee Pro
      • Many to one routing, source routing


DigiMesh notes

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)


On (Not) Talking to other modules

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)


Protocol

A protocol will only understand itself.


Channel

You can only talk to the same channel.

  • The 2.4GHz band has 16 channels defined (within 2400-2480MHz. Each ~2MHz wide), numbered 0x0B through 0x1A (Default is 0x0C). A number are reserved, and it seems Xbee Pro uses fewer(verify). [3]
  • The 915 MHz band has 10 channels (0x01 through 0x0A)(verify)
  • The 868 MHz band has 1 channel (0x00) (verify)

In XCTU: Networking → CH

(There is also the concept of channel pages. This basically means the same frequency bands, with different sorts of modulation. Usually fixed in a product, and for the 2450 MHz band there is only one choice. It's likely you don't really need to worry or know about it)


PAN ID

XBees will ignore packets not from the same PAN ID. It is a quick and dirty way to avoid confusion between distinct networks/projects without having to keep track of members, or have an in-protocol .

XBees all default to 0x3332.

In XCTU: Networking → ID


Addressing

Roughly speaking

  • A device has a SL and SH, which are unique and cannot be changed. They are each a 32-bit int, so combine to be a 64-bit hardware identifier (think MAC)
  • You can
    • send only to a known node by unique 64-bit ID (set a DL,DH, which must a known node's SL,SH (respectively) in communication). Useful to locally focus traffic to (only) a specific known node.
    • send to a group (with a particular MY; must match a value set in SL)
      • DigiMesh does not use this (no MY)

DL and DH default to 0, which uses matching by DL=MY. MY us 0 by default, which means that everything listens to everything


In general, for transmitted packets:

  • If DH=0x00000000, DL=0x0000FFFF: Broadcast (received by everything)
  • If DH=0x00000000, DL<0x0000FFFF: Received for modules whose MY matches the DL
  • If DH>0x00000000 or DL>0x0000FFFF: Received for modules whose SH=DH and whose SL=DL

On range and power

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)


'Power use notes:

  • Power use is not directly related to transmit power - because of sleeping and such
  • Assume something like 40mA to 50mA for transmits and receives.
  • Pro and longer-range variants may use 200 or 300mA to transmit. Varies with hardware design.
  • Idle communication module will use a small amount of power, varying per design; ~10mA for some, down to something like ~10uA for others.
  • ZigBee sleeps less than bare 802.15.4; Meshing will mean more power use for routers (...than its endpoints)(verify)

See also:



On range:

'Up to' figures are misleading as they count on ideal setups, high gain antennae, clear line of sight (preferably good fresnel zone[4] clearance). They are achievable, but don't expect them in urban or indoor settings.

The factors you can most easily choose or influence:

  • obstructions (...as always) - line of sight and ground clearance will give you more range. Obstructions, reflections and no clearance will give you less.
  • band (~900MHz variants could do 20-30km with good antenna, the basic 2.4GHz ones in the 30m-1500m range), and possibly 100 mW (20 dBm) (verify)
  • transmit power. Vary per design, but the approximate Range / mW correlation for 2.4GHz XBees (Slight difference between Series 1 and Series 2):
    • 1mW (0dBm): ~30m indoor, ~90m outdoor
    • 2mW (3dBm): ~40m indoor, ~120m outdoor
    • 10mW (10dBm) (XBee Pro, International ISM limitation): 90m indoor, 1000m outdoor (verify)
    • 50mW (17dBm) (Series 2 XBee Pro, North American version): ~120m indoor, ~1500m outdoor
    • 63mW (18dBm) (Series 1 XBee Pro, North American version): ~120m indoor, ~1500m outdoor
    • Note that in Europe and other places, ISM compliance means you cannot transmit with more than 10mW (10 dBm)
    • Count on somewhat less than this when using a wire/chip antenna
  • antenna (simple variants have either a chip antenna or a wire antenna; wire often a little better)
    • Chip - perhaps -1.5dBi(verify) Don't suck as much as you may think, but still the simplest, least-range option
    • Wire - perhaps 0dBi to 2dBi(verify). Somewhat better range than chip, though indoor the difference is often less pronounced
    • Antenna connector, usually U.FL or RP-SMA on XBee Pro. Make sure the antenna you buy is for the frequency the module uses.


See also:


X-CTU notes

Serial ports

XCTU is a little finicky with COM ports, in that it doesn't refresh ports while running. Matters when plugging USB-to-serial devices, such as the arduino's.

Remember that XBee radios need a few seconds to start up.

Default baud rate is 9600. You can program an XBee to default to something else.




Unsorted

  • Bee refers to the 20-pin, 20mm pitch attachment
    • ...a socket used by XBee, but also by the GPS Bee, Bluetooth Bee, RFBee, and others (the common feature seems to be devices that do serial communication)
    • XBee Pinout: http://code.google.com/p/xbee-api/wiki/XBeePins
    • You can communicate using just just four pins (ground, 3.3V power, RX and TX), though also using and respecting RTS is a good idea that can avoid some headaches. The rest are optional, convenient for specific applications, seeing activity, specific features/designs, and such.


Basic pragmatic usage notes:

  • Usually have a serial interface (think AT commands), and can be used to pass through IO
  • Xbees are 3.3V devices - power and IO too (IO doesn't seem 5V tolerant). There are adapter boards that do regulation and level shifting. You could do this yourself (possibly cheaper), but they are are convenient.


Boards you can use to interface with XBees (and that are often sold by the DIY-style stores that sell XBees):

250mA regulator, level shifted IO. Seems to be the cheapest (and arguably better than the sparkfun ones). (Not made to plug directly into an Arduino shield-style, but not much work to hook up to one. Will hook directly to a FTDI cable)
regulator (used to be 150mA, now 500mA(verify)), drops RX line via diode, receiving serial should be able to deal with 3.3V TX from module. You can solder in headers to get to all Xbee pins.
  • Some specific arduino derivatives, such as the Seeeduino Stalker, have Xbee sockets (may be wired a little differently, so e.g. programming may be different/harder)
  • (could you use an AVRless arduino's FTDI at 3.3V?)

Regulator max current is relevant as Pros at full power use 200 to (worst case) around 340mA (...but less if you may only use 10mW, perhaps 170 mA?(verify)). If they do so in bursts you can get away with lower specced regulators (perhaps with a capacitor), but if they draw continuously then a 150mA regulator won't cut it.



See also:

TOREAD:


Somewhat applied:


Digi RF device offering