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.
- Skill level:
Other People Are Reading
Things you need
- 2 Xbee modules
- 2 Xbee adaptor boards
- FTDI USB adaptor board or cable
Get at least two Xbee devices and adaptor 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 adaptor board. It includes all the external circuitry needed to run the device and makes the pins you need easily accessible. A variety of adaptor boards are available (see the links in the resources section).
Purchase a USB adaptor 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 adaptors use an FTDI chip, which is a surface-mount IC. Surface mount devices are difficult to solder by hand, so making your own USB adaptor isn't practical. Get an adaptor 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 adaptor board, and connect the adaptor board to a microcontroller. Connect the supply voltage pin of the adaptor board to the microcontroller's supply voltage, and connect the ground as well. Connect the adaptor board's RX pin to the microcontroller's TX pin, and connect the adaptor 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 adaptor board, and connect the adaptor board to an FTDI USB adaptor. Alternatively, there are FTDI boards available that are made to take an Xbee directly, without an adaptor board in between. The USB will provide power to the Xbee.
Plug a USB cable into your adaptor 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.
Tips and warnings
- 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.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for