Author Topic: Approximate distance from RF  (Read 7059 times)

0 Members and 1 Guest are viewing this topic.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Approximate distance from RF
« on: November 25, 2008, 09:57:44 AM »
How can I approximate the distance between an RF receiver and its transmitter? Keep in mind I want to have some method of encoding as well. I only need distance not direction.

Would I have the transmitter send a packet and then have the RF receiver adjust its gain until it gets the correct packet , and based on that gain I get an estimated distance.

Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline ArcMan

  • Supreme Robot
  • *****
  • Posts: 519
  • Helpful? 4
  • Mmmm... Plasma
Re: Approximate distance from RF
« Reply #1 on: November 25, 2008, 12:33:33 PM »
I have thought about this as part of a triangulation experiment, but haven't done anything yet.

My plan is to have the RF transmitter transmit a message to the transponder where the RF receiver is mounted.  The transponder will then pulse an ultrasonic signal back to the RF transmitter.  The round trip signal time will then be measured.  It will be an easily measurable quantity by a microcontroller since there is a "slow" component - the ultrasonic signal.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #2 on: November 25, 2008, 01:02:51 PM »
I don't want to use sounds I want to use only RF
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline ArcMan

  • Supreme Robot
  • *****
  • Posts: 519
  • Helpful? 4
  • Mmmm... Plasma
Re: Approximate distance from RF
« Reply #3 on: November 25, 2008, 02:33:02 PM »
OK.  Can't help you there.  Nanosecond accuracy time-to-travel measurement is out of my league.  I know it can be done, though.  I'm using some $5,000 LASER time-to-travel scanning sensors for a project at work.

Offline szhang

  • Robot Overlord
  • ****
  • Posts: 140
  • Helpful? 1
Re: Approximate distance from RF
« Reply #4 on: November 25, 2008, 04:25:06 PM »
How can I approximate the distance between an RF receiver and its transmitter? Keep in mind I want to have some method of encoding as well. I only need distance not direction.

Would I have the transmitter send a packet and then have the RF receiver adjust its gain until it gets the correct packet , and based on that gain I get an estimated distance.



That method is completely dependent on noise.  The only way to do RF rangefinding is do time of flight, and there is a reason why time of flight rangefinders are so expensive.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #5 on: November 25, 2008, 05:11:16 PM »
The only way to do RF rangefinding is do time of flight, and there is a reason why time of flight rangefinders are so expensive.


Then how do these things work :http://woodenhorsetoys.com/cgi-bin/item/969-70108/12000/Wild-Planet--Wild-Planet-Agent-Tracker&usg=__oE7dtEejxN6-VI8ZWk55ZvdxcaM= ?


There are a series of LEDs on the receiver that light up as you get closer to the transmitter. As you close in on the transmitter more LEDs light up.
« Last Edit: November 25, 2008, 05:13:31 PM by airman00 »
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline szhang

  • Robot Overlord
  • ****
  • Posts: 140
  • Helpful? 1
Re: Approximate distance from RF
« Reply #6 on: November 25, 2008, 06:34:49 PM »
If you don't care about what the actually distance, just a measure of "far" vs "near" then I guess your method works okay.  Though it still will give you different readings depending on noise.

Also, the toy can only track moving objects, in that case you can do inferometry, though I think inferometry gives you velocity not position.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Approximate distance from RF
« Reply #7 on: November 25, 2008, 06:48:00 PM »
as has already been mentioned, the time of flight of radio waves would be very expensive to measure at short ranges.
radar works because the distances are large and the transmitted radio signal traveling at the speed of light out to an object and back is measurable because the distances are so large.
not really possible down your hallway when you are using an AVR to time the delay.

Quote
Then how do these things work :
haven't we had this discussion before in another thread?
they measure signal strength. probably combined with a directional antenna to give some direction element.
while this will give you an idea if you are moving closer to an object or not they will give you a very inaccurate reading of range.
likewise with the directional antenna, reflections and refractions from furniture walls and the robot it's self will mean it's always kind of random.

it would be theoretically possible to map the RF signal strength for all points in your room but i think it would change a little depending on your bot's orientation as well as changing every time you or a piece of furniture moved.

i read once in a paper on robot localisation about a bot that looked at the relative signal strength of the different wifi access points in a building to give it some indication where in a building it was but i think it was only used as a backup sensor.
it could only give any accuracy to within tens of meters meaning it was fine for confirming the bot is in the right room but no good for finding the beer fridge.

don't take my word for it though.
while i have never read about a successful way of doing this and everything i know about RF theory says it will not give great accuracy, try taking some analog readings from your RF module's signal strength pin.

something to bear in mind if you are experimenting,
high frequencies don't refract much and don't pass through objects very well so if the path to the transmitter is blocked you are most likely to see a reflected signal.
low frequencies pass through obstacles better but also refract round corners so you would get better range data but worse directional data.


