Question: Why does the first elevation reading show up about order of magnitude too large?

liz is asking a question about nano-data-logger
Follow this topic

by liz | June 24, 2017 19:34 | #14580

Love the nano data logger, just trying it for the first time -- noticed the first elevation reading keeps showing up 3675.56. Any reason why?



Way to go getting the Nano Logger logging! The first elevation data point is always wacky because the first barometric pressure data point is always wacky. Elevation is computed by the sketch directly from pressure (hPa). Note that the first temperature data point is also erroneous and always the same.

I don't know whether these first data points are default values inserted by the library when no real data are available or whether they are more random. I do know that they should be ignored.

Don't forget to edit the sketch so that the current sea level barometric pressure is entered before you use the logger to save real elevation data. You can do the conversion later from the hPa data if you know the formula, but you have to know what the barometric pressure was when the data were collected. Get the sketch here.


Reply to this comment...

Here is a better answer. The first time the sketch tries to read the BMP280 sensor is immediately after the sensor has been initialized. So the sensor is not ready and erroneous data is read.

So I put a 0.5 second delay after the initialization of the sensor and that seemed to fix the issue.

The updated sketch is available at the Guides page and here.

Reply to this comment...

Log in to comment