Arduino Controlled Wifi Antenna

Greetings,

I would like to devellop an arduino program that rotates a wave-guide antenna 360 degree's using a pan servo, and then points to the strongest signal, and then tracks it. I am fine on the hardware side, but I have no idea where to begin on the programming side. Any help would be very much appreciated.

How do I make the arduino read a wifi strength signal? Thanks!!!

Timduino

How do I make the arduino read a wifi strength signal?

You need a signal off the WiFi receiver known as the AGC signal that is automatic gain control. This involves hacking the receiver and is not for the faint of heart. Alternatively if you have a data connection with the receiver then it might be possible to get the signal strength directly from some parameter. However, the signal strength is not updated very often so tracking might be tricky. How fast do you need to update things?

I don't have a particular application for it, I just think it would be interesting to make. Would a PLC be better suited to this task? The arduino will be attached to the computer, so data should be able to flow back and forth. I wonder if a stepper motor and C++ might work more easily.

Tim

From what I've seen, a lot of RF equipment provides an RSSI, ASU, or some other value of significance; correct me as needed. Surely you can simply use that as the basis to hunt a signal. Unless both are moving, assuming that signal is available and a directional antenna in use, it seems like it would be trivial to lock.

Didn't somebody post a "poor man's wifi signal strength" sketch not too long back? Ah - here it is:

http://arduino.cc/forum/index.php?topic=54795.0

Maybe something like that can help. It relies on a bit of additional hardware - perhaps if you replaced the antenna on that with its own waveguide, it could serve as the sensor for the actual 802.11 waveguide.

If you wanted to be snarky with the naming, and you configured the waveguides so they were placed on top of one another - you could call it the "over-under"...

:)

it seems like it would be trivial to lock.

Things are seldom as easy as they seem. What you have here is a classic servo position system and the feedback circuits need to be just right to achieve a critically damped system (if that is what you want). Also you need to keep motor interference out of sensitive receiver electronics.

Would a PLC be better suited to this task?

No you still have the same problems no matter how you realise the final solution.

Grumpy_Mike:

it seems like it would be trivial to lock.

Things are seldom as easy as they seem. What you have here is a classic servo position system and the feedback circuits need to be just right to achieve a critically damped system (if that is what you want). Also you need to keep motor interference out of sensitive receiver electronics.

Why wouldn't you just seek the strongest signal with some smoothing and stop once you've arrived?

Thanks Mike. The antenna has a 10 or 15 degree pickup pattern, so the locking on doesn't need to be that precise. I would be more than happy if it just did a scan, and then pointed to the best signal. It wouldn't need to track continuously as both points will be stationary, and this would help eliminate jitter as well. This would eliminate the problem of the servo circuits interfering with the WLAN . I think I will start with using a simple servo pan system controlled with arrows on the computer, and once the hardware side of things is built I will start messing around with auto-scan.

Ultimately, I would like to have a small program with a simple GUI which has arrow controls to rotate the antenna and then an "auto-scan" button. The auto-scan button would record the relative signal strengths of each access point, and then determine the direction of highest signal. This information would be store as a servo position, and be mapped on a circular map which displays the SSID and signal strength. I think it would be easy enough to store information in sets i.e (ssid, servo position, signal strength) Then you could determine the best direction for a particular access point by searching for the best signal strength and then rotating the antenna to that specific servo position.

I am familiar with the use of kismet, I wonder what values Kismet reads to determing signal strength. If I could use similar information, it might simplify the process.

If you want to start on your project, substitute something like a photo resistor (looking for various light sources) for the wifi signal strength input so you can start building the hardware and control programming. The below might be of interest.

http://www.youtube.com/watch?v=AUzkiIB4QZ8

That greatly simplifies things. If you can afford a complete scan, record all the strengths you see and then go to the strongest, but it was not what you asked for at first.

Why wouldn't you just seek the strongest signal with some smoothing and stop once you've arrived?

Because you don't know what the strongest signal is until you have passed it and by then you have over shot it, so you then need to go back. If you want to do this as rapidly as possible then you have the motors inertia to cope with and you have to minimise the over shoot and make sure it doesn't over shoot on the way back. If it does it is called an under damped system. The other case is if it just creeps up to the position and stop, this is called an over damped system and is slow,

Grumpy_Mike: That greatly simplifies things. If you can afford a complete scan, record all the strengths you see and then go to the strongest, but it was not what you asked for at first.

Why wouldn't you just seek the strongest signal with some smoothing and stop once you've arrived?

