View Full Version : direction finding problem
01-17-2007, 11:32 PM
I'm developing an application which involves significant wireless communications between two stamp-based devices. I'd like to add a feature through which a user can use one of the devices to find the other. Since I already have RF tranceivers in both devices I thought using RSSI data would work, but that has turned out to be a bust, and I'm now looking for other solutions. Does anyone have any experience with making stamp-based direction finders? Would an IR transmitter on one end and an IR receiver on the other work, for example? For reference, the device I want to be able to find has a BS-2 in it, and the other device is bs-2p40 with 6 spare pins. Also, the 2p40 is in a handheld device, so waving it around to get a bead on where the other device is is perfectly acceptable. I'd like about 20 feet of operating range for this function, though more would be nice.
Thanks in advance,
01-17-2007, 11:51 PM
Are these devices going to be in an open space or might they be hidden behind walls or doors? The simplest setup would be an IR beacon on one device (running all the time off a 555 timer) and an IR detector on the handheld with a limited view (through an IR opaque tube). When the detector is triggered, it's pointing at the beacon. If the room has a lot of IR reflectivity, you may have problems with excess sensitivity. A little more sophisticated system would have the beacon produced by the Stamp so the frequency can be adjusted. The handheld would request the other Stamp (via RF) to produce a beacon at a specific frequency. The detectors are less sensitive off center frequency, so, if there's too much reflectivity in the room, a different beacon frequency could help localization as the handheld is waved around.
01-18-2007, 12:10 AM
Thanks for the reply. We can assume a relatively open space for this function. Also, what you suggested about having the handheld send a request to the beacon to activate is right on the money. Most of the code for that subsystem is already written (for the failed attempts at using RSSI and an A/D converter). I'm completely unversed in IR communications basics, however, and I don't know anything about what sort of input I can get to the stamp. Do I use the IR receiver as a variable resistor that I read with RCTime, or do I simply get a "you've got the beacon"/"you don't have the beacon" sort of input? Optimally I'd like the beacon to help the user to find it, and the RF version converted RSSI data into an audible tone that changed pitch with signal strength. It worked great except that signal strength hopped around too unreliably based on body position and other uncontrollable factors. If a simple (and cheap) IR-based system could be made to work similarly, that would be an optimal solution.
01-18-2007, 12:23 AM
There's a lot of stuff on IR distance sensing in the Robotics tutorial on the Parallax website (www.parallax.com/dl/docs/books/edu/RoboticsV2_2.pdf (http://www.parallax.com/dl/docs/books/edu/RoboticsV2_2.pdf)). Basically, one device generates a modulated IR signal for a period of time (at around 40KHz) and the IR detectors respond to a modulated IR source with an On/Off signal. The response of the detector varies with frequency, so that provides for a "sensitivity control". To do the direction finding with RF, you really have to have a sharply directional antenna.
01-18-2007, 12:47 AM
There wasn't room in the device for appropriate antennae, and even when I gave the system the best available antennae the results were inconsistent and disappointing. I've just gone and dug up my old boe-bot book, and hopefully it will give me enough to work with.
Oh, do you have any suggestions on IR emitters and detectors? I think I have one or two of each in my 'random' bin, but after that I'll need to make another (sigh) order to digikey. It looks like parallax no longer supplies ir components.
Thanks again Mike,
01-18-2007, 01:07 AM
Parallax still sells IR emitters and detectors in their "Component Shop" (www.parallax.com/html_pages/products/componentshop/optoelectronics.asp (http://www.parallax.com/html_pages/products/componentshop/optoelectronics.asp)).
01-18-2007, 01:27 AM
Excellent. Thanks again, Mike. I'm going through the code snippets now, and its starting to look like this is going to be both easy and cheap. I really, really, really appreciate all the help.
01-18-2007, 01:35 AM
Hi Michael, if its line of sight maybe using something similar to ships navigation may work. You place two detectors one behind the other. The beacon (transmitter) is detected by the front reciever but not the back when all three are lined up. So the device with the recievers rotates left and right until the one (front)Ěreciever is satisfied and the back one is excluded. If the angle of light was restricted to the rear reciever one sweep left and right then you should be able to calculate the angle at the centre (all three in line).
01-18-2007, 01:42 AM
Thanks for the suggestion -- in fact I was thinking about using 2 detectors with a ~10 degree overlap in coverage. Pick up one and you'll know the beacon is left, pick up the other and the beacon is to the right, and if you pick up both you're pointed approximately at the beacon (which is all the accuracy I need). I think another weekend's worth of experimentation is probably going to be required to get it right though.
A divider between the detectors may help reduce the angular range that triggers both detectors, and also shield from non-beacon interference. It makes the "pointing directly at the beacon" angle more accurate.
Below is my working sketch for a beacon detector I constructed -- it's a bit cryptic, but the dashed lines show the two IR detectors and divider rotating about on the 'bot's main axis, and when the "shadow" from divider falls across a detector. In this case a little less than 6degrees.
Here's a site where a gentleman did something very similar (physically, anyway): www.schursastrophotography.com/robotics/beac1.html (http://www.schursastrophotography.com/robotics/beac1.html).
When the going gets weird, the weird turn pro. -- HST
01-18-2007, 06:45 AM
Is this something that would be of use? http://www.pololu.com/products/pololu/0001/ (http://www.pololu.com/products/pololu/0001/)