Hello everyone,
I want to use bmp180 in drone project. But in my tests bmp180 shows very big difference in altitude about 1,5 meters but it is not moving upward or downward. It will cause problem in my project. How can I fix it?
Thanks,
M-Emin:
Hello everyone,
I want to use bmp180 in drone project. But in my tests bmp180 shows very big difference in altitude about 1,5 meters but it is not moving upward or downward. It will cause problem in my project. How can I fix it?
Thanks,
Determining altitude by air pressure requires one to know what the pressure at ground level is. I'm not sure if you can really expect better precision from an altimeter than what you are seeing.
If the weather changes while you are flying then the altimeter error will likely increase.
I haven't used altimeters myself in my projects so what I'm sharing is only "book learning".
What I've learned is there are basically two ways to use altimeters for measuring altitude.
-
Keep the flight short enough so the pressure doesn't change much while your aircraft is airborne.
-
Use a second altimeter on your base station and have the base station update the ground level pressure reading to the aircraft's controller.
As you are seeing, air pressure alone doesn't make a very precise altimeter.
Low altitude distances can be measured with ultrasound (though I wouldn't trust this to a cheap sensor). It's also possible to measure altitude (again at relatively low altitudes) with a laser rangefinder.
I think the LIDAR Lite sold be SparkFun will work for this purpose but Parallax also sells time of flight laser rangefinders which I believe outperform LIDAR Lite (but these are more expensive than LIDAR Lite).
Note: I'm a bit biased towards the Rangefinders sold by Parallax. I have not yet compared the performance of these rangefinders.
But in my tests bmp180 shows very big difference in altitude about 1,5 meters
If you mean the readings are noisy and are showing variations of up to 1.5 m, then average a bunch of readings together. The noise is reduced by the square root of the number of measurements in the average. By averaging 100 readings, you would expect the noise to be 0.15 m.
The BMP180 is an old sensor and doesn't work nearly as well as more modern ones, like this one.
The datasheet says the RMS noise is 6Pa (about 0.5m) in mode 0 and half that in mode 3. That's in a very quiet test environment. In the real world it will likely be worse. Yours may be worse than typical for a variety of possible reasons.
Here's what I got when I tested mine indoors:
1 meter at sea level is equivalent to a pressure difference of about 12Pa.
The difference in the modes is the number of samples internally averaged. Mode 0 is one sample and mode 3 is 8 samples. As jremington pointed out you can improve that by averaging even more in your sketch.
If you're willing to do that averaging yourself then it's debatable whether a newer sensor will provide much advantage. So much of the noise in real life applications is environmental. Even an ideal perfect sensor would still be subject to that.