0
votes

I'm trying to get accurate location with the help of 3 or more iBeacons. There are two steps

  1. Getting accurate distance from iBeacon's RSSI.
  2. Applying Trilateration algorithm to calculate the location.

For now i'm not getting the precise distance. iOS "Accuracy" is not truly distance. I'm applying different formulas to calculate distance but i'm unable to find precise distances. Till now I'm able to get precise distance up to 10 meters, but i need distances for like 20 meters at least.

(I'm using default txPower of iBeacon witch is -59 dbm and I've measured power of C3 and using Broadcast interval of 300ms.

Any help would be highly appreciated. Thanks!

2

2 Answers

0
votes

Unfortunately, it is really not possible to get very accurate distance estimates over 10 meters. The problem is that the signal gets relatively weak at that distance and the noise overwhelms the RSSI measurement -- at least for quick responses. The signal to noise ratio, as it is known, is a general problem in all radio applications. For Bluetooth LE applications, you either have to accept inaccurate distance estimates at greater distances, or average the RSSI samples over a very long period to help filter out the noise.

0
votes

Once you get your distance you could use the following code sample to find the co-ordinates of the trilaterated point

 {
   //Declarations 
   //include the math.h header file

   double xa=0, ya=0;       //Co-ordinates of 1st ACCESS Point(preferably set as origin)
   double xb=10,yb=0;       //Co-ordinates of 2nd ACCESS Point
   double xc=5,yc=10;       //Co-ordinates of 3rd ACCESS Point
   double triPt[2]={0,0};   //Trilaterated point
   double p1[2]={xa,ya};
   double p2[2]={xb,yb};
   double p3[2]={xc,yc};
   double ex[2],ey[2],ez[2];
   double i=0,k=0,x=0,y=0;
   double distA=5*1.41;    //Distance from API 1 (Measured using RSSI values)  
   double distB=5*1.41;    //"""""             2
   double distC=5;         //"""""             3

   //Transforms to find circles around the three access points
   //Here it is assumed that all access points and the trilaterated point are in the same plane 

   for(int j=0;j<2;j++)
      {
       ex[j]=p2[j]-p1[j];
      }
   double d=sqrt(pow(ex[0],2)+pow(ex[1],2));
   for(int j=0;j<2;j++)
      {
       ex[j]=ex[j]/(sqrt(pow(ex[0],2)+pow(ex[1],2)));
      }
   for(int j=0;j<2;j++)
      {
       i=i+(p3[j]-p1[j])*ex[j];
      }
   for(int j=0;j<2;j++)
      {
       ey[j]=p3[j]-p1[j]-i*ex[j];
      }
   for(int j=0;j<2;j++)
      {
       ey[j]=ey[j]/(sqrt(pow(ey[0],2)+pow(ey[1],2)));
      }
   for(int j=0;j<2;j++)
      {
       k=k+(ey[j]*(p3[j]-p1[j]));
      }
   x=(pow(distA,2)-pow(distB,2)+pow(d,2))/(2*d);
   y=((pow(distA,2)-pow(distC,2)+pow(i,2)+pow(k,2))/(2*k))-((i/k)*x);

   //Calculating the co-ordinates of the point to be trilaterated

   for(int j=0;j<3;j++)
      {
       triPt[j]=p1[j]+x*ex[j]+y*ey[j];
      }

   //Print the values

    cout<<triPt[0]<<endl<<triPt[1];
    getch();
    return 0;
 }