Skip to main content

Grove - Barometer Sensor(BME280)

pir

Grove - Temp&Humi&Barometer Sensor (BME280) is a breakout board for Bosch BMP280 high-precision, low-power combined humidity, pressure, and temperature sensor. This module can be used to measure temperature, atmospheric pressure and humidity accurately and fast. As the atmospheric pressure changes with altitude, it can also measure approximate altitude of a place. It can be connected to a microcontroller with I2C (integrated with Grove socket) or through SPI bus. We have also provided highly abstracted library to make this more product easier to use.

The BME280 is an upgraded version of BMP180, and BME280 gets dramatic improvements from BMP180. BME280 comes with a smaller footprint, lower power consumption, lower noise measurements, higher resolutions for pressure and temperature, lower RMS noise, newly added SPI bus, more measuring modes, higher measuring rate, and newly added filter against environmental interference. Since the atmosphere pressure reading is affected by altitude and temperature, we have added compensation features. Hence, Grove - Temp&Humi&Barometer Sensor (BME280) will be more reliable in providing precise temperature, atmospheric pressure values, humidity and approximate altitude data.

Using the sensor is easy. For Seeeduino (compliant with Arduino), just connect this breakout board using Grove cable to I2C Grove connector. Then, use the provided library and example code from GitHub. If you are using an Arduino either use Base Shield v2.0 or simply connect the VCC pin to the 5V voltage pin, GND to ground, SCL to I2C Clock (Analog 5) and SDA to I2C Data (Analog 4).

Typical applications: Enhancement of GPS navigation, outdoor/indoor navigation, weather forecast, or any other project that requires accurate atmospheric pressure reading.

pir

Upgradable to Industrial Sensors

With the SenseCAP S2110 controller and S2100 data logger, you can easily turn the Grove into a LoRaWAN® sensor. Seeed not only helps you with prototyping but also offers you the possibility to expand your project with the SenseCAP series of robust industrial sensors.

SenseCAP S210x series industrial sensors provide an out-of-box experience for environmental sensing. Please refer to the S2101 Wireless Temperature and Humidity Sensor with higher performance and robustness for air quality monitoring. The series includes sensors for soil moisture, air temperature and humidity, light intensity, CO2, EC, and an 8-in-1 weather station. Try the latest SenseCAP S210x for your next successful industrial project.

SenseCAP Industrial Sensor
S2101 Air Temp & Humidity

Features

  • Get more precise temperature, atmospheric pressure values, humidity and approximate altitude data fast.
  • Grove compatible and easy to use
  • Highly abstracted library for building projects quicker
