Building Wireless Sensor Networks Summary

Building Wireless Sensor Networks

with ZigBee, XBee, Arduino, and Processing
by Robert Faludi 2010 318 pages
3.83
190 ratings

Key Takeaways

1. ZigBee: The Wireless Protocol for Low-Power, Mesh Networking

"ZigBee is a standard communications protocol for low-power, wireless mesh networking."

ZigBee's unique features make it ideal for sensor networks and home automation:

  • Low power consumption
  • Self-healing mesh networking
  • Support for up to 65,000 nodes
  • 250 kbps data rate at 2.4 GHz

ZigBee is built on the IEEE 802.15.4 standard and adds routing and networking capabilities. It's designed for applications that require long battery life and secure networking, but don't need high bandwidth. Examples include:

  • Smart energy systems
  • Home automation
  • Industrial control
  • Healthcare monitoring

2. XBee Radios: Configurable Modules for ZigBee Communication

"XBee is a brand of radio that supports a variety of communication protocols, including ZigBee, 802.15.4, and WiFi, among others."

XBee modules offer flexibility and ease of use for ZigBee implementations:

  • Multiple form factors (through-hole, surface mount)
  • Various antenna options (chip, wire, U.FL connector, RPSMA connector)
  • Configurable as Coordinator, Router, or End Device

XBee radios can be configured using:

  • AT commands for simple setups
  • API mode for more complex operations
  • X-CTU software for firmware updates and configuration

These modules integrate easily with microcontrollers like Arduino, making them popular for prototyping and small-scale deployments.

3. Network Topologies: Pair, Star, Mesh, and Cluster Tree

"ZigBee networks can connect together in several different layouts or topologies to give the network its structure."

ZigBee supports multiple topologies to suit various application needs:

  • Pair: Simplest form, just two nodes
  • Star: Central coordinator with multiple end devices
  • Mesh: Routers relay messages, extending network range
  • Cluster Tree: Combination of star and mesh topologies

Each topology has its advantages:

  • Star is simple but limited in range
  • Mesh offers redundancy and self-healing
  • Cluster Tree balances complexity and coverage

The choice of topology depends on factors like physical layout, power requirements, and desired network resilience.

4. Addressing in ZigBee: 64-bit, 16-bit, and Node Identifiers

"Almost every person has an address where he can be reached, usually one that is unique to him. Many people have more than one. We have mailing addresses, email addresses, phone numbers, passport numbers, and the list goes on. Each kind of address or identifier serves a slightly different purpose. It's the same with radios."

ZigBee uses multiple addressing schemes for flexibility and efficiency:

  • 64-bit address: Unique, factory-assigned "serial number"
  • 16-bit address: Network-assigned for efficient routing
  • Node Identifier: Human-readable string for easy identification

Addressing types and their uses:

  1. 64-bit: Guaranteed unique across all ZigBee devices
  2. 16-bit: Dynamically assigned, unique within a network
  3. Node Identifier: Optional, user-assigned name

Understanding these addressing methods is crucial for configuring devices and troubleshooting network issues.

5. AT Commands: Configuring XBee Radios for Communication

"Every AT command starts with the letters "AT," which stands for "attention." The idea is to get the attention of the device, in this case our XBee radio."

AT commands provide a simple interface for configuring XBee radios:

  • Enter command mode with "+++"
  • Use commands like ATID (PAN ID), ATDH/ATDL (destination address)
  • Write settings to non-volatile memory with ATWR

Common AT commands:

  • ATID: Set/read PAN ID
  • ATMY: Read 16-bit network address
  • ATDH/ATDL: Set/read destination address
  • ATNI: Set/read Node Identifier

AT mode is suitable for simple configurations and direct human interaction with the radio.

6. API Mode: Advanced Control and Data Handling

"APIs let one computer application request services from another application in a standard manner."

API mode offers structured data exchange for more complex applications:

  • Allows simultaneous communication with multiple destinations
  • Provides delivery confirmation and remote configuration
  • Enables advanced features like firmware updates and network management

API frame structure:

  1. Start delimiter (0x7E)
  2. Length bytes
  3. Frame-specific data
  4. Checksum

API mode is essential for:

  • Receiving I/O samples from remote devices
  • Managing large networks
  • Integrating XBee radios with computer systems

7. Creating Sensor Networks: From Simple to Complex

"Building Wireless Sensor Networks is an essential guide for anyone interested in wireless communications for sensor networks, home networking, or device hacking."

Sensor networks can be built incrementally , starting with simple projects:

  • Basic paired communication (e.g., wireless doorbell)
  • Multi-node temperature sensing network
  • Home automation systems

Key components for sensor networks:

  • XBee radios for wireless communication
  • Sensors (temperature, light, motion, etc.)
  • Microcontrollers (e.g., Arduino) for local processing
  • Power sources (batteries, solar panels)

As networks grow, consider:

  • Scalability of addressing and routing
  • Power management for battery-operated nodes
  • Data aggregation and visualization techniques

8. Sleep Mode: Extending Battery Life in ZigBee Networks

"Going wireless often means cutting the electric cord. Projects that are mobile or remotely located frequently use batteries or another constrained power source that demands economizing on energy."

Sleep mode dramatically extends battery life in ZigBee networks:

  • Cyclic sleep: Radio wakes periodically to check for messages
  • Pin sleep: External signal controls sleep state

Sleep mode configuration:

  • ATSM command sets sleep mode
  • ATSP sets sleep period
  • ATST sets time before sleep

Considerations for sleep mode:

  • Parent devices must buffer messages for sleeping children
  • Trade-off between power savings and responsiveness
  • Some nodes (e.g., routers) typically cannot use sleep mode

9. Internet Connectivity: Gateways and the XBee Internet Gateway (XIG)

"The XBee Internet Gateway is a Python program that can be loaded onto any ConnectPort right out of the box. It's an interface that mirrors the interactions humans have in web browsers."

Gateways bridge ZigBee networks to the Internet , enabling:

  • Remote monitoring and control
  • Data aggregation and cloud storage
  • Integration with web services

XBee Internet Gateway (XIG) features:

  • Runs on ConnectPort devices
  • Translates between ZigBee and HTTP protocols
  • Allows XBee networks to interact with web services

Setting up an Internet-connected ZigBee network:

  1. Configure a ConnectPort with XIG
  2. Set up XBee radios to communicate with the gateway
  3. Use simple URL-like commands to interact with web services

10. Data Sharing and Visualization: Bringing Sensor Data to Life

"By putting your data someplace accessible, you'll be able to strut your stuff, share with colleagues, and possibly pipe your information into other projects all over the world."

Sharing sensor data enhances its value through:

  • Collaboration with other researchers or enthusiasts
  • Integration with data visualization tools
  • Contribution to larger data sets or citizen science projects

Popular platforms for sharing sensor data:

  • Pachube (now Xively): Cloud-based service for real-time data
  • ThingSpeak: Open-source platform for IoT applications
  • Custom web applications using frameworks like Processing

Visualization techniques:

  • Real-time graphs and charts
  • Geographic mapping of sensor locations
  • Interactive dashboards for data exploration

By sharing and visualizing data, sensor networks can provide insights and value beyond their immediate application, contributing to a broader understanding of our environment and the Internet of Things ecosystem.

Last updated:

Report Issue