Measure Altitude using BMP280 (I2C interface)
I'm thinking to use pressure sensor for my RC plane so that I can tell how high it fly. Singapore regulation says I cannot fly higher than 60 meter without permit. Although my RC plane at yet to fly π, last time I try it fly like a rock, high speed nose dive π. 60 meters (200 ft) is actualy not that high, I leave in 25th floor and it is around 99 meters based on my Mi Watch 2 altitude meter.
I bought the sensor from AliExpress for SGD $1.37. There are 2 choice, BME or BMP. Both look almos identitcal. The BME is more squarish as show on the picture below. BMP does not have humidity sensor but BMP is cheaper, about 1/3 the price of BME. Anyway I just need the pressure sensor to measure the approximate altitude.
I use the BME280 library by Tyler Glenn. Why? No reason, it just happen to be on the top list when I search at library manager. I'm sure the other library will also work.
Schematic from the seller site:
The Arduino nano connection to the BMP280 is as below
The experiment code below is to read temperature and pressure from the module and then calculate approximate altitude. You need to google for the sea level pressure of your area. I got mine from here π. Also I'm using my smart watch (Mi Watch 2) to calibrate the data. I assume Mi Watch 2 pressure sensor is calibrated π¬
Comments
Post a Comment