/MicroPython-BME280

Driver to digital sensor of Temperature, Pressure and Humidaty

Primary LanguagePython

MicroPython-BME280

BME280: Digital Humidity, Pressure and Temperature Sensor

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

DataSheet:

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

Key features:

Package:   2.5 mm x 2.5 mm x 0.93 mm metal lid LGA

Digital interface:   I2C (up to 3.4 MHz) and SPI (3 and 4 wire, up to 10 MHz)

Supply voltage:  VDD main supply voltage range: 1.71 V to 3.6 V
        VDD IO interface voltage range: 1.20 V to 3.6 V

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

Operating range: -40...+85 °C, 0...100 % rel. humidity, 300...1100 hPa

Files:

'bme280.py':   Version for Developers of driver for geral devices compatibles of MicroPython - ESP8266, ESP32, LoPy, etc.

'bme280_lowmem.py':   Version Low Memory of driver for geral devices compatibles of MicroPython - No Documenteded

'bme280_microbit.py':   Version for Developers of driver for BBC Micro:bit devices

'bme280_microbit_lowmem.py':   Version Low Memory of driver for BBC Micro:bit devices - No Documenteded

Tests:

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()

Driver Benchmark for Memory Consumed*:

*To import all dependencies and construct the object.

ESP8266 ESP32 LoPy BBC Micro:bit
Total Memory device (Kb) 64 520 200 16
Memory Free (Kb) 9.3
Memory Uses (Kb) - - - 3.48
Memory (%) - - - 38
MicroPython Version MicroPython v1.9.2-34-gd64154c73

The Test in BBC Micro:bit :