You are previewing Making Things Talk, 2nd Edition.
O'Reilly logo
Making Things Talk, 2nd Edition

Book Description

Building electronic projects that interact with the physical world is good fun. But when the devices you've built start to talk to each other, things really get interesting. The workbenches of hobbyists, hackers, and makers have become overrun with microcontrollers -- computers-on-a-chip that power homebrewed video games, robots, toys, and more. In this book, author Tom Igoe shows how to make these gadgets communicate. You'll get instructions for more than two-dozen simple projects that you can customize with your own designs.

Table of Contents

  1. Special Upgrade Offer
  2. Preface
    1. Who This Book Is For
    2. What You Need to Know
    3. Contents of This Book
    4. On Buying Parts
    5. Using Code Examples
    6. Using Circuit Examples
    7. Acknowledgments for the First Edition
    8. Note on the Second Edition
      1. Software Reference
      2. Hardware Reference
      3. Acknowledgments for the Second Edition
  3. 1. The Tools
    1. It Starts with the Stuff You Touch
    2. It’s About Pulses
    3. Computers of All Shapes and Sizes
    4. Good Habits
      1. Listen More Than You Speak
      2. Never Assume
      3. Agree on How You Say Things
      4. Ask Politely for Clarification
    5. Tools
      1. Physical Tools
      2. Software Tools
        1. Processing
        2. Remote-Access Applications
    6. Using the Command Line
      1. Controlling Access to Files
      2. Creating, Viewing, and Deleting Files
        1. PHP
          1. Variables in PHP
        2. Serial Communication Tools
          1. Windows serial communication
          2. Mac OS X serial communication
          3. Linux serial communication
      3. Hardware
        1. Arduino, Wiring, and Derivatives
          1. Getting Started
          2. Setup on Mac OS X
          3. Setup on Windows 7
          4. Setup on Linux
          5. Changes to version 1.0
          6. Serial communication
      4. Connecting Components to the Module
        1. Basic Circuits
          1. Digital input
          2. Analog input
          3. Specialty circuits and modules
          4. Update to the Second Printing
    7. Using an Oscilloscope
    8. It Ends with the Stuff You Touch
  4. 2. The Simplest Network
    1. Supplies for Chapter 2
    2. Layers of Agreement
    3. Making the Connection: The Lower Layers
    4. Saying Something: The Application Layer
      1. Project 1: Type Brighter
      2. The Protocol
    5. Complex Conversations
      1. Project 2: Monski Pong
    6. Flow Control
      1. Project 3: Wireless Monski Pong
        1. Bluetooth: A Multilayer Network Protocol
        2. Pairing Your Computer with the Bluetooth Module
        3. Adjusting the Monski Pong Program
    7. Finishing Touches: Tidy It Up, Box It Up
      1. Project 4: Negotiating in Bluetooth
        1. Controlling the Bluetooth Module
    8. Conclusion
  5. 3. A More Complex Network
    1. Supplies for Chapter 3
    2. Network Maps and Addresses
      1. Network Maps: How Things Are Connected
      2. Hardware Addresses and Network Addresses
        1. Street, City, State, Country: How IP Addresses Are Structured
        2. Numbers into Names
      3. Packet Switching: How Messages Travel the Net
      4. Clients, Servers, and Message Protocols
      5. How Web Browsing Works
      6. HTTP GET and POST
      7. How Email Works
      8. Project 5: Networked Cat
      9. Putting Sensors in the Cat Mat
      10. Sending Mail from the Cat
      11. Making a Web Page for the Cat Cam
      12. Uploading Files to a Server Using PHP
      13. Capturing an Image and Uploading It Using Processing
      14. Putting It All Together
      15. One Final Test
    3. Conclusion
  6. 4. Look, Ma, No Computer! Microcontrollers on the Internet
    1. Supplies for Chapter 4
    2. Introducing Network Modules
      1. Project 6: Hello Internet!
        1. Making the Connections
        2. How the Ethernet Library Works
    3. An Embedded Network Client Application
      1. Project 7: Networked Air-Quality Meter
        1. Control the Meter Using the Microcontroller
        2. Write a PHP Script to Read the Web Page
        3. Read the PHP Script Using the Microcontroller
        4. TextFinder Library
    4. The Finished Project
    5. Programming and Troubleshooting Tools for Embedded Modules
      1. The Three Most Common Mistakes
        1. Check Power and Ground
        2. Check the Connections
        3. Check the Configuration
      2. Diagnostic Tools and Methods
        1. Physical Debugging Methods
        2. Serial Debugging Methods
        3. Write a Test Client Program
        4. Write a Test Server Program
    6. Conclusion
  7. 5. Communicating in (Near) Real Time
    1. Supplies for Chapter 5
    2. Interactive Systems and Feedback Loops
    3. Transmission Control Protocol: Sockets & Sessions
      1. Project 8: Networked Pong
      2. A Test Chat Server
    4. The Clients
      1.  
        1. Client #1: A Joystick Client
        2. Client #2: A Balance Board Client
        3. The Server
        4. Anatomy of a Player Object
        5. The Main Pong Server Program
    5. Conclusion
  8. 6. Wireless Communication
    1. Supplies for Chapter 6
    2. Why Isn’t Everything Wireless?
    3. Two Flavors of Wireless: Infrared and Radio
      1. Transmitters, Receivers, and Transceivers
      2. How Infrared Works
      3. Project 9: Infrared Control of a Digital Camera
    4. How Radio Works
      1.  
        1. Radio Transmission: Digital and Analog
        2. Radio Interference
        3. Multiplexing and Protocols
        4. Radio Transmitters, Receivers, and Transceivers
      2. Project 10: Duplex Radio Transmission
      3. Step 1: Configuring the XBee Modules Serially
      4. Step 2: Programming the Microcontroller to Use the XBee Module
      5. Step 3: Two-Way Wireless Communication Between Microcontrollers
      6. Project 11: Bluetooth Transceivers
      7. Step 1: The Circuits
      8. Step 2: Getting to Know the Commands
      9. Step 3: Connecting Two Bluetooth Radios
      10. Step 4: Connecting Two Microcontrollers via Bluetooth
    5. Buying Radios
    6. What About WiFi?
      1. Project 12: Hello WiFi!
        1. Making the Connections
      2. WiFi Diagnostics
    7. Conclusion
  9. 7. Sessionless Networks
    1. Supplies for Chapter 7
    2. Sessions vs. Messages
      1. Sessions Versus Messages
    3. Who’s Out There? Broadcast Messages
      1. Querying for Other Devices Using UDP
      2. Querying for XBee Radios Using 802.15.4 Broadcast Messages
      3. Project 13: Reporting Toxic Chemicals in the Shop
        1. Radio Settings
        2. The Circuits
          1. The sensor circuit
          2. The monkey circuit
          3. The Arduino circuit
        3. Reading the XBee Protocol
      4. What Happens in the Subnet Stays in the Subnet
    4. Directed Messages
      1. Sending Directed UDP Datagrams
      2. Project 14: Relaying Solar Cell Data Wirelessly
        1. Radio Settings
        2. The Circuits
        3. Graphing the Results
    5. Conclusion
  10. 8. How to Locate (Almost) Anything
    1. Supplies for Chapter 8
    2. Network Location and Physical Location
      1. Step 1: Ask a Person
      2. Step 2: Know the Environment
      3. Step 3: Acquire and Refine
    3. Determining Distance
      1. Passive Distance Ranging
      2. Project 15: Infrared Distance Ranger Example
      3. Project 16: Ultrasonic Distance Ranger Example
      4. Active Distance Ranging
      5. Project 17: Reading Received Signal Strength Using XBee Radios
      6. Project 18: Reading Received Signal Strength Using Bluetooth Radios
      7. The Multipath Effect
    4. Determining Position Through Trilateration
      1. Project 19: Reading the GPS Serial Protocol
    5. Determining Orientation
      1. Project 20: Determining Heading Using a Digital Compass
      2. Project 21: Determining Attitude Using an Accelerometer
      3. Determining Pitch and Roll from an Accelerometer
    6. Conclusion
  11. 9. Identification
    1. Supplies for Chapter 9
    2. Physical Identification
      1. Video Identification
        1. Color Recognition
      2. Project 22: Color Recognition Using a Webcam
        1. Lighting for Color Tracking
        2. Shape and Pattern Recognition
        3. Face Detection
      3. Project 23: Face Detection Using a Webcam
        1. Barcode Recognition
      4. Project 24: 2D Barcode Recognition Using a Webcam
      5. Radio Frequency Identification (RFID)
      6. Project 25: Reading RFID Tags in Processing
      7. Project 26: RFID Meets Home Automation
      8. The Circuit
      9. Construction
      10. Project 27: Tweets from RFID
      11. The Circuit
      12. SonMicro Communications Protocol
      13. Writing to Mifare Tags
      14. Reading from Mifare Tags
      15. Circuit Additions
      16. Saving Program Memory
      17. Troubleshooting
      18. Construction
    3. Network Identification
      1. HTTP Environment Variables
      2. Project 28: IP Geocoding
      3. Mail Environment Variables
    4. Conclusion
  12. 10. Mobile Phone Networks and the Physical World
    1. Supplies for Chapter 10
    2. One Big Network
      1. A Computer in Your Pocket
      2. Start with What Happens
        1. Browser Interfaces
        2. Native Application Interfaces
        3. SMS and Email Interfaces
        4. Voice Interfaces
        5. Phone As Gateway
      3. Project 29: CatCam Redux
      4. The Circuit
      5. The Code
      6. Writing to an SD Card
      7. Good SD Card Practice
      8. Making Your Server Public
      9. Dynamic DNS
      10. Network Cameras
      11. Project 30: Phoning the Thermostat
      12. What’s the Standard?
      13. A Brief Introduction to XML
        1. TwiML
      14. Getting the Content Length Right
      15. HTML5 and Other Mobile Web Approaches
      16. PhoneGap
    3. Text-Messaging Interfaces
    4. Native Applications for Mobile Phones
      1. Processing for Android
      2. Setting Up Processing for Android
        1. Where Does the App Run?
        2. Differences to Watch Out For
      3. Project 31: Personal Mobile Datalogger
      4. The Circuit
      5. The Construction
        1. Bluetooth Serial Library
      6. What About USB?
    5. Conclusion
  13. 11. Protocols Revisited
    1. Supplies for Chapter 11
    2. Make the Connections
      1. Know Your Options at the Physical Level
      2. Picking a Serial Protocol
      3. Plan the Physical System and Information Flow Early
    3. Text or Binary?
      1. Isn’t All Data Binary?
      2. Interpreting a Binary Protocol
        1. Bit Reading and Writing
        2. Bit Shifting
        3. Bit Masking
        4. Hex: What Is It Good For?
    4. MIDI
      1. Project 32: Fun with MIDI
      2. DMX512
      3. The Structure and Syntax of Text-Based Protocols
        1. Simple Data Formats
        2. Structured Data Formats
      4. Markup vs. Programming Languages
    5. Representational State Transfer
      1. A Traditional Web Service
      2. A Web-Based Device
      3. Project 33: Fun with REST
    6. Conclusion
  14. A. Where to Get Stuff
    1. Supplies
      1.  
        1. Infrastructure
        2. Microcontrollers, Shields, and Prototyping Boards
        3. Communications Modules
        4. Breakout Boards and Connectors
        5. Common Components
        6. Specialty Components
        7. Sensors
        8. Miscellaneous
    2. Hardware
      1.  
        1. KEY
        2. Abacom Technologies
        3. Aboyd Company
        4. Acroname Robotics
        5. Adafruit Industries
        6. Arduino Store
        7. Atmel
        8. CoreRFID
        9. D-Link
        10. Devantech/Robot Electronics
        11. Digi
        12. Digi-Key Electronics
        13. ELFA
        14. Farnell
        15. Figaro USA, Inc.
        16. Future Technology Devices International, Ltd. +(FTDI)
        17. Glolab
        18. Gridconnect
        19. Images SI, Inc.
        20. Interlink Electronics
        21. IOGear
        22. Jameco Electronics
        23. Keyspan
        24. Lantronix
        25. Libelium
        26. Linx Technologies
        27. Low Power Radio Solutions
        28. Maker SHED
        29. Making Things
        30. Maxim Integrated Products
        31. Microchip
        32. Mouser
        33. NetMedia
        34. Newark In One Electronics
        35. New Micros
        36. Parallax
        37. Phidgets
        38. Pololu
        39. RadioShack
        40. Reynolds Electronics
        41. Roving Networks
        42. RS Online
        43. Samtec
        44. Seeed Studio
        45. SkyeTek
        46. Smarthome
        47. Spark Fun Electronics
        48. Symmetry Electronics
        49. TI-RFID
        50. Trossen Robotics
        51. Uncommon Projects
    3. Software
      1.  
        1. Arduino
        2. Asterisk
        3. AVRlib
        4. avr-gcc
        5. CCS C
        6. CoolTerm
        7. Dave’s Telnet
        8. Eclipse
        9. Evocam
        10. Exemplar
        11. Fwink
        12. Girder
        13. GitHub
        14. Java
        15. Macam
        16. Max/MSP
        17. PEAR
        18. PHP
        19. PicBasic Pro
        20. Processing
        21. Puredata (PD)
        22. PuTTY SSH
        23. QR Code Library
        24. Dan Shiffman’s Processing Libraries
        25. Sketchtools NADA
        26. TinkerProxy
        27. Twilio
        28. UDP Library for Processing
        29. Wiring
  15. Index
  16. About the Author
  17. Special Upgrade Offer
  18. Copyright