After several previous attempts to make a serial wireless system, I finally have something that works. Previously I had used modules from Futurelec and Sparkfun. There are links to these attempts here. The XBee wireless module is considerably more sophisticated then the previous modules.
• Serial data interface: 3.3V CMOS UART
• Frequency band: 2.4 GHz
• Interference immunity: DSSS (Direct Sequence Spread Spectrum) channels
• Serial data rate: 1200 – 250000 bps
• (6) 10-bit ADC inputs, (8) Digital I/O
• Indoor/Urban range: 100 ft (30 m) / 300 ft (90 m)
• Outdoor/RF line-of-sight range: 300 ft (90 m) / 1 mi (1.6 km)
• Transmit power output: 1 mW (0 dBm) / 60 mW (+18 dBm) -
The manual has details on using the device.
The XBEE uses 9600 8N1 by default. To use the XBEE with the picaxe it first must be programmed to use a slower speed. Fortunately there is a utility build into the picaxe programming envirnoment that will setup the XBEE for you. A programming board must be build. This consists of a a MAX3232 (Or since I didn’t have one a MAX232 with voltage divider between the outputs.) The RX and TX are wired appropriately. Here is a diagram from doityourself.com:
Each of the XBEE modules needs to be put into the programmer as shown on the left, given power, and have the RX and TX lines hooked up to the outputs of the MAX232 through a voltage divider using a 10K to the pin and a 20K to ground.
Once the modules are programmed, it is extremely simple to hook them up. A picture is provided on the left. There are a few cautionary notes however:
- The modules REALLY need 3.3V. Use a regulator.
- The inputs to the module also need to be 3.3V! The simplest way to make this work is to run you picaxe at 3.3V. Both the 14M and the 18X that I tried ran fine at 3.3V. (The 14 is rated for it, but the 18X is rated for 4V!) It may be that programming the 18X requires 4V, but it will run fine at 3.3. More experimentation is required.
- If you are running the modules off 5V, a voltage divider can be used for the RX And TX lines. As previously, at 10K to the pin and a 20K to ground gives 5V * 2/3 = 3.333V.
- I had limited success transmitting decimal values. It worked better to transmit raw ASCII.
Here is the test program for the tranmitter:
- main:
for b0 = 1 to 250
serout 1,T2400, ($55,$55,b0)
sertxd (b0,13,10)
pause 10
next b0
goto main
Here is the test program for the reciever:
- main:
serin 1,T2400,($55,$55),b0
sertxd (#b0,13,10)
goto main
Note that each tranmission is preceeded by two check bits. This limited bit of error correction seems to go a long way to reducing noise.
I tested the transmitter receiver pair with the receiver in the loft and the transmitter in the back of the garage. This is a distance of about 20 meters with several walls and a floor in between. There signal was perfect!
So far I am very satisfied with this product. I need to test it in the science lab building with its steel walls and oodles of metal.

[...] finally found a useful wireless serial link in the form of the XBee modules which are discussed here. I purchased a wireless camera and put things together. Here is the first iteration of the [...]
Pingback by profmason.com » Computer Vision Platform — November 18, 2007 @ 1:28 am
[...] have managed to get them to work, but I think their utility for robotics is pretty much nill. The Xbee modules I discussed earlier are a far superior [...]
Pingback by profmason.com » Wireless coms — January 2, 2009 @ 2:53 pm