Because you don't know what the strongest signal is until you have passed it and by then you have over shot it, so you then need to go back. If you want to do this as rapidly as possible then you have the motors inertia to cope with and you have to minimise the over shoot and make sure it doesn't over shoot on the way back. If it does it is called an under damped system. The other case is if it just creeps up to the position and stop, this is called an over damped system and is slow,

You're over complicating it. Remember the qualifiers I originally had which have now been confirmed. There's no need for anti-jitter or complex heuristics. Just seek the strongest signal. It doesn't need to be super fast since they are not moving. Granted, the speed of the servo needs to be accounted for, but they have a known degree/sec speed which makes estimation even better. I've basically done this on an android phone. Its not hard.

You have an android antenna rotator? I would be very interested in seeing a little movie or something :)

timduino: You have an android antenna rotator? I would be very interested in seeing a little movie or something :)

Ya, its' called me. :P But that's what I meant by "basically." The difference is the RSSI signal on the device is fairly slow so you still get human jitter. The difference is, you only need to be close not exact and once you've found it within a couple of degrees on the servos (whatever threshold makes sense based on the distance), assuming progressively slowed seek on the servo, it should be good enough. Unless you're trying to do WIFI over extremely long distances, it should be good enough.

If you look on the market, you'll find an app where someone did the same thing. You use your body to interfere and rotate. It provides a fairly good picture of where the AP is at. Both implementations were within a few degrees with very little jitter on my part and none on the app on the market.

Basically, so long as close enough is good enough, things are simple. When you start trying to balance a broom stick, then things get complex.

gerg:

Basically, so long as close enough is good enough, things are simple. When you start trying to balance a broom stick, then things get complex.

[/quote]

Close enough is good enough. I am not tracking a UAV or anything :D

Tim

For $5 and free shipping, you might look at hacking the below for your project.

http://cgi.ebay.com/WIFI-Signal-Hot-Spot-Finder-NEW-/130471947325?pt=LH_DefaultDomain_0&hash=item1e60bbec3d

http://cgi.ebay.com/Wifi-Detector-Wi-Fi-Hot-Spot-Finder-Wireless-Locator-W-/260288410509?pt=LH_DefaultDomain_0&hash=item3c9a65f38d

zoomkat:
For $5 and free shipping, you might look at hacking the below for your project.

http://cgi.ebay.com/WIFI-Signal-Hot-Spot-Finder-NEW-/130471947325?pt=LH_DefaultDomain_0&hash=item1e60bbec3d

http://cgi.ebay.com/Wifi-Detector-Wi-Fi-Hot-Spot-Finder-Wireless-Locator-W-/260288410509?pt=LH_DefaultDomain_0&hash=item3c9a65f38d

T
Thanks for the idea, I think it would be easiest just to read the signal strength from the wifi-card antenna though. Those little devices are neato, I might grab one anyways :slight_smile:

I just caught on you're using a stepper, not a servo.

timduino: Close enough is good enough. I am not tracking a UAV or anything :D

Tim

That's what I figured. This is my suggestion off the cuff.

As you have a 10'-15' accuracy, that will be the basis for your threshold. You might want to consider half that. If so, that's a 5'-7' window. So find the strongest signal with that threshold and stop. Again, since speed isn't a requirement, I'd probably do a full rotation for a sweep, recording signal to stepper position. Smooth the signal a little and the look for edges - not peaks. Well, look for edge, peak, edge, so you know when you found the two corresponding edges. The two edges will be your focus. This will become complicated if there are multiple sources within your threshold and IMOHO, becomes the most difficult part of the solution. If that is the case, we're wondering into signal processing territory, unless you just want to blindly look for peaks and make assumptions.

Now seek back to your first edge and slowly start sweeping back toward your other edge. Slow as signal rises. Again, record signal and position. Smooth signal. Based on your gear ratios, you should know the degree of a step. Calculate the degrees from edge to peak. Start walking back toward the peak until you find peak signal and you're within your landing zone of 5'-7's. Stop. You're done. That should be in the "good enough" ball park.

Now repeat for each additional edge, peak, edge detected in your original sweep.

Obviously it can be refined some more over time but that should get you into the close enough range. The important part is to know the steps per degree and to understand what type of signal you're looking for and why type of compromises you're willing to find in your good enough solution. Remember, a really strong signal could be two AP's inline from your POV or two AP adjacent to each other - so on and so on . Automatically discerning that can become a DSP problem.

Something else to keep in mind, I have no idea what type of precision you'll get out of your signal source. You may need to further tweak some based on the speed of delta and precision of signal measurement.