### DIY Antenna Amplification and Automated Aiming Systems

```DIY Antenna Amplification and Automated Aiming Systems
Marty Rand, Dane Schoelen
yagimoto.martionlabs@gmail.com, daneschoelen@gmail.com
DIY Antenna Amplification and
Automated Aiming Systems
1. Introduction
At the 2011 Global Conference on Educational Robotics, Internet was unavailable in the main
ballroom. While it was possible to buy Internet for hotel rooms, it seemed impossible to get that
Internet in the ballroom. A Rosewill RNX-N180UBE (source: rosewill.com [1]) wifi card with
-78 dBm sensitivity and a 5 dBi omnidirectional antenna was unable to reliably connect to the
hotel's wifi. -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 personal routers, but they would allow larger antennas. In this paper, we
discuss terminology, wifi cards, antennas, and an antenna-aiming robot, Project Yagimoto.
2. Terminology
2.1 dBi
source: wikipedia.org [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  = 10 ∗ log(   ) . 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: wikipedia.org [3]
dBm is a measure of power compared to 1 milliwatt. The formula for dBm is: dBm = 10 ∗
log  + 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: wikipedia.org [3]
Sensitivity, measured in dBm, is the weakest signal the wifi card can detect. This is crucial for
establishing a stable connection at long distances. 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: wikipedia.org [3]
Transmission power, also measured in dBm, is the power applied to the antenna. Transmission
power for most wifi cards ranges from 15 dBm to 32 dBm. Converted into watts, that equates to
.03 W - 1.58W. The main limiting factor of 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 and range.
3. Wifi Cards Tested
Name
Source
Sensitivity
(dBm)
(pW)
Unknown
Transmission
Power (dBm)
(W)
Unknown
Bundled Antenna
Size (dBi)
5100 AGN
intel.com [4]
Internal Only
rosewill.com
[1]
rosewill.com
[5]
rosewill.com
[6]
-78 (15.8)
17 (.05)
5
-89 (1.3)
18 (.06)
2x5
-92 (.63)
17 (.05)
2x2
Alfa
AWUS036H
alfa.com.tw
[7]
-71 (79.4)
24 (.25)
5
EnGenius
EUB9603H
engeniustech
.com [8]
-85 (3.2)
20 (.1)
5
EDIMAX EW7811Un
edimax.com
[9]
-71 (79.4)
15 (.03)
Internal Only
Alfa
AWUS036NHR
alfa.com.tw
[10]
-92 (.63)
32 (1.58)
5
awful sensitivity, very poor gain, Dell
Studio XPS 1640's built-in wifi card,
control
smallest form factor of the wifi cards
tested that accept external antennas
sequel Rosewill RNX-N180UBE, 2
RP-SMA antenna inputs
big brother of the RNX-N250UBE,
ties for best sensitivity, 2 RP-SMA
antenna inputs, newest and largest of
Rosewill's wifi cards
excellent Linux compatibility,
advertises itself for extreme long rage
communication
has balance trouble with large
antennas because the RP-SMA jack is
off center, a weight fixed this
~5mm long, smallest wifi card tested,
great for connecting to two different
strong wifi networks, chosen to
compare with larger cards that accept
external antennas
ties for best sensitivity, very new
chipset
Rosewill RNXN180UBE
Rosewill RNXN250UBE
Rosewill RNXN2LX
4. 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.
5. 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).
6. 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. 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).
7. 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, 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.
8. Antenna Tilting
As stated above, the larger an omnidirectional antenna 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. 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.
9. EZ-12 "Windsurfer" Parabolic Reflector
Source: freeantennas.com [11]
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 until the
template size matches the antenna size that is being used. Alternatively, print out multiple copies
of the normal size and stack them on the antenna. This method will not achieve as much gain
unless a small piece of aluminum foil is placed over the gap between the different reflectors.
10. Directional Cantennas: from Steel Cans
This was the first kind of homemade antenna modification we attempted. The 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 the 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 hole in 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, the selected can should have 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 in a more direct route to the access point.
11. Directional Cantennas: from Dryer Tubing
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. A 7 in tube 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.
12. 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
can screw onto almost anything.
13. Tripods
A small tabletop tripod is useful for aiming high powered directional antennas, because of the
minimal room for error. We used a Vanguard VS-82 tabletop tripod (source: vanguardworld.com
[12]) for aiming all of our directional antennas to achieve the maximum signal strength.
14. 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.
15. Obstructions
One of the biggest factors effecting signal strength 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 farther than in a city.
16. 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 localize 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: play.google.com [13]). 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.
17. 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.
1. A local wifi network (similar to a standard home setup)
2. A wifi network 10ft away, but through a metal obstruction, without an alternate path. We
did this by wrapping aluminum foil around each antenna.
3. A wifi network 1 house away
4. A wifi network ~400ft away, and through ~3 houses
5. A wifi network ~400ft away, and through ~6 houses
18. Test Result Summary
See docs.google.com [14] for full raw data
We have tested the wifi cards and antennas listed above. As expected, the internal wifi cards
(Intel WiFi Link 5100 AGN & EDIMAX EW-7811Un) performed very poorly, detecting only 6
and 4 wifi networks respectively. The Alfa AWUS036H performed better than the specs would
predict, detecting 13 wifi networks with a 2 or 5 dBi antenna. The major outlier was the Rosewill
RNX-N2LX, detecting a massive 15 wifi networks with a 5 dBi antenna.
19. 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 and two servos
to aim the antenna toward the optimal wifi signal strength.
20. 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.
21. Project Yagimoto: Software - PC Side
We wrote Yagimoto's PC side using only 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: linux.die.net [14]) to retrieve a list of available networks. Then, the program greped
(source: gnu.org [16]) the list from iwlist into the signal strength for the specified network.
Finally, Yagimoto served that signal strength via netcat (source: http://netcat.sourceforge.net
[17]) 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 sec. We later replaced iwlist with Kismet (source: kismetwireless.net
[18]) for obtaining signal strength. This resulted in a 5-fold increase in response time to about 3
sec. You must run Yagimoto's PC side as root. We used Ubuntu 12.04 (source ubuntu.com [19])
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.
22. 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 determine which way to turn the antenna. Yagimoto
will repeat this process for the Y-axis once the X-axis is centered.
23. Project Yagimoto: Software - CBC Side - Main
Yagimoto's CBC side is very complex. Yagimoto receives the signal from the PC side via netcat.
It then adjusts the position of the antenna based on the following flow chart (magnify the PDF if
the text is too small):
If signal got
weaker last time
If signal got
stronger last time
If signal got
stronger 2 times
ago
If antenna went
left last time
If antenna went
left 2 times ago
The signal
continues to get
stronger so
Yagimoto moves
left again
If antenna went
right 2 times ago
The signal
continues to get
stronger, but the
direction of
movement
changed so
Yagimoto
assumes the
access point is 1/4
of the way from
the previous
position and the
one before that
If signal got
stronger 2 times
ago
If signal got
weaker 2 times
ago
If antenna went
right last time
If antenna went
left 2 times ago
The signal
continues to get
stronger, but the
direction of
movement
changed so
Yagimoto
assumes the
access point is 1/4
of the way from
the previous
position and the
one before that
If antenna went
right 2 times ago
The signal
continues to get
stronger so
Yagimoto moves
right again
If antenna went
left last time
If antenna went
left 2 times ago
The signal got
weaker then
stronger so
Yagimoto
assumes it passed
by an obstruction
so Yagimoto
moves left again
If antenna went
right 2 times ago
Yagimoto
assumes it
changed direction
to correct for a
weaker signal so it
moves left again
to continue
correcting
If antenna went
right last time
If antenna went
left 2 times ago
Yagimoto
assumes it
changed direction
to correct for a
weaker signal so it
moves right again
to continue
correcting
If antenna went
right 2 times ago
Yagimoto repeats
its last action to
confirn the signal
loss is real and
not an
obstruction
If signa got
weaker 2 times
ago
Yagimoto reverts
to the best known
position
The signal got
weaker then
stronger so
Yagimoto
assumes it passed
by an obstruction
so Yagimoto
moves right again
Yagimoto does these steps with 10-degree increments, and 5-degree increments for both the X
and Y axes. Yagimoto will immediately stop scanning if the past 3 signal readings are above -50
dBm because that would be an adequate signal strength.
24. Project Yagimoto: Manual Mode
Another feature we implemented was a manual mode in which you can 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 CBC's arrow keys to move the antenna in the specified direction.
Press B to exit manual mode. The code checks for the A button before every movement.
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.
1. Encrypt your network with WPA2. WEP is very insecure and can be broken in minutes.
2. Use a password unaffiliated with the users of the network. Do NOT use your name,
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.
26. 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:
eff.org [20]) 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.
27. Conclusion
We have produced a very viable system for connecting to wifi networks at long range, but we
could optimize it further. Removing the computer from the system is something we are looking
at for Yagimoto 2.0, perhaps based on KIPR's next robotics controller. We are also looking into
connecting two Yagimotos to one computer to provide a backup connection in case one
disconnects. If you ever want to find us, we are on the Botball Community regularly. You can
also find the full, un-redacted version of this paper there with entire sections not seen anywhere
else on the Botball Community.
References
[1] "RNX-N180UBE" <http://www.rosewill.com/products/1721/ProductDetail_Overview.htm>
[2] "Wikipedia - Antenna gain" <https://en.wikipedia.org/wiki/Antenna_gain>
[3] "Wikipedia - dBm" <https://en.wikipedia.org/wiki/DBm>
[5] "RNX-N250UBE" <http://www.rosewill.com/products/1871/ProductDetail_Overview.htm>
[6] "RNX-N2LX" <http://www.rosewill.com/products/1643/ProductDetail_Overview.htm>
[7] "AWUS036H"
<http://www.alfa.com.tw/in/front/bin/ptdetail.phtml?Part=AWUS036H&Category=105479>
[8] "EUB9603H"
[9] "EW-7811Un"
<http://www.edimax.com/en/produce_detail.php?pd_id=347&pl1_id=1&pl2_id=44>
[10] "AWUS036NHR"
<http://www.alfa.com.tw/in/front/bin/ptdetail.phtml?Part=AWUS036NHR>
[11] "EZ-12 Template" <http://www.freeantennas.com/projects/template2/>
[12] "Vanguard VS-82" <http://www.vanguardworld.com/index.php/en/pv/products/photovideo/detail-1-4-Table+Pod-134.html>
[13] "Wigle Wifi Wardriving for Android"