How to Communicate With Zigbee on Mac Apple

by Douglas Quaid

Using the Zigbee wireless communications protocol with your Mac is simple as long as you have the right hardware to connect to your computer. Zigbee makes it easy and inexpensive to send data point to point or between a whole network of wireless nodes. The simplest way to implement Zigbee is by using Xbee modules, small circuit boards that include all the circuitry you need to send and receive data. Xbee modules are made to plug directly into sockets on other circuit boards, making it possible to build up your Zigbee project without any soldering.

Get at least two Xbee devices and adapter boards. Zigbee is a radio communications protocol, not a specific device. Xbee is a range of small, easy to use devices that implement the Zigbee protocol. The Xbee is designed to pop directly into a socket on an adapter board. It includes all the external circuitry needed to run the device and makes the pins you need easily accessible. A variety of adapter boards are available (see the links in the resources section).

Purchase a USB adapter board meant for the Xbee or an FTDI cable. The Xbee communicates using a serial data protocol, so you need to run it into a chip that will adapt it into a USB to connect to your computer. Most serial to USB adapters use an FTDI chip, which is a surface-mount IC. Surface mount devices are difficult to solder by hand, so making your own USB adapter isn't practical. Get an adapter board with an FTDI chip and a USB socket or an FTDI cable (see the links in the resources section).

Follow the link in the resources section to download the FTDI drivers for Mac OS X, and install them. These drivers will allow your computer to communicate over USB with the FTDI chip to use your USB port as a serial connection.

Take the first Xbee module, plug it into the adapter board, and connect the adapter board to a microcontroller. Connect the supply voltage pin of the adapter board to the microcontroller's supply voltage, and connect the ground as well. Connect the adapter board's RX pin to the microcontroller's TX pin, and connect the adapter board's TX pin to the microcontroller's RX pin. TX is serial output, and RX is serial input. When you're finished, the microcontroller will be able to communicate wirelessly with your Mac.

Connect the second Xbee to an adapter board, and connect the adapter board to an FTDI USB adapter. Alternatively, there are FTDI boards available that are made to take an Xbee directly, without an adapter board in between. The USB will provide power to the Xbee.

Plug a USB cable into your adapter board and your computer.

Program your microcontroller to send and receive data over the serial line. The exact directions will depend on the programming language your microcontroller uses. Any data you send will be broadcast by the Xbee, and the Xbee will send any data it receives to the microcontroller over the serial line. By default, the Xbee uses a 9600 baud serial rate.

Open a "Finder" window, go to "Applications," then "Utilities," and open "Terminal." Enter "ls /dev/tty.*" (without the quotes) to see a list of your serial ports. If the FTDI drivers are installed properly and the device is connected to a USB port, it should appear on the list. Enter "screen [serial port name] 9600" to begin viewing the serial line. Data picked up by the Xbee connected to your computer will be displayed in the terminal window, and data you enter will be sent wirelessly to the microcontroller. Press the "Control" and "A" keys together, followed by "Control" and "\" to quit the screen application.

Tip

  • check Make your project more powerful by writing software that can send and receive serial data. You can use Xbee modules to send data back and forth between your computer and a robot or any other wireless device you can think up.

Items you will need

About the Author

Based in Los Angeles but born and bred in Brooklyn, N.Y., Douglas Quaid has been writing for various websites since 2010. He holds a Bachelor of Arts in film from Bard College.

More Articles

Photo Credits

  • photo_camera hi tech keyboard closeup image by Mograph from Fotolia.com