tip
More details about Grove modules please refer to [Grove System](https://wiki.seeedstudio.com/Grove_System/)

Specifications

ParameterValue
Input voltage3.3V or 5V
I/O voltage3.3V or 5V
Operating current0.4mA
Operating temperature-40 - 85 ℃
Atmospheric pressure sensor measurement range300 - 1100 hPa (1 hPa= one hundred Pa) with ±1.0 hPa accuracy
Temperature sensor measurement range-40 - 85 ℃, with ±1.0°C accuracy
Humidity sensor measurements range0% - 100% relative humidity , with ±3% accuracy
Measurement modesPiezo & Temperature, forced or periodic
ChipBME280(datasheet)
Interface BusSPI, I2C (use either one of them)
Weight3.2 g (for breakout board), 9.3 g for whole package each piece
Dimensions40 (length) × 20 (width) mm
I2C0x76(default) or 0x77

Note

  1. We will show/describe how to select interface bus soon.
  2. The altitude is calculated by a combination of temperature and atmospheric pressure. No specialized components for altitude.

Platforms Supported

ArduinoRaspberry Pi

pir

pir

caution
The platforms mentioned above as supported is/are an indication of the module's software or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Hardware Overview

pir

  • SPI soldering pads, a voltage monitoring circuit.

  • Interface bus selection pads , to select I2C bus, connect the two pads by soldering (it is connected by default); to select SPI bus, cut the two pads with a sharp knife or a soldering iron.

  • Slave board address selection pads, to select slave board address to avoid address collision.

    - If you have selected I2C bus, the default address for slave board is **0x76** (right-two pads are connected). If you want to use the address **0x77**, connect only the left two (disconnect right two) by soldering.

    Tip

    You can disconnect pads with just a sharp knife.
    - If you have selected SPI bus, the default address for slave board is **0x76** (right-two pads are connected). If you want to use the address **0x77**, disconnect all three pads.

Note

Do not touch or shake or let this product in vibration when it works. This will cause interference and will affect the accuracy of data collected.

Package includes (main parts)

Parts nameQuantity
Grove - Temp&Humi&Barometer Sensor (BME280)1 piece
Grove cable1 piece

Getting Started

Now let us run some basic examples with this module.

Play with Arduino

Hardware

  • Step 1. Prepare the below stuffs:
Seeeduino V4.2Base ShieldGrove-Barometer_Sensor-BME280

pir

pir

pir

Get One NowGet One NowGet One Now
  • Step 2. Connect Grove-Barometer_Sensor-BME280 to port I2C of Grove-Base Shield.
  • Step 3. Plug Grove - Base Shield into Seeeduino.
  • Step 4. Connect Seeeduino to PC via a USB cable.

pir

note
If we don't have Grove Base Shield, We also can directly connect this module to Seeeduino as below.
seeeduino_v4Grove-Barometer_Sensor-BME280
5VVCC
GNDGND
SDASDA
SCLSCL

Software

Step 1. Download the Library and example code from Github.

Step 2. Refer How to install library to install library for Arduino.

Step 3. Create a new Arduino sketch and paste the codes below to it or open the code directly by the path:File -> Example ->Barometer_Sensor->Barometer_Sensor.

Here is the code


/*
* bme280_example.ino
* Example sketch for bme280
*
* Copyright (c) 2016 seeed technology inc.
* Website : www.seeedstudio.com
* Author : Lambor
* Create Time:
* Change Log :
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "Seeed_BME280.h"
#include <Wire.h>

BME280 bme280;

void setup()
{
Serial.begin(9600);
if(!bme280.init()){
Serial.println("Device error!");
}
}

void loop()
{
float pressure;

//get and print temperatures
Serial.print("Temp: ");
Serial.print(bme280.getTemperature());
Serial.println("C");//The unit for Celsius because original arduino don't support speical symbols

//get and print atmospheric pressure data
Serial.print("Pressure: ");
Serial.print(pressure = bme280.getPressure());
Serial.println("Pa");

//get and print altitude data
Serial.print("Altitude: ");
Serial.print(bme280.calcAltitude(pressure));
Serial.println("m");

//get and print humidity data
Serial.print("Humidity: ");
Serial.print(bme280.getHumidity());
Serial.println("%");

delay(1000);
}

Step 4. Upload the code. If you do not know how to upload the code, please check how to upload code.

Step 5. Open the serial monitor to receive the sensor's data including temperature, barometric pressure value, altitude and humidity.

Play With Wio Terminal (ArduPy)

Hardware

  • Step 1. Prepare the below stuffs:
Wio TerminalGrove-Barometer Sensor-BME280

pir

pir

Get One NowGet One Now
  • Step 2. Connect Grove-Barometer Sensor-BME280 to the I2C Grove port of Wio Terminal.

  • Step 3. Connect the Wio Terminal to PC through USB Type-C cable.

    pir

Software

  • Step 1. Follow ArduPy Getting Started to configure the ArduPy development environment on Wio Terminal.

  • Step 2. Make sure that the ArduPy firmware is flashed into Wio Terminal. For more information, please follow here.

aip install Seeed-Studio/seeed-ardupy-bme280
aip build
aip flash
  • Step 3. Copy the following code and save it as ArduPy-bme280.py:
from arduino import grove_bme280
from machine import LCD
from machine import Sprite
import time

bme280 = grove_bme280()
lcd = LCD()
spr = Sprite(lcd) # Create a buff

def main():
spr.createSprite(320, 240)
while True:
spr.setTextSize(2)
spr.fillSprite(spr.color.BLACK)
spr.setTextColor(lcd.color.ORANGE)
spr.drawString("BME280 Reading", 90, 10)
spr.drawFastHLine(40, 35, 240, lcd.color.DARKGREY)
spr.setTextColor(lcd.color.WHITE)
spr.drawString("- Temperature: ", 20, 50)
spr.drawString("- Humidity: ", 20, 80)
spr.drawString("- Pressure: ", 20, 110)

spr.drawFloat(bme280.temperature, 2, 220,50)
spr.drawNumber(bme280.humidity, 220,80)
spr.drawNumber(bme280.pressure, 220,110)
spr.pushSprite(0,0)
time.sleep_ms(500)

print ("\nTemperature: ", bme280.temperature, "C")
print ("Humidity: ", bme280.humidity, "%")
print ("Pressure: ", bme280.pressure, "Pa")

if __name__ == "__main__":
main()
  • Step 4. Save the ArduPy-bme280.py in a location that you know. Run the following command and replace <YourPythonFilePath> with your ArduPy-bme280.py location.
aip shell -n -c "runfile <YourPythonFilePath>"
# Example:
# aip shell -n -c "runfile /Users/ansonhe/Desktop/ArduPy-bme280.py"
  • Step 5. We will see the values display on terminal as below, and displaying on the Wio Terminal LCD screen.
ansonhe@Ansons-Macbook-Pro ~:aip shell -n -c "runfile /Users/ansonhe/Desktop/ArduPy-bme280.py"
Positional argument (/dev/cu.usbmodem1414301) takes precedence over --open.
Connected to ardupy

Temperature: 29.88 C
Humidity: 55 %
Pressure: 100332 Pa

Temperature: 29.91 C
Humidity: 55 %
Pressure: 100332 Pa

Temperature: 29.88 C
Humidity: 54 %
Pressure: 100331 Pa

pir

Schematic Online Viewer

Resources

Projects

Seeed LoRa IoTea Solution: An automatic information collection system applied to tea plantation. It is part of intelligent agricultural information collection.

Tech Support

Please submit any technical issue into our forum.

Loading Comments...