dunk.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #8 on: November 25, 2008, 07:42:28 PM »
thanks for the reply dunk.
I think I'll order one of those toys and take it apart and see how it all works.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #9 on: November 27, 2008, 10:21:30 AM »
I'm too impatient to wait until the toy gets delivered to me .
Is there some other method of distance approximation using RF , that I can try out with parts I have at home ( like the Sparkfun RF modules)

By the way I found out that the tracking toy uses 262khz, if that matters at all.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Approximate distance from RF
« Reply #10 on: November 27, 2008, 04:07:05 PM »
Hi,

Those "Keep-Your-Luggage" gizmos all works by relative field strength, usually by measuring the AGC-voltage.
They can not be used for anything remotely precise, unless they are allways used in the same spot under the same atmospheric conditions.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #11 on: November 27, 2008, 05:13:24 PM »
Those "Keep-Your-Luggage" gizmos all works by relative field strength, usually by measuring the AGC-voltage.

How can I get the AGC voltage from this module - http://www.sparkfun.com/commerce/product_info.php?products_id=8948
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Approximate distance from RF
« Reply #12 on: November 27, 2008, 08:01:13 PM »
Those "Keep-Your-Luggage" gizmos all works by relative field strength, usually by measuring the AGC-voltage.

How can I get the AGC voltage from this module - http://www.sparkfun.com/commerce/product_info.php?products_id=8948

Hard to say without either a detailed schematic or a module.
I doubt that the schematic is available to the public and since I don't have one of those modules, it seems that you have to do your own work this time, poking a 'scope probe around it's innards to see if you can find something useable.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #13 on: November 27, 2008, 08:10:21 PM »
So I would do the method I said in my first post , right?
 
Would I have the transmitter send a packet and then have the RF receiver adjust its gain until it gets the correct packet , and based on that gain I get an estimated distance

Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Approximate distance from RF
« Reply #14 on: November 28, 2008, 03:55:18 AM »
Quote
So I would do the method I said in my first post , right?
sure. it might work. try it.
alternatively if you cannot adjust your module's gain just count the % of successful transmissions at a set power level.

you would be better looking for a module with a signal strength output pin on the RX module.
they do exist but you may have to spend more on your module.


dunk.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #15 on: November 28, 2008, 09:52:46 AM »
alternatively if you cannot adjust your module's gain just count the % of successful transmissions at a set power level.
Is there some linear equation or some relationship between number of successful packets and approximate distance?


Quote
you would be better looking for a module with a signal strength output pin on the RX module.
Can you provide me with a link and an approximate price? Can I modify the Sparkfun RF module to provide a signal strength output pin?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #16 on: December 01, 2008, 08:28:06 AM »
I want to get an approximate distance between an RF transmitter and RF receiver .

Which one of the following methods would work :
1. Count how many successful RF transmissions are received per second - that means there is a linear relationship between successful transmission and distance.
2. Adjust the auto-gain of the RF receiver until you get correct RF transmissions - means there is a linear relationship between gain value and distance
3. Somehow get a signal strength output pin on the RF module - any one know which RF module can do that?

Is there a better way to do it?
And also can someone verify those methods above

P.S. Its kind of urgent that I get this question answered by the end of today
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Approximate distance from RF
« Reply #17 on: December 01, 2008, 09:57:42 AM »
Quote
Is there some linear equation or some relationship between number of successful packets and approximate distance?

short answer: no.
while on average readings will get better the closer you get to the transmitter it will not be a completely linear process.
as already discussed all the methods discussed here will be very inaccurate and will be prone to errors caused by RF interference, reflection and refraction of RF signal, atmospheric conditions, etc.
taking the readings over a long time period will help average out variance caused by RF interference but not the other factors.

Quote
Can you provide me with a link and an approximate price? Can I modify the Sparkfun RF module to provide a signal strength output pin?

i don't have time to do your reserch for you today i'm afraid. just keep digging through datasheets. you'll find one eventually.
this one does: http://www.lprs.co.uk/product_info.php?cPath=21&products_id=54
i'm not recommending it in particular as it's quite expensive but it gives you an idea what you are looking for.

as for modifying your modules, it depends on the module.  you would need access to the raw radio output.
your on your own here unless you are lucky enough to find someone who has done the same thing to the same kind of module.

Quote
Which one of the following methods would work :
1. Count how many successful RF transmissions are received per second - that means there is a linear relationship between successful transmission and distance.
2. Adjust the auto-gain of the RF receiver until you get correct RF transmissions - means there is a linear relationship between gain value and distance
3. Somehow get a signal strength output pin on the RF module - any one know which RF module can do that?

all of them may work to some very limited extent but none of them will work well.
if i had to guess which is going to be the best i would say 3 then 2 then 1.
the only way you will know for sure is to try them.

