Home

Awesome

MicroPython-BME280

<b>BME280: Digital Humidity, Pressure and Temperature Sensor</b>

The BME280 is a sensor from Bosch Sensortec for high precision measurements of Temperature, Pressure and Humidity <br>

<b>DataSheet:</b>

https://www.mouser.com/datasheet/2/783/BST-BME280_DS001-11-844833.pdf <br> or file <i>'BST-BME280_DS001-11-844833.pdf'</i><br>

<b>Key features:</b>

<b>Package:</b>   2.5 mm x 2.5 mm x 0.93 mm metal lid LGA<br>

<b>Digital interface: </b>   I2C (up to 3.4 MHz) and SPI (3 and 4 wire, up to 10 MHz)<br>

<b>Supply voltage:</b>  VDD main supply voltage range: 1.71 V to 3.6 V<br>         VDD IO interface voltage range: 1.20 V to 3.6 V

<b>Current consumption:</b> 1.8 μA @ 1 Hz humidity and temperature <br>             2.8 μA @ 1 Hz pressure and temperature <br>             3.6 μA @ 1 Hz humidity, pressure and temperature <br>             0.1 μA in sleep mode<br>

<b>Operating range:</b> -40...+85 °C, 0...100 % rel. humidity, 300...1100 hPa<br>

<b>Files:</b>

<b>'bme280.py':</b>   Version for <i>Developers</i> of driver for geral devices compatibles of MicroPython - ESP8266, ESP32, LoPy, etc.<br>

<b>'bme280_lowmem.py':</b>   Version <i>Low Memory</i> of driver for geral devices compatibles of MicroPython - <b>No Documenteded</b><br>

<b>'bme280_microbit.py':</b>   Version for <i>Developers</i> of driver for BBC Micro:bit devices<br>

<b>'bme280_microbit_lowmem.py':</b>   Version <i>Low Memory</i> of driver for BBC Micro:bit devices - <b>No Documenteded</b><br>

<b>Tests:</b>

ESP8266

import bme280
from machine import I2C, Pin

i2c = I2C(sda=Pin(4), scl=Pin(5))
sensor = bme280.BME280(i2c=i2c)

sensor.formated_values

ESP32

import bme280
from machine import I2C, Pin

i2c = I2C(sda=Pin(21), scl=Pin(22))
sensor = bme280.BME280(i2c=i2c)

sensor.formated_values

LoPy

import bme280
from machine import I2C

i2c = I2C(0, I2C.MASTER, baudrate=100000)
sensor = bme280.BME280(i2c=i2c)

sensor.formated_values

BBC Micro:bit

from microbit import i2c
import bme280
bme = bme280.BME280(i2c)
temp, pres, humi = bme.values()

<b>Driver Benchmark for Memory Consumed*:</b>

*To import all dependencies and construct the object.

ESP8266ESP32LoPyBBC Micro:bit
Total Memory device (Kb)6452020016
Memory Free (Kb)9.3
Memory Uses (Kb)---3.48
Memory (%)---38
MicroPython VersionMicroPython v1.9.2-34-gd64154c73

The Test in BBC Micro:bit :