I bought a AltIMU-10 v5 Gyro, Accelerometer, Compass, and Altimeter (LSM6DS33, LIS3MDL, and LPS25H Carrier) and was testing the Altimeter but getting an altitude value which is not meaningful and not stable : p: 1019.72 mbar a: -53.71 m t: 27.84 deg C. Can anyone assist to find how I can get an accurate altitude value.
I am using the following sketch:
Serial.println("Failed to autodetect pressure sensor!");
float pressure = ps.readPressureMillibars();
float altitude = ps.pressureToAltitudeMeters(pressure);
float temperature = ps.readTemperatureC();
Serial.print(" mbar\ta: ");
Serial.print(" m\tt: ");
Serial.println(" deg C");
Altitude is calculated from the air pressure at your location and the air pressure at sea level, both of which can change in minutes. See http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/barfor.html
What is your altitude and what value are you using for the sea level pressure?
It looks like you are running our Arduino serial sketch, which defaults to 1013.25mbar (or 29.9213inHg) as the air pressure at sea level unless you give it an adjusted value. This is explained in the documentation for the
pressureToAltitude functions on the LPS library’s GitHub page.
Since the pressure your altimeter measured is higher than 1013.25mbar, it makes sense that the calculated altitude is lower, since the atmospheric pressure increases as altitude decreases. Like Jim asked, knowing the altitude of your altimeter as it recorded data and what value you are using for sea level pressure would help explain things.
Yes, you are right I am using your Arduino serial sketch.
Would you advise/ guide on a best way to evaluate height of an object?
It is difficult to recommend something without more information about the specific details of your system. Can you tell me more about what you are trying to measure and how large of a change in height you expect there to be? Are you looking for help getting a more accurate altitude reading from your pressure sensor, or do you think that the pressure sensor might not be the best sensor for your application?
I am actually looking a more accurate sensor to measure the height of structures ranging from 5m to 90m and wonder if Altimu-10 v5 will help.
Do you think that Altimu-10 v5 will help achieving my goal?
I think whether or not the LPS25H altimeter works for you depends on how accurately you need to obtain the height of those structures. You can read this blog post, which talks about the kind of accuracy we were able to get by calculating a running average and obtaining pressure readings while the sensor was not moving.
By the way, if all you need to do is compare the pressure at two different altitudes, you do not need the whole AltIMU-10. Instead, you mighty consider using just our LPS25H carrier with voltage regulator, which features just the barometer.
The LPS25H can reliably determine atmospheric pressure differences of about 1 Pa. This corresponds to a change in elevation of about 8 centimeters when you are near sea level.
So, you can quite accurately determine building height using the device as a barometer.
Just make pressure measurements (by averaging a number of readings together) at the top and bottom, and convert to altitude change.