Quote
Is there a better way to do it?

if you mean a better way to get range information from a single RF TX/RX pair then no.
there is no good way to do this. that is why you only find this system used in a very few cheap toys which don't need any accuracy.

Quote
P.S. Its kind of urgent that I get this question answered by the end of today

i'm afraid you are going to have to experiment for yourself. nobody else does it this way.
there is nothing to stop you trying 1 from your list above now.

sorry to be negative but it's my opinion what you are pursuing will not give you enough precision to be useful.

if you definitely want to pursue RF localisation then you might be better building directional antennas. have more than one transmitting beacon and scan for them using a directional antenna on a servo.
this way you will get directional information rather than range information allowing you to work out range by triangulating.
this method won't be very accurate either. reflections would be a big issue and you will still need to be able to see the signal strength to tell which is a reflection and which is the source.

anyway, good luck.
and

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Approximate distance from RF
« Reply #18 on: December 01, 2008, 10:39:39 PM »
In addition to what dunk said . . .

airman00, I know your particular application doesn't involve a robot and must have only 2 points (xmit and receive) . . . but for the case of a robot read on . . .

GPS improves accuracy by adding additional transmitters throughout the space . . . often you have 4 or 5+ transmitters for triangulation . . . the point I am trying to make is that the signal strength to location mapping can be improved by adding multiple transmitters at different frequencies/packet ID's. Then throw in a Kalman filter to average out the differing solutions :P

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #19 on: December 02, 2008, 07:17:06 AM »
@dunk 
thank you for the reply, I think I understand it better
My problem is that I cannot find any module that provides me with signal strength

 Google yielded these results :
http://www.zen22142.zen.co.uk/Circuits/rf/sfsm.htm
http://www.electro-tech-online.com/electronic-projects/58-simple-field-strength-meter.html
It seems like I can change around the inductor and capacitor setting for my application.

My only problem is that I need to detect distance away AND encode the signal so I can use multiple channels on the same frequency - would I just use a regular receiver module connected to a microcontroller and the RF signal strength circuit?

Also if anyone can find better information on reading approximate RF signal strength I would appreciate it tremendously.
EDIT : I would prefer using 315mhz (since I have those receivers anyways)
« Last Edit: December 02, 2008, 07:20:28 AM by airman00 »
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline hudbrog

  • Jr. Member
  • **
  • Posts: 40
  • Helpful? 0
Re: Approximate distance from RF
« Reply #20 on: December 02, 2008, 07:38:58 AM »
All rf transceivers I used had RSSI measurement. Atmel has it as analogue output, TI and Nordic as digital (I might be wrong). RSSI is Received Signal Strength Indication. You could aproximate the distance between two points if they both have omnidirectional antennas and has predefined settings for signal gain.
But any way, even in those almost perfect conditions there is no linear equation. You can pre-map each RSSI level range for specific distance. But anyway you'll get +-5m or even more. Works for basic distance approximation and damn easy to implement.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Approximate distance from RF
« Reply #21 on: December 02, 2008, 09:32:30 AM »
Quote
My problem is that I cannot find any module that provides me with signal strength

did you look at the datasheet for the module i linked to?
pin 3 on the RX: "Received Signal Strength Indication - Analogue".

i just had a dig around on DigiKey for you and it turns out most cheep RF modules do not have RSSI pins.
the more expensive ones are more likely to.
and most of the transceivers do. (transceiver = 2 way RF module.)
so it looks like you are out of luck for getting a simple annalouge power reading unless you are willing to throw more money at it...

Quote
Google yielded these results :
http://www.zen22142.zen.co.uk/Circuits/rf/sfsm.htm
http://www.electro-tech-online.com/electronic-projects/58-simple-field-strength-meter.html
It seems like I can change around the inductor and capacitor setting for my application.

heh, building your own RF tuners would be one way to do it but it it is a bit of a black art.
it would be possible but out of my field of expertise.
you might want to consider spending a few months lurking on some ham radio forums to pick up pointers.


in other news, last night i had a play around with the 2.4GHz modules i am using in my UAV project.
moving a receiving station round my house the reception was very non-linear.
for example i found one spot 2 rooms away from the transmitter with around 5% power level. 10 cm away in any direction i had 85% power level.

that was at 2.4GHz though.
things would probably be less polar at 315MHz.


remember when you were asking about the 2 Data pins on the RX module? how did that work out? are they just connected together like the datasheet suggests? (measuring the resistance between them would give you some indication.)
if they are not directly connected, get your multimeter and test the voltage on that pin as you move away from your transmitter. you might be lucky and it may be a signal test point. or better still a RSSI pin....

if i were you here is how i would proceed with your current modules:
it would be easy to test for successful packet transmissions. (idea 1 on your list.)
write a program that sends a packet every few ms.
in the packet have a long int which increases by one with every packet sent.
on the receiver subtract the value contained in the previous packet from the newly received one.
this will tell you how many missed packets there have been since the last successful one.
move it round the room and see what happens.


