[tutorial] How to use the Adafruit BMP280 sensor

Introduction

Adafruit BMP280 tutorial

In this tutorial we will use the Adafruit BMP280 sensor. This sensor can measure barometric pressure and temperature with very good accuracy. Because pressure changes with altitude we can also use it as an altimeter with ±1 meter accuracy! Accuracy for barometric pressure is ±1 hPa and ±1.0°C for temperature.

You can connect it with your Arduino board with I2C or SPI connection protocol. It has a 3.3V regulator and level shifting so you can use it with a 3V or 5V logic micro controller without any problems.

In this tutorial we will use the Arduino UNO board with this sensor and the serial monitor of Codebender to print measured values every 5 sec.

So, let’s get started!

What you will need

For this tutorial you will need:

  • Arduino uno
  • Breadboard (or breadboard shield)
  • Adafruit BMP280
  • Some breadboard cables

The Circuit

The connections are pretty easy, see the above image with the breadboard circuit schematic.

We will use the I2C connection (SCL and SDA pins)

Connections of the Adafruit BMP280 sensor:

  • Vin to Arduino 5V pin
  • 3Vo
  • GND to GDN
  • SCK to Arduino SCL pin (A5)
  • SDO
  • SDI to Arduino SDA pin (A4)
  • CS

The code

Here’s the code, embedded using Codebender!
Try downloading the Codebender plugin and clicking on the “Run on Arduino” button to program your Arduino board with this sketch. And that’s it, you’ve programmed your Arduino uno board with this sketch!

Measured values

Press the “connect” button to the serial monitor of Codebender below:

Well done!

You have successfully completed one more “How to” tutorial and you learned how to use the Adafruit BMP280 sensor with the Arduino uno board.

I hope you liked this, let me know in the comments!

3 Comments

  1. Steve

    04 Apr 2016 04:05:12

    Hi!

    Nice to meet you.
    My name is Steve, at WIZnet in Korea.
    We have been searching some application references in which WIZnet solution is applied, and found below your project. Your development looks very cool & smart.

    Recently we opened WIZnet Museum (http://wiznetmuseum.com) site. This is a academic-purposed collection of open projects, tutorials, articles and etc from our global customers.
    If you are O.K. we would like to introduce your projects in here. Hopefully, you will allow this.

    Also, if you are interested, we would like to send the Ethernet shield of our latest chip version, W5500 or WiFi Shield. You may be able to establish another project with them.
    Hopefully, keep contacting us for the friendship.

    Thank you very much.

  2. Kenisha

    29 Apr 2016 09:53:43

    Was totally stuck until I read this, now back up and rungnin.

Leave a Comment

Stay tuned:

* we promise that we won´t spam you, never.