Wireless RF Data Connectivity

Wireless comm and robotics go hand in hand.  Its hard to figure out whats going on in that little brain without data.

Although the equipment has been around for a few years, getting a wireless data link operational is no small task.  There are many components to a working comm link and failure of any one of them will likely bring the link down.  Here are the elements of a read request from a PC to a microcontroller:
 

Your data gets handed off many times before it lands where its wanted.  This makes troubleshooting challenging.

I now have an operational link between my robot, my PC and a handheld controller.  They utilize low cost RF radio modules and my own "Mailbox" protocol.  Mailbox sets up a character array in RAM in the slave device.  All other devices can read from and write to addresses in the Mailbox.  This works for inter uC communications as well.  I currently have SPI, UART and UART RF AVR/GCC microcontroller drivers operational as well as a PC ActiveX component for UART and UART RF.

RF Communication Characteristics

The wireless link is similar to a wired link but there are some important differences that may affect how certain operations are carried out.

Baud Rates

The low end RF modules run at 2400 baud while high end devices work at rates up to 100 Kbaud.  As usual speed costs.  I have been usefully using a 4800 baud network.  Unless money is not an issue you will likely be operating a lower rates than you would be with a wired connection.

Half Duplex

Radios of this type allow only half duplex communication, that is communications can only go one direction at a time.  While this is not an insurmountable problem, it does force the system designer to think about how devices communicate.  You cannot allow each end to “talk” whenever it pleases or some transmissions may get lost.  The best arrangement is to declare one device to be the “master” and have it control the flow of data.  This would be the situation where a master polls slaves for data – the master sends a request, the slave responds with information.  Mailbox protocol is based on master slave communication although it can be configured to tolerate unsolicited slave messages.

Data Loss

Radio communication is a much less secure means of data transmission than wire.  Radio receivers go to great length to filter out an endless stream of interference to pick out the desired signal.  Even then much gets through and the packet controller must filter out  the incorrect characters received.

The result is a variable data dropout that varies with distance, location, time of day, your neighbours use of appliances and who knows what else.  In good reception areas 100% of data will be received – as reception drops off, the dropout rate will  rise to the point of unusability.

As a result, the receiving equipment must be capable of handling data loss situations.  For critical operations, a handshake may be set up with a retry routine.

Character Set Limitations

Radios need a continuous “sync” signal to ensure all data is received.  The radios must be sync’d prior to sending data and data flow must be non-stop from that point until the end of the transmission.  Characters with flat bit patterns, i.e. $00 and $FF can cause the radio to lose sync.  A subset of the ASCII character set that has bit patterns close to 50% on and 50% off (called 5050 characters) is used to ensure good communications.  This infers that 8 bit communications can not be used.  Data is first converted to ASCII Hex, i.e. the number 168, which is equivalent to 0xA8 hex, is converted to "A" followed by "8". "A" and "8" are in turn converted to 5050 before transmission and converted back at the other end.  The software abandons any packet that contains non-5050 characters.

The software drivers at each end look after the messy details of converting from multi-byte variables to single byte data to 5050 characters and back again.

Data Packets

In order to satisfy the radios need for continuous data, the data must be “packetized”, that is grouped into a packet with a preamble, data and checksum.    As a result data can not be sent continuously without interruption, although there are radio modems available that make this process invisible to the user.  The sender must somehow inform the receiver of the length of the packet.  The mailbox protocol has the length embedded in the message header.
 

RF Radio Modules

Here is a summary of sources of radio modules and some suggestions on models that I found interesting.  I have been using the SILRX / TXM radios from from RadioMetrix to date but they are getting a little long in the tooth.

Linx - mfr. of radio modules, distributed by Digikey
*** Low cost modules look good but are SMD only - $7/$14.
*** The TR-916-SC tranceiver looks interesting - 33.6Kbps, $45 ea
http://www.linxtechnologies.com/ldocs/f_prod.html

Lemos International - no pricing on website - geared to OEM
http://www.lemosint.com/

Abacom - wide range of modules
*** ATRT100-xxx $57 for tranceiver, 100 Kbps, FM
*** RTL-Data-SAW $17 for tranceiver, 4800 bps, AM
*** AM-RT4 / AM-HRR3 xmtr/rcvr $12/$11, 2400 bps, AM
http://www.abacom-tech.com/

OKW Electronics
*** FMRTF3 / FMRRF1 xmtr/rcvr FM - $12/$25, 9600 bps
http://www.okwelectronics.com/products/radiolist.html

Rentron Electronics
Mounts the Linx LC modules on a small board with pins for $14/$21, 4800 bps
*** Have inexpensive AM 2400 bps $8.50/$8.50 - best bet for low cost link.
http://www.rentron.com/PicBasic/RemoteControl.htm

RadioMetrix makes many of the modules sold by the above distributors and has
some good documentation
http://www.radiometrix.co.uk
 

Projects

My 2-way link between my robot, PC and handheld is not yet documented.  Here are two projects using one way links that I have developed:

Wireless RF Temperature Transmitter  One-way link based on Atmel AT90S4433

Robot to PC - A Wireless Link  One-way link based on 68HC11 / 68HC12
 

Botgoodies Home