something else that comes to mind, with the RF modules i am using just now i actually get worse transmission results at very short ranges than at around 10meters.
my RSSI is high at close range but there is data corruption due to the RX module being flooded by too high a signal level.
this may or may not be an issue for you as my RF modules are quite high power.

anyway,
got to get back to work.


dunk.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #22 on: December 02, 2008, 03:02:41 PM »
thanks dunk
The linear output is not an RSSI and the people at Sparkfun verified that the receiver has no RSSI. I'm trying to get schematic of the receiver as we speak.


I'll do those tests I spoke about soon and I appreciate you doing your tests for me.
I don't want to look around for another receiver just yet. The guys over at Sparkfun suggested the following:
Quote
The only thing I could think of is to design a circuit at the antenna pins to read the signal strength, but I really do not have any details on that.

Any ideas on what kind of circuit that would be?

I *think* it would be a circuit like this : http://www.qsl.net/nz0i/projects/fsm/fsm.html
(obviously I can take out the parts that create a sound)
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Approximate distance from RF
« Reply #23 on: December 03, 2008, 05:18:08 AM »
Quote
Any ideas on what kind of circuit that would be?|
a tuning circuit made from an inductor and capacitor like the one in your link should do it.
i can't be much more help than that though.
you are going to have some reading to do on radio theory...

anyone suggest any good links for picking capacitor and inductor values for tuning circuits?


dunk.

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,207
  • Helpful? 15
  • 1.6L Peugeot 307 tuner
Re: Approximate distance from RF
« Reply #24 on: December 09, 2008, 08:49:35 AM »
For whom the interrupts toll...


P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

Cheers!

Offline fuzzyt

  • Jr. Member
  • **
  • Posts: 34
  • Helpful? 0
Re: Approximate distance from RF
« Reply #25 on: December 10, 2008, 01:56:43 PM »
When I was building and FM transmitter, the formulas here were a great help.  Most of the time I hand made the inductor from coiled wire and used a fixed capacitor.  I was semi successful in the project.

http://en.wikipedia.org/wiki/LC_circuit

Here is a link to building your own inductors.  I'm not a math person, so it was a little daunting for me at first, but I managed in the end.

http://www.arrl.org/tis/info/pdf/9708033.pdf

Best of luck!

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #26 on: December 24, 2008, 08:44:03 AM »
I thought of a nice method to approximating distance using RF

You have one RF transmitter connected to a microcontroller. The RF transmitter has a pin for powering it- the higher voltage you put on the pin the stronger the RF signal output is. That means the more voltage you put in , the farther the RF signal can travel. Now what I was thinking of doing is have the microcontroller be able to set the voltage for the RF transmitter. Then the transmitter would use this pseudo code

Set voltage on transmitter to 12V ( the maximum voltage)
Send Byte12
Set voltage to 9V
Send Byte9
Set voltage to 6V
Send Byte6
Set Voltage to 3
Send Byte3
Set Voltage to 1.5
SendByte1
and loop that


then the receiver merely checks to see which bytes it receives. So if it receives Byte1 ( send by voltage 1.5V ) that means the transmitter is very close, if it ONLY receives Byte12( sent at maximum voltage, 12V) then the transmitter is very far from the receiver.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline kd5kfl

  • Full Member
  • ***
  • Posts: 72
  • Helpful? 1
Re: Approximate distance from RF
« Reply #27 on: December 24, 2008, 05:22:47 PM »
Radio travels at the speed of light. Light travels 1 mile in 6.17 microseconds. Thats 855.75 feet per microsecond. Which is 10.269 inches per nanosecond.

You're going to need a very accurate stopwatch and quick reflexes.



Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #28 on: December 24, 2008, 06:42:25 PM »
You don't understand my idea . I do not want to time the amount of time between bytes, I want to see if I get the bytes at all. At each voltage setting an entirely different byte is sent. Then I just check to see which bytes I get. If I only receive the byte that is sent at high power I know that it is the farthest away.

also I'm not looking for incredible resolution. I hope to get maybe +-25 feet resolution
« Last Edit: December 24, 2008, 07:12:45 PM by airman00 »
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Approximate distance from RF
« Reply #29 on: December 24, 2008, 07:22:11 PM »
Attached is a diagram of what I mean
So if you look on the left side of the picture you'll see what bytes are being transmitted at what voltage. That means that in the Orange zone the receiver would receive the bytes from 3V, 6V, 9V, 12V. But in the blue zone the only byte that would be received is the byte sent at 12V ( which is byte 0x12)

In the picture obviously the transmitter is located in the center of the circle.
« Last Edit: December 25, 2008, 06:40:15 PM by airman00 »
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

 


Get Your Ad Here