Can pressure sensors like the SparkFun Qwiic MicroPressure Sensor (https://www.sparkfun.com/products/16476), be used as an altimeter, over a long period of time, say 2-3 hours?
I’ve read through a few articles recommending using a pressure sensor to calculate the altitude. I know that they use pressure to calculate the altitude, and one can use them to calculate relative altitude (not absolute altitude) and can be used to calculate the change in altitude.
In a nutshell, the logic is usually along the lines of:
initialize
read the initial pressure
initial altitude = f(initial pressure)
loop
read the current pressure
current altitude = f(current pressure)
altitude change = current altitude - initial altitude
display the altitude change
This (seems to me) to only work if the ambient atmospheric pressure doesn’t change, which, even if indoors, changes throughout the day.
As an example, write a sketch with the previous logic, and run it for a few hours. While it is running, don’t move the sensor. Since the sensor isn’t moving, the altitude change that’s calculated should remain the same (roughly, +/- the sensitivity), but since the ambient pressure is changing throughout the day, the altitude change (that’s reported) changes (even though it is left still)
So maybe I’m missing something here, but it seems like using a pressure sensor to calculate the altitude works when the application runs for only a short period of time (maybe 30 minutes or less) but not when the application runs for a few hours. Or is there a way to calculate the altitude, and altitude change over the course of a few hours?