BMP280: Measure Temperature, Pressure and Altitude

+ OLED display, measures in imperial and metric.

Feb 2, 2019

165266 views

42 respects

Components and supplies

1

Adafruit OLED 128x32 i2c

1

Adafruit BMP280

1

Arduino UNO

Project description

Code

bmp280_Serial_metric.ino

arduino

bmp280_OLED_US.ino

arduino

bmp280_Serial_Imperial.ino

arduino

bmp280_OLED_m.ino

arduino

BMP280_Adafruit_library

You may want to change things like in the tutorial

BMP280_Adafruit_library

You may want to change things like in the tutorial

bmp280_Serial_metric.ino

arduino

bmp280_Serial_Imperial.ino

arduino

bmp280_OLED_US.ino

arduino

bmp280_OLED_m.ino

arduino

Downloadable files

BMP280+OLED

Both modules uses the i²c interface, SDA/SCL with A4 and A5, the BMP280 is powred by 5v meanwhile the OLED is using the 3.3v.

BMP280+OLED

Comments

Only logged in users can leave comments

mrphysh

a year ago

I have experience with data collection. If the C++ serial monitor is off the print command can be caught with Python. The sqlite3 library makes it possible to enter the data into a database. I do not really understand it well enough to explain it. But if I can do it, anybody can.

Anonymous user

2 years ago

Please assist if possible, I am using an Arduino UNO as well as a ESP8266 card with a BMP280 installed I am using the following sketch to try to get familiar with this operation SparkFun_BME280/I2C_ReadAllData.ino at master · mhaack/SparkFun_BME280 (github.com) On the serial port I am getting a "0" reading for Temp C and "0" Pa which possibly accounts for an extremely high Altitude reading. From my untrained eye, this looks like a calibration issue but I am probably wrong. Possibly a coding issue. I cannot see what the issue is.

usini

2 years ago

If you get 0, it means the arduino is probably unable to connect to the BMP280. Try to do a I2C scan to see if it is detected. https://learn.adafruit.com/scanning-i2c-addresses/arduino

Anonymous user

2 years ago

Is there any way to add the ability to zero out the altimeter when powering on or adding a zero out switch? This would read out the AGL Above ground level. Useful in aviation.

Anonymous user

2 years ago

GREAT HELP FROM THIS PROJECT. THANK YOU

Anonymous user

2 years ago

Thank you for the education. I am planning to measure vapour pressure, temperature and dielectric constant on an LCD display

Anonymous user

2 years ago

I have the following question. The data-sheet of (my) BMP280 says the max VDD(VDDIO) should not be higher then 3.6V. In your layout you connect the BMP280 directly with the arduino's 5V power support. In other projects I have seen logic-level converters from 5V down to 3.xV. Do you have a BMP280 with a different max VDD? Connecting my BMP280 with 5V logic might damage the chip or could decrease the life time. Are logic-level converters needed or just a nice-to-have? Thanks for your posting and sharing your project.

Anonymous user

2 years ago

Hi, may I know how to make it react when it achieve a altitude? Example: I want to make a servo move when it goes up to 20m.

Anderson-Bricker

2 years ago

SurtrTech, thanks for sharing this sketch and video. I successfully adapted your sketch with an Adafruit BME280 sensor with the added humidity sensor and a DIYmall Yellow & Blue 128x64 OLED. Just tinkered with the spacing on the screen and it looks great!

Anonymous user

2 years ago

5 STAR RATING I just made this. You have the simplest tutorial. The great thing is it worked without any hassles. I've tried several peoples code which will not compile. Now I just need to find a way to port this to the Particle Photon.

Anonymous user

2 years ago

As soon as I ran it got bogged on the first line of code with: Adafruit_GFX.h: No such file or directory. Help?

richardvanraay

2 years ago

Thank you very much. The sketch works admirably with my Arduino Pro Mini. This is a great start for my rocket parachute deployment. I am awful at writing sketches but will try to modify this so it holds the maximum altitude to display when the rocket lands. so students can graph their results. This would also allow me to activate a servo. Thank you very much indeed.

Anonymous user

2 years ago

Well done, Thanks for sharing.

Anonymous user

2 years ago

