DIY Antenna Amplification and Automated Aiming Systems

DIY Antenna Amplification and Automated Aiming Systems
Marty Rand, Dane Schoelen
Norman Advanced Robotics

1. Introduction
At the 2011 Global Conference on Educational Robotics, internet was not available in the main ballroom. While it was possible to buy internet for the hotel rooms, it seemed impossible to get that internet in the ballroom. A Rosewill RNX-N180UBE (source: [1]) wifi card with -78 dBm sensitivity and a 5 dBi omnidirectional antenna was unable to reliably connect to the hotel's wifi. Sadly, -78 dBm was inadequate for such a long-range connection, and a 5 dBi omnidirectional antenna did not offer enough gain. A more sensitive wifi card coupled with a more powerful directional antenna would have helped establish a better signal. Even with a directional antenna, aiming it precisely at the access point is tricky. A robot that automatically aims the antenna would help immensely. This also applies to office and home environments where the access point is out of reach of a user's computer. Many offices do not approve of employees setting up their own routers, but they would not care if workers had larger antennas on their desks. In this paper, we discuss terminology, wifi cards, antennas, and a robot that automatically aims antennas.

2. Terminology

2.1 dBi (source: [2])

dBi is a measure of wifi antenna gain, or in this case size. The larger the antenna, the more dBi it has. Larger antennas can detect wifi networks further away from the user, but have less room for error (see Antenna Tilting). The formula for dBi is Gain=10*log⁡〖((linear intensity)/(isotropic intensity))〗 Linear intensity is power along one axis, whereas isotropic intensity is power extending outward in a sphere from a central point. A 0 dBi antenna has a spherical (isotropic) area of effect.

2.2. dBm (source: [3])

dBm is a measure of power compared to 1 milliwatt. The formula for dBm is: dBm = 10* log⁡〖P+30〗 where P is the ratio of power (in milliwatts) compared to 1 milliwatt. 0 dBm is 1 milliwatt. 30 dBm is 1000 milliwatts, or 1 watt.

2.3 Reception Sensitivity (source: [3])

Sensitivity, measured in dBm, is how faint of a signal the wifi card can detect. This is crucial for establishing a stable connection at long distances, or through many obstructions. Furthermore, sensitivity is the most important thing to look for when wifi card shopping. Sensitivity is usually different at different data rates. For example, 802.11b, with a data rate of 11 Mbit/s, has better sensitivity than 802.11g, with a data rate of 54 Mbit/s. In addition, within 802.11g there are different data rates with different sensitivity ratings. In general, the slower the connection, the greater the sensitivity is. All of the sensitivity ratings in this paper are for 802.11g at 54 Mbit/s. Sensitivity values for wifi cards are negative most wifi cards have a sensitivity rating in the -70 dBm to -95 dBm range. When converted into watts, sensitivity ratings range from 100 picowatts (pW) to ~.3 pW, meaning for every 10 dBm lower the sensitivity is it takes 1/10th the signal of achieve a connection. In other words, the lower (more negative) the sensitivity, the better the connection will be.

2.4 Transmission Power (source: [3])

Transmission power, also measured in dBm, is how much power is applied to the antenna. While this can help connections at long distances, it also affects the maximum legal antenna size one can use (see Legal Limits). Transmission power for most wifi cards range from 15 dBm to 32 dBm. Converted into watts, that is .03 W - 1.58W. The main thing that limits transmission power is the 5 watt power limit of USB. Many manufacturers have circumvented this by having a USB Y cable that connects two USB ports to one wifi card, allowing for much greater transmission power. Transmission power ratings are positive. The more the transmission power, the stronger the connection will be.

3. Wifi Card Drivers
The built-in wifi card drivers that come with Windows are often old and outdated. With an EnGenius EUB9603H, we saw nearly twice as many wifi networks after we updated the drivers to the latest from the manufacturer's website. All tests listed in this paper use the newest drivers available.

4. Antenna Brand Selection
While homemade antennas can be bought on places like (source: [11]), in general, these antennas are of very low build quality. A better way to get antennas is to go to a reputable wifi card manufacturer's website for their wifi antennas, Rosewill (source: [12]) and Alfa Wireless (source: [13]) especially.

5. Internal Antennas
Many wifi cards have a built-in, or internal, antenna. Because they have to fit in the case of the wifi card, they have very poor gain. These antennas are very small, and therefore are useful for tasks where large hardware is not practical. Most of these antennas are so small that they are printed on the wifi card's circuit board. These are not good for long-range connections, as the signal will be lost very quickly. At the same time, these are great if the wifi card needs to be very small.

