Radio Link for your robot to your computer (Cheaply).
July 20, 2011
Some of you have noticed the small, low-priced transmitter-receiver pairs available, which seem quite nice for robotic links, robot to robot, or robot to controller or controlling computer. These are available in 315.0 MHz and 433.92 MHz. frequencies.
You can get them with or without encoders. If you expect multiple signals at your selected frequencies, then you should get the ones with included encoder-decoder pairs.
The current price (mid-2011) in US dollars is about $3 per pair without encoder and $9 a pair with encoder.
What you may not realise is why these units are available so cheaply and what they are normally used for. The most common use is in RKE / Remote Keyless Entry systems available in many makes of cars today. 315 MHz. is the standard for United States and Japan carmakers, while 433.92 MHz. is the standard for European carmakers. This is your basic key-fob unit, which will unlock your car door, or sound the horn and flash the lights if the alarm button is pressed. Because these units are very low-power, some models only work up to 15 feet (5 meters) or so, while other vehicles will respond up to 100 feet (30+ meters) away.
So can we use them for robots? Absolutely! Ask yourself how often someone will be in range of your robot pressing their car's key-fob buttons? Unless you live in or near a large parking garage or lot, the answer is: very seldom. –So by all means, take advantage of the inexpensive technology for linking to your robot. (Buy the encoded version if you want to protect yourself from those occasional false signals. These units are being used in more and more places of late...)
[ ADDED: And as mentioned in comments below, because these are low power, they are also susceptible to electrical noise. They are not the right answer for everyone.]
Another consideration might be to use the US standard (315.0) if you are in Europe, -or the European standard (433.92) if you are in the US. [Remember European cars (Mercedes, BWM, Rolls Royce, VW… etc.) will use the European system.] The likelihood of getting false triggering signals should still drop considerably. I also need to mention the RKE systems use coded signals themselves, so when you press your key-fob button a fixed 8-bit digital code (telling you car what function to perform) is added to a random code string (so the car will only respond to the car owner's unlock command and not someone else's.
For Use on Robots
If you are connecting an autonomous robot (one with a brain-chip) to an intelligent system like a computer, you do not actually need an encoder-decoder system as your robot-computer link can accomplish the same thing for you. Your computer can send a certain code (picked by you) first as an ID code and follow it with the command or data you want your robot to get.
The robot's brain chip will see the incoming signal (perhaps via an interrupt?) and check to see if the first data byte is the expected ID code. If it is, then the rest of the signal is acted upon or stored in memory as your design dictates. If the first data byte is not the right ID code, then it will ignore that entire data string.
These are Low-Power Units. How do I get around that?
"Key-fob" transmitters typically have a signal output of only about one milliwatt. As the robot explores your house, if there is too weak a signal for your robot and computer to stay in contact, how can you fix this? How can you increase the range?
One answer might be building a repeater with a powerful receiver that listens for the weak signal from your transmitter and rebroadcasts it at higher power. A second possibility would be adding an RF amplifier stage to your key-fob transmitter. The final possibility I will explore would be adding a high-gain antenna to your system to help send or receive the signal that is already available.
As to the repeater idea, let us shelve that as beyond the knowledge and abilities of most of the LMR members. Also, why buy cheap units if you must turn around and spend more to make it work for you? You should not.
What about an RF amplifier on the transmitter? That is possible and would not add greatly to the original cost, making this a feasible alternative money wise. However, as before, this is pushing the knowledge limits for LMR members. (I may later draw up a simple RF amp that could be used, but have not done so at this time.)
This leaves us with the final option. We can add a better antenna than simply using some random length of wire soldered to the ANT connection.
Building an Antenna for 315.0 or 433.92 MHz.
The main point of all these numbers that follow is that if you use a random length of wire, the signal may drain off to almost nothing, but if you use one that is a multiple of one wavelength at that frequency, the signal will not degrade and even be multiplied in some cases.
There are a few antenna designs that may be useful, such as a dipole, a ground plain, a loop antenna or a directional antenna such as yagi or quad antennas. These last two are larger and would not mount on the robot well. They could be used at your computer end if you really feel the need to direct the signal.
For mounting on your robot, you will need the simplest design possible, and depending on the robot's size, the smallest design possible as well.
Wavelength is calculated by dividing the frequency (in cycles per second) into the speed of light. This is 299,792,458 meters per second in metric, or 983,485,813 feet per second. These are often rounded off to 300 million meters per second or one thousand million feet per second. (one US billion)
An antenna with a length equal to half the wavelength is the most common, simple antenna, but the length of one-half wavelength at 433.92 MHz is about* thirteen and six tenths inches (~34.5 cm.) and if you are using 315 MHz. the half wave antenna will be even worse at about* 18.7 inches. The largest robots could sport an antenna that large, but most of the robots LMR people are making would look ridiculous with that sticking up.
* [why am I saying 'about'? See the table and formulas below for a more accurate length]
One-quarter wavelength is the next common value used in antenna design, and if that is still too big for your robot, drop to 1/8th wavelength.
One quarter wavelength at 315.0 MHz is about* 9.37 inches (23.8 cm) and 1/8th wavelength is about* 4.68 inches.
One quarter wavelength at 433.92 MHz is about* 6.7995 inches (17.27 cm) and 1/8th wavelength is about* 3.400 inches (8.64 cm).
Now we are down to a length we can handle. One-eighth wavelength may not be as good an antenna as one-quarter wavelength, but it will still be much better than a random length of wire.
The lengths should be as exact as possible. For instance, if you hooked an antenna wire right to the transmitter module, the antenna length should be measured starting from the output of the tiny capacitor on the board. (So the antenna will need to be cut nearly a quarter inch shorter than the calculated value.) If you use coax, the length of the bare leads also need counted as part of the antenna length.
We can also use the longer one-half wavelength (or one-quarter wavelength) of wire but wrap it around a thin dowel (such as a round "throw-away" chopstick or any other non-conductor that is 3 to 6 mm in diameter). Your antenna would then be only an eighth of a wave in physical length, but electrically, it will resonate at the greater value, which will give much better results. Note that to figure out the exact wire length here gets a wee bit complex inasmuch as the wire coiled up introduces inductance into the result. The closer the turns are to each other the more effect will be seen from inductance, but if the coils are kept stretched out as much as possible the resultant signal will not suffer that much. (-maybe in the 3 to 5 % range)
Another antenna that might work quite well on a robot would be a loop or halo antenna. The idea is to use the longer one-half wavelength antenna, but bent into a circle. Since the two ends of a 1/2 wavelength loop are out of phase, you can hook the centre conductor of your coaxial cable to one end and the outer ground-braid to the other. This only works for the 1/2 wavelength antenna (or odd multiples thereof - 3/2, 5/2, etc.). It happens that a piece of 4" copper pipe is going to be very close the right circumference for 1/2 wavelength at the 433.92 MHz frequency once the extra solder and coaxial wire is counted. Cut as narrow a slot in one side as you can and solder the cable conductors on either side of that gap. Spread the gap a little if you desire, but keep the wires as short as possible. The insulation of the coax melts easily, so flux it well, and heat the wires, making the connection quickly. If a piece of copper pipe is not available, just use a piece of stiff copper wire or flexible copper tubing bent into a circle. (Do not use braided wire because it weaves back and forth and the electrical length cannot easily be predicted. Also, avoid iron or aluminium wire as they do not conduct well enough for our purpose. We want the best conductivity we can get, which would be silver or copper wire.) A heavier gauge wire, like 8 or 10 gauge, taken from a piece of house wiring cable, is better than using thin wire, as a larger diameter conductor has a broader bandwidth. You can also use soft copper tubing which is a larger diameter and therefore even better for an antenna. The diameter of the conductor to the length ratio needs to be factored in, so see table #1 below:
Length to Diameter Ratio
- Table 1 -
L = (492 x K) / f
L is the antenna radiating-element length in feet
K is the factor from the table above
F is the frequency in MHz.
L = (5905 x K) / f
L is the antenna radiating-element length in inches
K is the factor from the table above
F is the frequency in MHz.
L = (14999 x K) / f
L is the antenna radiating-element length in centimetres
K is the factor from the table above
F is the frequency in MHz.
For the 315.0 MHz units, a ring cut from a piece of 6" copper pipe and then split, will be a good match for that wavelength. Six-inch diameter copper pipe (15 cm) is not very common, and is therefore expensive, so you will probably need to cut a wire or soft tubing and bend it around something to get a nice round loop instead.
There is a plus when using a loop antenna that I almost forgot to mention. I said it can be mounted horizontally for good results in all directions (horizontally). What I forgot to tell you is that the loop does not need to be way above your robot on some sort of mast. It may be mounted close to the body of the robot, even if the robot has an all-metal body. It might well look like your robot has a top-mounted "luggage rack". At these frequencies, you will probably want to stay a couple centimetres from the metal surface, but you could easily mount the antenna as close as, say, one centimetre above the surface and not lose too much signal.
I once made a halo antenna for VHF TV reception (It was about 40 years ago - few UHF stations around back then.) which I mounted above a flat metal roof by setting it on some bricks. I did not want to drill into the roof to mount the antenna. The bricks kept the wind from catching the antenna. They laid flat and held the antenna about 2 inches (5 centimetres) off the roof. Even so, I had great reception on every channel in the 54-216 MHz. range, including FM radio as a bonus. That antenna had about an 800-ohm impedance and I used a "twin-lead" matching section.
Either a straight vertical antenna, or a loop antenna will probably be the best on a robot, so here is a quick sketch of a couple of the ideas for you:
(Click the picture to view it bigger)
Here is one place you can buy the transmit-receive "key-fob" pairs at the price I mentioned: http://www.satistronics.com/Wholesale-module-and-kits-wireless-modules_c1090 I have dealt with them before and had no problems other than it taking a couple weeks for delivery coming to me in the US from China. I am sure there are other places you can buy them from as well.
If you want to hook a transmitter and/or receiver to your computer, visit this site http://pinouts.ru/Slots/USB_pinout.shtml to see how USB connections are wired. (pin 1 is V+, pin 4 is ground, and 2 and 3 are data pins.)
ADDED; a sample wiring diagram to small picaxe
I mentioned a Yagi antenna above, so here is a quick sketch of one. As I mentioned on the drawing, I just used the web-page calculator at http://www.packetradio.com/ant.htm He has a lot more information on building one, so check out that page if you are interested.
(That page only calculates in inches, so multiply inch values by 2.54 to convert to centimetres.)
See below in the comments. I have added a couple quick designs for RF amplifiers in each frequency.