Re: Arduino - Xbee - RSSI - Distance Measurement

4,064 views
Skip to first unread message

Mattia Fiorini

unread,
Oct 22, 2012, 4:59:27 PM10/22/12
to xbee...@googlegroups.com
Hy Ardan,

I'm a newbie in arduino & xbee project too, but your idea seems not too good...
Because the relation between RSSI (which is a measure of strength of radio signal between two radios) and the phisical distance between the radios is not ax exact relation, many other variables are involved in determining the quality of radio link (and so also the RSSI value). Moreover the RSSI change by moving of some [mm] the two radios is uncommensurable, it's many order of magnitude fewer that the white noise, so you can't measure it.

I suggest you to look for some ultrasonic distance sensor capable, with arduino, to measure distance from [cm] to [m] deoending on model... and with arduino, xbee and an ultrasonic distance sensor you can measure distance also wifi... :)

I hope these suggestions will be useful for you,

Best,

Mattia 

2012/10/22 ardan <dan...@gmail.com>
Hi all,
I am very beginer in both arduino and xbee. I do some project to measuring distance using rssi feature from xbee. Is anyone have experience on this? Actually i already got the rssi by reading from arduino, but i have no idea how to calculate the rssi to get the distance (in meters or mm). Have you any solution? Your help will be very helpfull for me. Sorry, my english is not good enough.. :)
Thanks in advance..

ardan,

--
You received this message because you are subscribed to the Google Groups "xbee-api" group.
To view this discussion on the web visit https://groups.google.com/d/msg/xbee-api/-/f724bp8WiKgJ.
To post to this group, send email to xbee...@googlegroups.com.
To unsubscribe from this group, send email to xbee-api+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xbee-api?hl=en.



--
Ing. Mattia Fiorini
Environmental Engineer
Natural and Industrial risk management
Ph.D. student @ CIMA Research Foundation
www.cimafoundation.org
+39 347 4752373
mattia....@gmail.com
mattia....@cimafoundation.org

ardan

unread,
Oct 22, 2012, 6:28:54 PM10/22/12
to xbee...@googlegroups.com
Hi Mattia,

Thanks for your suggestions. Actually i felt pessimist when i look at the RSSI value and it's continously changing even both my xbees not moving. So it seems not accurate, isn't it? But before i try another solution, i mean before change the device using ultrasonic or the other, i still curious how to calculate the RSSI become distance between two radios even it's not accurate. Can you give me some help? :(

Thanks,
Ardan

Alex Mendez

unread,
Oct 23, 2012, 7:32:54 AM10/23/12
to xbee...@googlegroups.com
Hi,

You can't do that because the signal you recieve from one module that is 10 meters away might be the same that one which is 2 meters away but behind a wall. You can't not get an accurate relation because you are ignoring factors like noise in the system from other RF emitions, obstacles,etc.

You might be able to get something more close to the real distance if you had many recievers and know their position and getting the signal from the node that you wan't to know but even like that you would get a poor aproximation. That would be something like triangulation. 


Anyway, don't even waste time going that way....


Later!

ardan

unread,
Oct 23, 2012, 1:18:40 PM10/23/12
to xbee...@googlegroups.com
Hi Alex,

Thanks for spend time and thought on this. As you said in the last, yes, i do triangulation in this case. I used 4 xbee in a room not more than 10m x 10m, 3 fix in position and 1 as traceable. So, what i had done is having rssi from tracable xbee. Next step, i will do :

1. Plot the rssi measurement in array / excel / i dunno still have no idea for better serial data logging. Any idea? (at least i can do serial data logging for any works later)
2. Because i do it in small room with no any obstacles, i'll try measure the distance based on rssi.