6. External Antennas
The better wifi cards have an external antenna jack, normally RP-SMA (Reverse Polarity - SubMiniature version A) (source: [14]) or a smaller proprietary jack that can be adapted into RP-SMA. Although more cumbersome, external antennas provide far better gain, allowing them to connect to wifi networks much further away. In addition, there are many kinds of external antennas, which this paper discusses.

7. Omnidirectional Antennas
Omnidirectional Antennas are the most common type of antenna. As their name implies, these antennas can see wifi networks in a 360-degree area around the antenna. Omnidirectional Antennas are the most convenient antenna type because little to no aiming is involved. However, to achieve maximum signal quality, you may need to tilt the antenna (see Omnidirectional Antenna Size Selection and Antenna Tilting).

8. Omnidirectional Antenna Size Selection
As an omnidirectional antenna increases in size, the range perpendicular to the antenna increases, but the range parallel to the antenna decreases. If you want to access a wifi network down the street, the larger the antenna the better. At the same time, the bigger the antenna, the less tolerance for the antenna tilting (see Antenna Tilting). Going larger than 5 dBi makes it very difficult to properly aim the antenna. If you want to access wifi networks ten stories higher than the antenna, a large antenna placed horizontally would be best. If you want to have a portable yet powerful antenna, a 5 dBi omnidirectional antenna would be ideal (from our testing).

9. Directional Antennas
A directional antenna has far better range than an omnidirectional antenna, but only functions in one direction. While there are many types of directional antennas, this paper addresses parabolic reflectors, cantennas, panels, and yagis. In the case of directional antennas, the greater the dBi, the better the range, and the more directional the antenna is. That means that a 25 dBi directional antenna will reach very far away, but will be very precise, and will require exact aiming to get any signal at all. By the same logic, a 16 dBi directional antenna requires less precise aiming, but cannot connect to wifi networks as far away as a 25 dBi directional antenna (see Antenna Tilting).

10. Antenna Tilting
As stated above, the larger an omnidirectional gets, the further it can reach perpendicular to the antenna, but the less it can see parallel to the antenna. This means that if a large omnidirectional antenna tilts, it will have a significant range loss. This happens because the antenna's area of effect covers the underground or the sky rather than the lobby of the hotel at which you are staying. This issue also occurs with directional antennas. The more powerful a directional antenna, the narrower the area of effect is and the more precise the required aiming is.

11. EZ-12 "Windsurfer" Parabolic Reflector
Source: [15]

This wifi range extender is, by far, the easiest and cheapest, as the materials include aluminum foil, a file folder, and adhesive. The construction of this Parabolic Reflector is very straightforward. Simply print and cut out the template, glue aluminum foil and the template to a file folder, put the tabs in the slots, and place the resulting metallic paraboloid around any vertical antenna. The maker states that the normal size adds about 9 dBi of gain to an antenna. The normal size is only enough to fit around a 2 dBi antenna. Simply enlarge the image, with GIMP for example, until the template size matches the antenna size that you are using. Alternatively, print out multiple copies of the normal size and stack them on the antenna. This method will not achieve as much gain unless you place a small piece of aluminum foil over the gap between the different reflectors.

12. Directional Cantennas: from Steel Cans
This was the first kind of homemade antenna modification we attempted. This, a cantenna, is the stereotypical homemade antenna mod. All this mod does is place an omnidirectional antenna inside a metal can to reflect the radio waves out the can in one direction. This is a very simple modification. All that is necessary is to drill a hole in the side of the can and put your antenna into it. However, we wanted better results. We glued a Windsurfer (discussed above) to the back of the can and lined up the hole in the can with the Windsurfer. This makes a perfect paraboloid for the antenna, allowing the radio waves to reflect out the antenna with less hindrance, and more accuracy. For this mod to work ideally, you should pick a can with a diameter equal to the length of the inserted antenna. The depth of the can determines the precision of the antenna. The taller the can, the further it can reach, but the less room for error you have. The bigger the diameter of the can, the further it can reach. This is because the antenna will send the radio waves from in a more direct route to the access point.

13. Directional Cantennas: from Dryer Tubing
The problem with using a can for the reflector is that cans only come so big. If you want a 7 in diameter can, you are out of luck. Although, they make dryer tubing much larger than that. We went to the hardware store and bought some dryer tubing that we can use instead of a can. They make those in much bigger sizes, such as a 7 in tube which is the right size for a 5 dBi antenna. Dryer tubing does not come with a cap on one end, so we made our own by duct taping several layers of aluminum foil to one end. We then did the same procedure as we did with a real can.

14. Directional Panel Antennas
Panel antennas are the most easily portable type of directional antenna we tested. These antennas are much harder to build than a cantenna because panel antennas are inherently directional and therefore require soldering to make. It is far easier to buy a panel antenna from a place like Alfa Wireless (source: [12]).

15. Directional Yagi Antennas
Yagi antennas are the most linear directional antennas of the ones tested. These antennas are best known for their use as roof-mounted TV antennas. They look like giant metal fish bones. These antennas are very useful for aiming because it is easy to see where they are pointing. These antennas are also very easy to mount to a robot because they often come with metal plates that you can screw onto almost anything.

16. Legal Limits
Source: [16]

The legal limit in the United States for the power of an antenna is 36 dBm (4 watts). You calculate the power of an antenna by adding the transmission power of the wifi card to the antenna's gain. Anything over this limit is illegal in the USA. This means that if you have a very powerful antenna, you cannot couple that with a lot of transmission power. Note that sensitivity is not in that equation. This is because the FCC is worried about people broadcasting their signal far away, not receiving a signal from far away. Sensitivity does nothing to broadcast a signal further. It merely enables the wifi card to sense a weaker signal from further away.

17. Tripods
Aiming a half-meter long directional antenna can be very difficult. This is why a small tabletop tripod is useful. Tripods are especially helpful when aiming high power directional antennas, because of the minimal room for error. We used a Vanguard VS-82 tabletop tripod (source: [17]) for aiming all of our directional antennas to achieve the maximum signal strength.

18. Tripod Mounts
Most tripods come with a screw (size may vary) that is designed to go into the bottom of a camera. You can attach an aluminum plate to most tripods by drilling a hole in the plate slightly larger than the screw. The yagi antennas we tested come with a metal plate perfect for this. For the cantennas, you can attach a piece of PVC pipe to the metal plate using U brackets, with which the yagi antennas also come.

19. Obstructions
One of the biggest factors of how far a wireless signal will travel is the number and size of the objects in the antenna's path. Metal reflects radio waves, and most buildings have a considerable amount of metal. Furthermore, all non-metal objects impede radio waves. They just might not reflect all of the waves. This is why a connection in the middle of a prairie will go much further than in a city.

20. Finding Wifi Networks
Obviously, it is impossible to aim a directional antenna if the location of the access point is unknown. A good way to get a general feel for the location of an access point is to use a wardriving app for a smart phone. These apps will log nearby wifi networks, along with the GPS location of the phone. We recommend Wigle Wifi Wardriving for Android (source: [18]). With this, all you would do is walk around the area with the app running, and then look at the map it generated. Then, aim the directional antenna at the approximate location where the phone received the best signal strength. We used this technique in the included tests to locate nearby network candidates.

21. Wifi Networks Used for Testing
For the purposes of these tests, we chose the wifi networks based on distance from the antenna, and the number of obstructions between the antenna and the access point. The networks, with their names redacted, are as follows.
A local wifi network (similar to a standard home setup)
A wifi network 10ft away, but through a metal obstruction, without an alternate path. We did this by wrapping aluminum foil around each antenna.
A wifi network 1 house away
A wifi network ~400ft away, and through ~3 houses
A wifi network ~400ft away, and through ~6 houses

22. Test Result Summary
See [19] for full raw data

By this deadline, we were unable to complete all 650+ tests. Here are the observations we have so far. As expected, the internal wifi cards (Intel WiFi Link 5100 AGN & EDIMAX EW-7811Un) performed very poorly, seeing only 6 and 4 wifi networks respectively. The Alfa AWUS036H performed better than the specs would predict, seeing 13 wifi networks with a 2 or 5 dBi antenna. The major outlier was the Rosewill RNX-N2LX, seeing a massive 15 wifi networks with a 5 dBi antenna.

23. Project Yagimoto: General
Yagimoto, named for the intended antenna type (Yagi) + moto(r), is a robot that automatically aims antennas at an access point. Yagimoto uses a tripod-mounted yagi antenna (discussed above) and two servos to aim the antenna toward the optimal wifi signal strength.

24. Project Yagimoto: Hardware
Yagimoto's hardware is very simplistic. It uses a heavily modified tripod. We removed the head of a Vanguard VS-82 tabletop tripod (discussed above), and replaced it with a metal plate from our kit. We then attached a servo to it, facing upward, and another servo to that one facing sideways. Lastly, we attached a metal beam from our kit to the horizontal servo, with our Yagi antenna's metal plate screwed into that metal beam. This allows the antenna to tilt up, down, left, and right by moving the two servos.

