Building Wireless Sensor Networks

Book description

Get ready to create distributed sensor systems and intelligent interactive devices using the ZigBee wireless networking protocol and Series 2 XBee radios. By the time you're halfway through this fast-paced, hands-on guide, you'll have built a series of useful projects, including a complete ZigBee wireless network that delivers remotely sensed data.

Radio networking is creating revolutions in volcano monitoring, performance art, clean energy, and consumer electronics. As you follow the examples in each chapter, you'll learn how to tackle inspiring projects of your own. This practical guide is ideal for inventors, hackers, crafters, students, hobbyists, and scientists.

  • Investigate an assortment of practical and intriguing project ideas
  • Prep your ZigBee toolbox with an extensive shopping list of parts and programs
  • Create a simple, working ZigBee network with XBee radios in less than two hours -- for under $100
  • Use the Arduino open source electronics prototyping platform to build a series of increasingly complex projects
  • Get familiar with XBee's API mode for creating sensor networks
  • Build fully scalable sensing and actuation systems with inexpensive components
  • Learn about power management, source routing, and other XBee technical nuances
  • Make gateways that connect with neighboring networks, including the Internet

Publisher resources

View/Submit Errata

Table of contents

  1. A Note Regarding Supplemental Files
  2. Preface
    1. How This Book Is Organized
    2. About the Title
    3. About the Examples
    4. Conventions Used in This Book
    5. Using Code Examples
    6. Safari® Books Online
    7. How to Contact Us
    8. Acknowledgments
  3. 1. Getting Ready
    1. Buying an XBee Radio
      1. Hardware
      2. Antennas
      3. Vendors
    2. Buying an Adapter
      1. Digi Evaluation Board
      2. USB Adapters
      3. Breakout Boards
      4. Arduino Board Adapter Hack
      5. What Are All Those Pins?
    3. Choosing a Terminal Program
      1. Firmware Update Software
        1. X-CTU
      2. Terminal Software for Configuring Settings
        1. CoolTerm
        2. HyperTerminal
        3. Tera Term
        4. ZTerm
        5. screen
        6. Others
    4. Summary
  4. 2. Up and Running
    1. Radio Basics
      1. Electromagnetic Spectrum
      2. Inverse Square Law
    2. Introduction to ZigBee
      1. Network Topology
      2. Addressing Basics
      3. PAN Addresses
      4. Channels
      5. All Together Now
    3. XBee Firmware Updates
      1. Reading Current Firmware and Configuration
    4. Configuring XBee
      1. Settings
      2. Connecting from Windows
      3. Connecting from Macintosh
      4. Command Mode and Transparent Mode
      5. AT Commands (Are Your Friend)
      6. Using AT Commands
    5. Basic ZigBee Chat
      1. Parts
      2. Addresses
      3. Coordinator
      4. Router
      5. Two Computers
      6. One Computer
      7. Chat
      8. Troubleshooting
    6. Success!
  5. 3. Build a Better Doorbell
    1. ZigBee and Arduino
      1. About Arduino
      2. Arduino Basics
        1. Buying an Arduino
        2. Don’t forget the cable
        3. Downloading the software
        4. Using the Arduino IDE
        5. Selecting the board and port
        6. Code structure
        7. Buying electronics supplies
      3. Connecting to Arduino
    2. Doorbell Projects
      1. Parts
      2. Prepare Your Radios
      3. Connect Power from Arduino to Breadboard
      4. XBee Breakout Board
      5. XBee Connections
      6. Doorbell Introduction
      7. Switch Input...
      8. ...and Buzzer Output
      9. Configure Your XBees
      10. Program the Arduino Doorbell
        1. Troubleshooting
      11. Feedback Doorbell
      12. Feedback Light
      13. Program the Arduino Feedback Doorbell
      14. Extra: Nap Doorbells and More
  6. 4. Ins and Outs
    1. The Story of Data
      1. Direct, Indirect, Subtext
    2. I/O Concepts
      1. Why XBee Direct?
      2. XBee Direct Limitations
      3. XBee I/O Features
      4. AT Configuration I/O Commands
      5. Advanced I/O Commands
    3. Romantic Lighting Sensor
      1. Basic Romantic Lighting Sensor
        1. Parts
        2. Prepare your coordinator radio
        3. Prepare your router radio
      2. Prepare the Sensor Board
        1. Configure your router XBee
        2. Connect power from battery to breadboard
        3. Router XBee connection to battery
        4. Photoresistor input
      3. Prepare the Base Station
        1. Connect power from Arduino to breadboard
        2. Coordinator XBee connection to Arduino
        3. Light output
        4. Program the romantic lighting sensor base station
        5. Troubleshooting
      4. Romantic Lighting Sensor with Feedback
        1. Add light output to the sensor
        2. Configure your router XBee
        3. Program the romantic lighting sensor with feedback base station
      5. API Ahead
  7. 5. API and a Sensor Network
    1. What’s an API?
    2. Protocols
      1. Humans
      2. Computers
        1. Start bytes
        2. Length byte
        3. Contents ID
    3. XBee API Protocol
      1. Start Delimiter
      2. Length Bytes
      3. Frame Data Bytes
      4. Checksum
    4. API Frame Types
      1. AT Commands
        1. Frame type
        2. Frame ID
        3. AT command
        4. Parameter value
        5. Checksum
      2. AT Responses
        1. Frame type
        2. Frame ID
        3. AT command
        4. Command status
        5. Command data
      3. ZigBee Transmit Request
        1. 64-bit destination address
        2. 16-bit destination network address
          1. Broadcast radius
          2. Options
          3. RF data
      4. ZigBee Transmit Status
        1. Transmit retry count
        2. Delivery status
        3. Discovery status
      5. ZigBee Receive Packet
        1. 64-bit source address
        2. 16-bit source network address
        3. Receive options
        4. Received data
      6. I/O Data Sample Rx Indicator
        1. Number of samples
        2. Digital channel mask
        3. Analog channel mask
        4. Digital samples
        5. Analog samples
      7. Remote AT Command Request
        1. Remote command options
      8. Remote Command Response
      9. Using What You Need
      10. Libraries
    5. Simple Sensor Network
      1. Parts
      2. Prepare Your Coordinator Radio
      3. Prepare Your Router Radios
      4. Prepare the Sensor Boards
        1. Connect voltage regulator circuit and power jack to breadboard
        2. Router XBee connection to power
        3. Temperature input
        4. Second sensor board
      5. Prepare the Base Station
        1. Connect to computer
      6. Program the Base Station
        1. Simple Sensor Network display code in Processing
        2. Troubleshooting
    6. Yay!
  8. 6. Sleeping, Then Changing the World
    1. Sleep Mode
      1. End Devices
        1. Storing and forwarding
        2. Constraints
        3. Advantages
      2. Configuring Sleep
        1. Sleep Mode
        2. Sleep Period
        3. Time Before Sleep
        4. Advanced commands
      3. Easy Sleeping
    2. Simple Sensor with Sleep Project
      1. Parts
      2. Prepare Your End Device Radios
      3. Configure Your End Device XBees
        1. Add sensor nodes...
        2. ...or replace sensor nodes
    3. Direct Actuation
    4. Direct Actuation Example
      1. Parts
      2. Prepare Your Coordinator Radio
      3. Prepare Your Router Radios
      4. Prepare the Actuator Boards
      5. Configure Your Router XBees
        1. Connect voltage regulator circuit and power jack to breadboard
        2. Router XBee connection to power
        3. Transistor and relay output
        4. Second actuator board
        5. PowerSwitch Tail A/C relay
      6. Prepare the Base Station
        1. Connect to your computer
        2. Program the actuator network base station
      7. Simple Actuator Node Code in Processing
    5. Summary
  9. 7. Over the Borders
    1. Gateways
      1. XBee as Embedded Gateway
      2. Other Embedded Gateways
      3. Internet Gateways
      4. Internet Media
      5. Computers Versus Dedicated Devices
    2. ConnectPorts
      1. Selecting a ConnectPort
      2. Setting Up a ConnectPort
        1. Troubleshooting
      3. Configuring a ConnectPort
    3. Remote Management
      1. iDigi Connectivity Server
      2. iDigi Features
      3. Adding a ConnectPort
      4. Viewing Configurations
      5. Firmware Updates and Remote Reboot
      6. Viewing an XBee Network
    4. XBee Internet Gateway (XIG)
      1. Installing and Configuring XIG
      2. Testing XIG
      3. XIG Example
        1. XIG download example in PHP
    5. Twitter Reader
      1. Parts
      2. Prepare Your ConnectPort with XBee Internet Gateway
      3. Prepare Your Router Radio
      4. Configure Your Router Radio
      5. Prepare the Twitter Reader Board
        1. Connect power from Arduino to breadboard
        2. XBee connection to Arduino
        3. Liquid crystal display (LCD) output
      6. Program the Arduino
        1. Installing the NewSoftSerial library
        2. Twitter Reader code
        3. Troubleshooting
    6. Moving Forward
  10. 8. More to Love
    1. Advanced ZigBee
      1. ZigBee Stack Layers
      2. Application Support Layer
        1. Profiles
        2. Endpoints
        3. Clusters
        4. Next steps
      3. Routing
        1. Next steps
      4. Security
        1. Network and link keys
        2. Technical details
        3. Fast guide to turning on XBee network security
        4. Using optional APS encryption
      5. ZigBee Protocol References
    2. Serial Flow Control
      1. RTS and CTS
    3. Sharing Data
      1. Pachube
    4. Simple Sensor Network with Pachube
      1. API Key
      2. Build the Simple Sensor Network in Chapter 5
      3. Program the Base Station
      4. Simple Sensor Network Pachube Code in Processing
        1. Troubleshooting
    5. The Future of ZigBee
    6. Next Steps for You
      1. Making Stuff
      2. Sharing Your Work
  11. A. Resource Guide
    1. Arduino Resources
    2. Processing Resources
    3. Python Resources
    4. ZigBee Resources Online
      1. Standards Organizations
      2. Digi International Resources
      3. Additional Online Resource Lists
    5. Recommended Books
    6. Sidewalk Telescopes
    7. Troubleshooting
      1. Common XBee Mistakes
      2. XBee Arduino Mistakes
    8. Reference Tables
      1. Other ZigBee Modules
      2. ZigBee Packet Sniffers
      3. Digi XBee Radio Modules
      4. XBee Connectors and Shields
      5. Hex, Decimal, and Binary
      6. ASCII Codes
      7. XBee Command Reference
  12. Index
  13. About the Author
  14. Colophon
  15. Copyright

Product information

  • Title: Building Wireless Sensor Networks
  • Author(s): Robert Faludi
  • Release date: December 2010
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596807733