0

I am trying to get as close height in meters as possible from atmospheric pressure sensor on android device. I am using https://openweathermap.org to get current pressure at sea level on my location and also temperature. Its much closer if i am not using standard pressure and sea level and temperature 15 but not the best. I am getting pressure from that api without decimals which affects the result quite a bit. Now I am off by like +-10 meters. What can I do to get closer numbers?

My ideas are:

  • Set starting point at my house to calibrate height
  • Find closer Api client
  • Calibrate using GPS height (average of values)
  • Find better formula
  • Get more sensors

Here is the formula I am using:

    double p0p = apiPressure / currentPressure;
    double mocnina = 1/5.257;
    p0p = Math.pow(p0p, mocnina);
    p0p = p0p - 1;
    double citatel = p0p*(apiTemp + 273.15);
    double result = citatel / 0.0065;
  • @user16320675 Thank you! Anyways, I just need to calculate difference between two measured places at relatively same time. I was on 40 meter transmitter and difference between real mesurment and mine was only 1-3 meters. But I would like to improve that :) – Pavol Švančarek Aug 21 '22 at 09:51
  • If your only interested in the difference in height then your weather API service should be OK. Just keep the same calibration for both measuremnts. You may want to filter the raw presure readings a bit to improve the difference measurments e.g. take a seoconds worth each time. I typically see about a +-1.5 m altitude variation between raw presure readings on my old Sony Z5c – Ifor Aug 22 '22 at 10:24
  • @Ifor I see +-0,1-0,2m. You mean to make average? Thats not a big problem. I am working on app that measures height of vertical object. App automaticly finds out if you go up hill or up the tree and mark the lowest height and the highest. Than When you walk away from the tree you get the height marked in google maps (maximum-minimum). Problem that I am facing is if you stay on the tree for e.g 30 minutes, pressure can change by one meter or so. And also I am woried about exponential grow of pressure as you go higher... if that formula is the same or I need to multiply 0,04 to every meter – Pavol Švančarek Aug 25 '22 at 09:07
  • Yes an average over say a second. Yes your right about the weather, time gap can not be too big between measurments. For small readings differences like you want say 30m the inaccuracys of the model are probably not too bad. I do a biking app and a 1000m deference can be affected more. It all depends what ccuracy you need to get. – Ifor Aug 26 '22 at 10:14
  • @Ifor for sure. I tried to average every like 20sec and you can literally see how the value just few minutes increases than stops for few minutes and again increases. I can see big difference after 30 minutes sometimes its over 3 meters.. Than I get api call and value goes down by 10 meters :D So I dont know what to do, cant receive api call while climbing and longer I am on the tree higher value it will be. Need probably let phone rest on one place for 5 minutes to calculate average increase (it will be like +0.05m for every minute) and then exponentially sum it up... – Pavol Švančarek Aug 26 '22 at 14:10

0 Answers0