Подскажите, как правильно опрашивать 2 датчика bmp280 (0x76+0x77), никак не могу разобраться самостоятельно :(

SurtrTech

2 years ago

You're welcome.

usini

2 years ago

Great tutorial, I didn't understand why my BMP280 didn't work with the Adafruit library. Turn out it was not on the address it expected. Note that, you can change the I2C address without modifying the library, just type ``` bmp.begin(0x76); ``` instead of ``` bmp.begin(); ``` You can also change the address of the bmp280 by plugging SD0 to VCC http://wiki.sunfounder.cc/index.php?title=BMP280_Pressure_Sensor_Module

Anonymous user

2 years ago

I want to see a code with Oled display function, not "serial.print...". Thanks

SurtrTech

2 years ago

Hi, There are 4 codes above, two that work with the "Serial Monitor" and two work with the "OLED, screen"

Anonymous user

2 years ago

Hi there, I connected all together and copied and pasted the code in my Arduino IDE and uploaded to my Arduino Uno. But my Serial monitor gives me a temperature of about 27 degrees Celsius. It is at the moment conviniant warm weather today, but not absolutely 27 degrees! At the moment it is about at maximum 24 degrees. How does it come? I thought that the Bosch I2C sensor was very accurate.

Anonymous user

2 years ago

Please assist if possible, I am using an Arduino UNO as well as a ESP8266 card with a BMP280 installed I am using the following sketch to try to get familiar with this operation SparkFun_BME280/I2C_ReadAllData.ino at master · mhaack/SparkFun_BME280 (github.com) On the serial port I am getting a "0" reading for Temp C and "0" Pa which possibly accounts for an extremely high Altitude reading. From my untrained eye, this looks like a calibration issue but I am probably wrong. Possibly a coding issue. I cannot see what the issue is.

usini

2 years ago

If you get 0, it means the arduino is probably unable to connect to the BMP280. Try to do a I2C scan to see if it is detected. https://learn.adafruit.com/scanning-i2c-addresses/arduino

richardvanraay

3 years ago

Thank you very much. The sketch works admirably with my Arduino Pro Mini. This is a great start for my rocket parachute deployment. I am awful at writing sketches but will try to modify this so it holds the maximum altitude to display when the rocket lands. so students can graph their results. This would also allow me to activate a servo. Thank you very much indeed.

Anonymous user

3 years ago

Thank you for the education. I am planning to measure vapour pressure, temperature and dielectric constant on an LCD display

Anonymous user

3 years ago

As soon as I ran it got bogged on the first line of code with: Adafruit_GFX.h: No such file or directory. Help?

Anonymous user

3 years ago

Is there any way to add the ability to zero out the altimeter when powering on or adding a zero out switch? This would read out the AGL Above ground level. Useful in aviation.

Anonymous user

4 years ago

Hi, may I know how to make it react when it achieve a altitude? Example: I want to make a servo move when it goes up to 20m.

Anonymous user

4 years ago

I have the following question. The data-sheet of (my) BMP280 says the max VDD(VDDIO) should not be higher then 3.6V. In your layout you connect the BMP280 directly with the arduino's 5V power support. In other projects I have seen logic-level converters from 5V down to 3.xV. Do you have a BMP280 with a different max VDD? Connecting my BMP280 with 5V logic might damage the chip or could decrease the life time. Are logic-level converters needed or just a nice-to-have? Thanks for your posting and sharing your project.

Anderson-Bricker

5 years ago

SurtrTech, thanks for sharing this sketch and video. I successfully adapted your sketch with an Adafruit BME280 sensor with the added humidity sensor and a DIYmall Yellow & Blue 128x64 OLED. Just tinkered with the spacing on the screen and it looks great!

Anonymous user

5 years ago

GREAT HELP FROM THIS PROJECT. THANK YOU

Anonymous user

5 years ago

5 STAR RATING I just made this. You have the simplest tutorial. The great thing is it worked without any hassles. I've tried several peoples code which will not compile. Now I just need to find a way to port this to the Particle Photon.

usini

6 years ago

Great tutorial, I didn't understand why my BMP280 didn't work with the Adafruit library. Turn out it was not on the address it expected. Note that, you can change the I2C address without modifying the library, just type ``` bmp.begin(0x76); ``` instead of ``` bmp.begin(); ``` You can also change the address of the bmp280 by plugging SD0 to VCC http://wiki.sunfounder.cc/index.php?title=BMP280_Pressure_Sensor_Module

majovajo

6 years ago

My first Arduino "project". I have another type of sensor (BME) and needed to set Vcc on SDO as a workaround for 0x77 Adress. Anyhow it works :)

na-zubok

6 years ago

I want to see a code with Oled display function, not "serial.print...". Thanks

SurtrTech

2 years ago

Hi, There are 4 codes above, two that work with the "Serial Monitor" and two work with the "OLED, screen"

JoeZ

6 years ago

Well done, Thanks for sharing.

SurtrTech

2 years ago

You're welcome.

Anonymous user

2 years ago

Подскажите, как правильно опрашивать 2 датчика bmp280 (0x76+0x77), никак не могу разобраться самостоятельно :(