Hack 92. Determine Your Antenna Gain
Figure out the approximate gain of your home brew antennawithout a spectrum analyzer.
After building one of the many antennas in this chapter, or perhaps designing one of your own, you will inevitably wonder just how much gain your antenna provides. While an ideal testing rig would include a spectrum analyzer and lab conditions, most people can't afford to bring such resources to bear on their little antenna project. Fortunately, informal gain tests are simple to perform, given some simple tools and a little patience.
Here is one method for estimating gain. While your results might not be as accurate as those provided by a "real" radio lab, it can give you a fair estimate of how well your equipment performs, for little cost.
Here's what you'll need:
- Two radio cards of the same manufacturer and firmware revision, as well as external antenna connectors (Lucent/Orinoco/Proxim cards or Prism II cards, such as the Senao/EnGenius models, work well)
- Two laptops
- The antenna to be tested
- Two antennas of known gain (preferably low gain and somewhat directional, like 8 dBi patch antennas)
- Two tripods, mounts, and pigtails for the above antennas
- A large, flat outdoor space free of obstacles
- A notebook
- A friend and a means of communicating with that friend (such as cell phones or FRS radios)
Connect an antenna to one of the cards and, using a program such as NetStumbler [Hack #24], run a simple site survey. Walk around the area a bit, and look for an unused (or lightly used) channel. Once you decide on a channel, quit NetStumbler and return to the other laptop. With the two laptops close to each other, set up an ad hoc network on that channel. Don't worry about your IP configuration; just set both machines to the same ESSID and channel. If you are using a Prism II card, you might prefer to use one laptop in HostAP mode [Hack #63] instead.
If you are using an Orinoco card on a Windows machine, open the Site Monitor utility in the client driver, on both machines. If you are running Linux, I recommend using Wavemon [Hack #30] on both machines. Both these tools update quickly and keep a history. Don't use a network scanner like NetStumbler, as it has been known to get confused when performing simple signal strength tests. Otherwise, open the client-monitoring tool that came with your card. While still close together, verify that the two laptops can monitor each other with no problems. It is much easier to debug configuration problems now than when you are far away from your friend later.
When you are satisfied that everything is working properly, you are ready to head out into the field. Set up the tripods and mounts about 300 feet or so apart. Be sure that your tripods are at least 5 feet high, to clear the 0.6 Fresnel zone. The Fresnel (pronounced "fray-NELL") zone refers to the shape of a wave as it leaves the antenna, expanding in a circular direction as it travels. The diagram at http://www.ydi.com/deployinfo/ad-fresnel-zone.php illustrates it well.
Using antennas of known gain on both sides, plug in your laptop and see what kind of signal you can find. With your friend keeping his end steady, slowly rotate your antenna until you achieve the highest possible gain between the two points. Now, lock down your side, and let your friend rotate his end until he achieves the highest gain. Work slowly, and keep in constant communication with your friend at the other end, until you agree on the best possible position for both antennas. Be sure that both of you take your hands off of the antenna before taking a reading.
Once you are satisfied that the antennas are well aligned, make a note of the received signal and noise from both sides. Let the entire rig rest a couple of minutes, and see if the signal fluctuates at all. If it does, you might be encountering unexpected noise on the band, so you might try a different channel.
When you are happy with your link, it is time to try out your new antenna. Without moving the other end, carefully replace one antenna with the antenna to be tested. Ideally, you should use the same pigtail and feed line to eliminate the possibility of variations in the cabling. While watching the signal strength meter, slowly rotate the antenna until the highest possible gain is achieved. Again, let the entire system rest for a moment or two. When the link looks stable, record the received signal and noise from both sides.
The difference between both readings, plus the gain of the antenna that was traded out, is the approximate gain of your home brew antenna. For example, suppose you first measured a signal of -56 dBm using an 8 dBi patch antenna. When you swapped it out for a circular waveguide, your signal strength jumped to -46 dBm. The difference between the readings (8 dBm) plus the gain of the known antenna (8 dBi) equals the approximate gain of the waveguide, which is approximately 16 dBi.
You can also compute the difference in noise readings to see an approximate estimation of how well the antenna rejects noise from the path. With noise, a lower signal is better. Remember that you are dealing with negative numbers, so a noise reading of -100dBm is actually better than -90dBm. Likewise, since you want more signal, a reading of -46 dBm is much better than -56 dBm.
One critical point that isn't measured in this sort of test is Standing Wave Ratio (SWR). This is a measurement of how much signal is being reflected back into your radio from the antenna, and tells whether your antenna is well matched to the frequency your radio is transmitting on. Unfortunately, determining the SWR of very low power cards at 2.4 GHz is typically measured with expensive equipment. Fortunately, as these radios put out only a few milliwatts, there is little chance that your radio will actually be damaged by a mismatched antenna. It just won't work very well. If you have some soldering skill and a bit of time, this DIY project is an interesting design for a home brew SWR meter: http://home.wanadoo.nl/erwin.gijzen/wifiswr/.
Once your antennas are aligned in a setup like this, you can test as many home brew designs as you like. Just be sure to keep the other end steady, and take everything one step at a time. Make a note of everything you observe as you go, and keep the number of variables to a minimum. While this method might not be as accurate as a spectrum analyzer, it is a very cost-effective way of getting an estimation of how your antenna design actually performs.