25. Project Yagimoto: Software - PC Side
We wrote Yagimoto's PC side using nothing but preexisting programs and bash scripting. Of course, this limits Yagimoto to Linux only. We chose Linux because it is easier to access a list of wifi networks on Linux than on other operating systems. The original Yagimoto design used iwlist (source: [20]) to retrieve a list of available networks. Then, the program greped (source: [21]) the list from iwlist into the signal strength for the specified network. Finally, Yagimoto served that signal strength via netcat (source: [22]) for the CBC to access. Yagimoto's PC side repeated these steps infinitely to update the signal strength as the antenna moves. Unfortunately, iwlist was very slow, giving us a new reading about every 16 seconds on average. We later replaced iwlist with Kismet (source: [23]) for obtaining signal strength. This resulted in a 5 times increase in response time to about 3 seconds. You must run Yagimoto's PC side as root. We used Ubuntu 12.04 (source [24]) for all testing of Yagimoto's PC side, although almost any modern Linux distribution should work. We recommend Linux kernel 3.0 or newer for proper driver support.

26. Project Yagimoto: Software - CBC Side - Initial Setup
When you first run Yagimoto, it will set the servos to the default position (change ServoInitPosX & ServoInitPosY to change the default position with the provided code). Then, Yagimoto takes a signal reading, turns right 10 degrees, takes a another signal reading, turns left 20 degrees, and takes yet another signal reading. Yagimoto then uses these first few signal readings as the initial values for the main process (see below) to get a general feel of which way to turn the antenna. Yagimoto will repeat this process for the Y-axis once the X-axis is centered.

27. Project Yagimoto: Manual Mode
Another feature we implemented was a manual mode where you would stop Yagimoto, aim the antenna by hand, and then have Yagimoto continue the centering from there. This is useful if you already know the approximate location of the wifi network (e.g. aim it at the lobby of the hotel at which you are staying). To do this with the provided code, hold down the A button during the scanning process. Then, use the arrow keys to move the antenna in the specified direction. Press A again to exit manual mode. The code checks for the A button before every movement.

28. Disappearing Wifi Networks - Dual Yagimoto Action
A feature we wanted to add was a dual Yagimoto mode. In this mode, one Yagimoto would maintain a connection to the current access point, while the other would look around for an alternate access point. This way, if the main wifi network you are using disappears, you can instantly switch to the other Yagimoto as the main internet source, and use the first one as the secondary wifi finder.

29. Protecting Your Wifi Networks
Some people leave their wifi network open to share bandwidth with others. Because of this, many non-malicious people will assume that if you leave your wifi network unencrypted, you are fine with them having some free internet. If you do not want people (malicious or non-malicious) using your wifi, there are some measures you can implement to protect against them.
Encrypt your network with WPA2. WEP is very insecure and can be broken in minutes.
Use a password unaffiliated with the users of the network. Do NOT use your name, phone number, birthday, address, etc as your password.
Most users will avoid your network if it is encrypted, even with WEP. However, relying on being safe from "most users" is generally poor security practice, which is why we recommend the above measures instead of simply using WEP if you do not want neighbors using your internet access.

30. Protecting Yourself on Untrusted Networks
If you are on a public network (e.g. at a hotel), be careful. Malicious users can log everything you do, including your passwords. Using an extension such as HTTPS Everywhere (source [25]) will protect you from most password thieves. In addition, it is a very bad idea to do online banking, or anything else risky, on a public wifi network.

[1] "RNX-N180UBE"
[2] "Wikipedia - Antenna gain"
[3] "Wikipedia - dBm"
[4] "Intel WiFi Link 5100"
[5] "RNX-N250UBE"
[6] "RNX-N2LX"
[7] "AWUS036H"
[8] "EUB9603H"
[9] "EW-7811Un"
[10] "AWUS036NHR"
[11] "eBay Antennas"
[12] "Rosewill Antennas"
[13] "Alfa Antennas"
[14] "Wikipedia - SMA Connector"
[15] "EZ-12 Template"
[16] "FCC Limits"
[17] "Vanguard VS-82"
[18] "Wigle Wifi Wardriving for Android"
[19] "Raw Antenna Data"
[20] "iwlist"
[21] "grep"
[22] "netcat"
[23] "Kismet"
[24] "Ubuntu"
[25] "HTTPS Everywhere"


WarDriving app for Android is

WarDriving app for Android is pretty cool. All the latest apps are available for free on your Android and iOS devices using Tutuapp. Tutuapp apk download and get all latest apps for free.