OK, just ignore point 2 then. I will focused for the first, where i still dont understand how to plot real time serial data from uart/usb/rs232 in an array or excel or saving in the database for monitoring the serial data value. so we can do post processing then.. I hope someone can help me.. :(

Almost forget, i use Visual Studio 2010 and C++. If we can do in another programming languages, please let me know! I will learn it too..
Thanks in advance Masters..

regards,
ardan

Mauricio Bustos

unread,
Oct 23, 2012, 8:20:35 PM10/23/12
to xbee...@googlegroups.com
Hi Ardan,

I wouldn't quite give up on distance measurement using RSSI.  A question to answer for yourself is how accurate you need to be.  If the configuration of the radio (housing, obstacles, motion etc.) is controlled, I would recommend coming up with some empirical observations and then fitting a signal loss model.  The moving RSSI observations could be smoothed out and the fact that you have multiple fixed points helps tremendously.  I use RSSI for crude distance measuring and have been pleased with the results (I'm not requiring precision however, just gross relative positioning for a few radios).

Set up your XBees to heartbeat and then record those observations.  See what you get and how stable the model is.

Good luck,
mauricio

To view this discussion on the web visit https://groups.google.com/d/msg/xbee-api/-/QtVitnEEBjIJ.

Alex Mendez

unread,
Oct 24, 2012, 3:45:20 AM10/24/12
to xbee...@googlegroups.com
Hi,

if you have setup 5 of them in known positions you might get some useful data as Mauricio points out. What I'd suggest is that you take several measures of every RSSI reading which would make it more reliable, the more you take, the more reliable it is. 

To plot it would depend on what you are using. But the easiest way I think would be trying to log the data with Bray's terminal or I would make a program with whatever you prefer, C++ , Java , Python... and recieve the serial data and with that make a CSV file with your data and then import the file to excel which will make it really easy to plot. 

You could also make easily a program with Processing that would plot your data in real time. 

Those are the easiest ways I come up with right now.

Good luck!

ardan

unread,
Nov 2, 2012, 6:16:56 PM11/2/12
to xbee...@googlegroups.com
Thanks Mauricio n Alex..

Since i said i am newbe using xbee, i got my hard work this week.. and i face the new problem, how to measure (packet data) transfer time travel..? i have been looking for some sample code but i got nothing.. do i need additional RTC? or i can use internal timer of arduino? anyone have sample code for me? i'm feeling stuck in this way.. omg :(
sorry for bothering all of you, but your help will very usefull for me doing this and i really appreciate it..

regards,
ardan
Message has been deleted

Franck Mathieu

unread,
Oct 11, 2013, 5:53:22 PM10/11/13
to xbee...@googlegroups.com
Hi Guys,

your project is really interesting... I have a small question for you. do you have any idea how to use a small emitter (in a cat's collar) ? how to connect it to be able to find it with an arduino one ?

regards,

Franck

John Flicker

unread,
Nov 20, 2013, 4:59:56 PM11/20/13
to xbee...@googlegroups.com
The problem using RSSI to measure distance is that there a too many factors affecting signal strength. Too really delve into this you would need to know some electro magnetic field theory. Standing next to the receiver will change its strength--you are really a salty bag of conductivity. 2,4 GHz wave is about 10cm in length so it doesn't have great penetration through multiple walls and such. Each material it passes through reflects in different ways. That said, what you can do is plan for worst case scenarios for where you want to place the sensor by building a fade margin into your design. For instance, you lose the signal at 80 rssi consistently at location x. You usually want a fade margin of 20-25 dbm. So ensure the placement of your transceivers are operating at 60 rssi. Lot more to it as you might imagine....

zulfik

unread,
Dec 25, 2013, 3:44:54 AM12/25/13
to xbee...@googlegroups.com
Hi Ardan,

I realize it has been a while since the original post but I am trying to implement RSSI based positioning using xbee radios.
My main problem is how to measure RSSI values from more than one router each time since the moving xbee is connected to one router at a time.

Can you post some information about your configuration and solutions?

Thanks a lot.

Monsur Harun

unread,
Mar 24, 2014, 1:46:27 PM3/24/14
to xbee...@googlegroups.com
Can you please explain how you setup the XBee's and what arduino code you used when receiving RSSI data, i have connected up the hardware and am familiar that I need to use API mode 2 but am having trouble implementing it.

Please help.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages