Remotely controlling a robot by way of wires or infrared limits the range to just a few feet. And when operated by wire the robot’s tether might get caught up on things, snagging itself on its own lifeline.
With digital radio signals, it’s possible to communicate an unlimited set of instructions between you and your robot.
There are numerous options for setting up RF links between you and your mechanical friend. I’ll concentrate on just the most readily accessible ones, favoring low-cost alternatives that are also easy to implement.
Communications systems are roughly separated into three main groups, based on the direction of talk between speaker and listener. These same communications techniques apply to robot links as much as they do people.
All link types have their place in robot remote control systems, though simplex and full-duplex are the the easiest to implement. Simplex is adequate if you only want to issue commands for your robot to follow, in much the same way as the wired and infrared remotes described earlier in this chapter. Full-duplex is desirable if you want to collect information back from the robot, such as telemetry (electronic data about its condition), response codes, sound, or video.
The original edition of Robot Builder’s Bonanza included some hackish projects that involved taking apart some cheap consumer walkie-talkies and using them as the backbone for RF links with a robot. This was 1980s kitsch to be sure, and well before the advent of Bluetooth and other popular and affordable communications standards.
Besides making data communications much easier, these standards greatly reduce costs—you can get a pair of radio link modules for under $50, and they transmit data much faster (and with less error) than any homebrew kludge could manage. Three standards lead the pack as being particularly well suited for use with amateur robotics: WiFi, Bluetooth, and ZigBee.
All three provide full-duplex operation, which also means, with some exceptions, that you need a pair of radios to make any link. When used in full-duplex mode, data radios are said to be transceivers, because they both transmit and receive. You can, of course, use a data radio in simplex mode, in which case one works as the transmitter and the other works as the receiver.
This is the same technology used in home wireless LAN connections to the Internet. The 802.11 moniker comes from the formal specification for this type of link, set by and managed by the Institute of Electrical and Electronics Engineers (IEEE). Though best known as the means to connect to the Internet using home and portable devices like the iPhone or iPad, 802.11 data radios are used for many other tasks as well.
Under the hood, 802.11 uses the 2.4-GHz (gigahertz) radio band, shared with some other communications gear such as digital cordless phones. It’s also used by Bluetooth (see below) and even consumer appliances like microwaves (your microwave oven isn’t talking to anyone over this communications band, but it does generate radio waves at this frequency).
While 802.11 offers the greatest range of the three technologies covered here (though this depends on a lot of factors, as discussed later), it’s also the most expensive to implement. Depending on your application, the cost may be offset by the added functionality of being able to access your robot data radio via an existing wireless Ethernet network.
The 802.11 specs have been amended throughout the years, and the amendments, or protocols, go by letter suffix. Two common WiFi protocols are 802.11b and 802.11g. One of the principal differences in the protocols is the maximum bitrates provided by the radio. In 802.11b, for instance, the maximum data rate is 11 Mbit/second (megabits per second). In 802.11g, the maximum is 54 Mbit/second.
Known primarily as a method to link mobile phones with hands-free earpieces, Bluetooth is a full communications standard in its own right. Bluetooth data rates aren’t as fast as 802.11; the most commonly available data radios top out at 3 Mbit/second, though the latest Bluetooth specification entails a maximum data rate of 54 Mbit per second.
Bluetooth modules are available in three different classes, based on their power output.
Bluetooth supports a series of profiles that define its intended application. A Bluetooth-enabled stereo headphone set has a different set of operating parameters than a Bluetooth-enabled computer printer, so the two use profiles that best fit their roles in life. For robotics, the most common profile is SPP, or Serial Port Profile. SPP emulates your basic RS-232 or two-wire serial communications port. Note that many Bluetooth data radios may support additional profiles as well.
ZigBee is a standard based on the IEEE 802.15.4 specification for low-speed, low-power wireless data communications. ZigBee is only one of the technologies that uses the 802.15.4 specifcation (MiFi and WirelessHART are others), but it’s the one that’s been most embraced by the robotics community.
The idea behind ZigBee is keeping costs low, so that wireless communications can be affordably built into consumer products such as light switches and home theater receivers. As a result, ZigBee data radios are among the least expensive of them all—you can purchase a pair of them for under $50, depending on the feature set.
Like 802.11 and Bluetooth, ZigBee operates at the 2.4-GHz band, and also 914 MHz (megahertz) and 915 MHz, depending on the international locale. When operated at high frequencies, the maximum data rate is 250 kbit per second; the lower MHz-range frequencies support only 20- to 40-kbit/second rates.
ZigBee radios are low-power, transmitting just 1 mW of RF signal. Depending on the radio, frequency, and environmental factors, range is from about 30 to 250 feet. Because the RF output of ZigBee is low, it uses only a little current to operate. This helps save on battery power, a useful feature on any mobile robot.
A self-contained Zigbee module complete with integrated antenna is shown below. It plugs directly into a prototyping breadboard or circuit board, and is readily interfaced with a microcontroller.
As a side benefit of its low-cost nature, many ZigBee modules designed for hobby and experimental use also include a number of handy data acquisition features, highly useful for robotics. For example, the module might have one or more of its own analog-to-digital (ADC) inputs, as well as multiple digital input/output pins.
Nearly all data radios on the market use simple serial communications to connect with their hosts, making it easy to interface a radio with a computer or microcontroller. The exact form of serial communication varies by product, but it can include RS-232 (like that used on a personal computer), two-wire transmit-and-receive serial, I2C, and SPI.
For Arduino users, there are several ready-made shields that include the data radio built in. For example, the WiShield incorporates the standard shield board and an 802.11 WiFi data radio in one compact unit. For controllers like the Arduino, special function libraries are provided to make programming easier.
Data radios that use 802.11 can be more diffcult to set up because they are made to appear as WiFi nodes on a wireless network. This means you should be familiar with IP addresses, subnet masks, and other aspects of setting up networks, including setting security features.
Of the data radio standards, Zigbee is probably the easiest to implement, which is probably why it’s become so popular as a wireless communications link for robotics. It’s basically a wireless serial connection, and you use it like any other serial peripheral.
Radio links are common for discrete function control in combat robotics. The operator of the robot uses a radio control (R/C) transmitter, of a type similar to those for model airplanes and cars (most such transmitters are outfitted with a frequency crystal for land use, rather than airplane use). The operator controls joysticks and/or switches in order to steer or otherwise maneuver the robot.
Typical transmitters for model R/C applications have four to six channels, with each channel operated by the twin joysticks, a switch, or other knob on the transmitter. At a minimum, three channels are used: one each for the right and left motors, and one for the weapon.
It’s easy to use an R/C radio set to operate a robot equipped with servo motors. Instead of using a microcontroller to operate the motors, you merely connect a receiver that matches the frequency of the transmitter you’re using. You can use the receiver that came with the transmitter, as it’ll be set for the same frequency.
You’re not limited to operating your robot directly from an R/C receiver. Recall that servos are controlled using a pulse that varies from 1.0 ms (milliseconds) to 2.0 ms. The range between indicates the position of the servo.
By reading the duration of pulses from any servo connection on the receiver, you can determine the joystick position of the transmitter. You may then interpolate this information to anything you like—more speed, direction, whatever.
Methods for implementing this technique with a microcontroller include using a PulseIn (or similar) programming command to time the length of an incoming signal. It can also be done using one or more interrupt pins on the controller.
In the early 1960s, Wolfman Jack (whose real name was Robert Smith) broadcast his nighttime howling with 250,000 watts of energy, thanks to the cranked-up power of station XERF, which was located in Ciudad Acuña in Mexico. It’s said that the station was the most powerful in North America; birds would drop dead if they flew too close to the antenna; a person driving from New York to Los Angeles would never lose the signal, especially at night.
Let’s just say that radios for robotics are significantly less powerful—the typical ZigBee radio is 1 mW, or 1 one-thousandth of a watt. Even the highest power output of Bluetooth is no more than 100 mW—just a tenth of a watt.
At such relatively small power levels it’s not always a given that you’ll get the range “promised” in the documentation for your data radio or R/C transmitter. Many things can affect how far the radio signal will travel. Consider:
Purchasing a data radio set or R/C transmitter/receiver pair is perhaps the easiest way to provide a communications link between you and your robot. But when the budget is low and you don’t mind rolling up your sleeves to do a bit of hacking, you might be able to press some other ready-made product into serving as the comm link between you and your bot. Here are some ideas: