All Projects → dafvid → micropython-bmp280

dafvid / micropython-bmp280

Licence: MIT License
module for the BMP280 sensor

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to micropython-bmp280

AnalogClock
Project to sync analog clocks to a few milliseconds.
Stars: ✭ 29 (-6.45%)
Mutual labels:  esp8266
Cicada-FW
IoT Communications Module for Energy Access. An easy way to get production ready, bi-directional communications for your IoT embedded device. Proiect supported by the EnAccess Foundation - https://enaccess.org
Stars: ✭ 12 (-61.29%)
Mutual labels:  esp8266
esphome-capacitive-touch-panel
A DIY capacitive touch panel based on the mpr121 and esphome.
Stars: ✭ 95 (+206.45%)
Mutual labels:  esp8266
esp mqtt
MQTT Broker/Bridge on the ESP8266
Stars: ✭ 250 (+706.45%)
Mutual labels:  esp8266
hgdo
Hörmann Garage Door Opener mit ESP8266 (direkt über Bus, ohne UAP1 !)
Stars: ✭ 19 (-38.71%)
Mutual labels:  esp8266
la-maison-pythonic
Projet didactique du livre "Python, Raspberry-Pi et Flask" avec ESP8266 sous MicroPython
Stars: ✭ 16 (-48.39%)
Mutual labels:  esp8266
WebServer tng
ESP8266/ESP32 WebServer
Stars: ✭ 65 (+109.68%)
Mutual labels:  esp8266
esp-homekit-rgbw-strip
A homekit firmware for a magic home RGBW controller
Stars: ✭ 14 (-54.84%)
Mutual labels:  esp8266
home
Monorepo for all home automation related development, including integrated firmware, PCBs, configuration, and bridges
Stars: ✭ 104 (+235.48%)
Mutual labels:  esp8266
IoTManager
Это модульная система автоматизации на базе ESP32/ESP8266 микроконтроллеров и приложения IoT Manager.
Stars: ✭ 41 (+32.26%)
Mutual labels:  esp8266
arduino-esp8266-mh-z19-serial
CO2, humidity and temperature sensor on ESP8266
Stars: ✭ 57 (+83.87%)
Mutual labels:  esp8266
SnorkTracker
GPS IoT tracker board for scanning gps and environment information and sending this to a MQTT server via GPRS.
Stars: ✭ 38 (+22.58%)
Mutual labels:  esp8266
st7789 mpy
Fast pure-C driver for MicroPython that can handle display modules on ST7789 chip
Stars: ✭ 113 (+264.52%)
Mutual labels:  esp8266
ESP8266 MQTT OneNet
Esp8266 Connect Onenet via mqtt, subscribe & publish
Stars: ✭ 15 (-51.61%)
Mutual labels:  esp8266
SuperLEDstrip
No description or website provided.
Stars: ✭ 13 (-58.06%)
Mutual labels:  esp8266
ArduinoMqtt
MQTT client for Arduino
Stars: ✭ 58 (+87.1%)
Mutual labels:  esp8266
EMS-Wiki
Buderus Logamatic EMS and EMS+/EMS Plus bus Wiki for Bosch, Buderus, Nefit, Junkers, Worcester devices
Stars: ✭ 22 (-29.03%)
Mutual labels:  esp8266
zevoicemask
An open source DIY implemetation of a face mask with voice visuals and animations.
Stars: ✭ 13 (-58.06%)
Mutual labels:  esp8266
interp
Interpreter experiment. Testing dispatch methods: Switching, Direct/Indirect Threaded Code, Tail-Calls and Inlining
Stars: ✭ 32 (+3.23%)
Mutual labels:  esp8266
SDS011
Non blocking SDS011 sensor library for ESP8266
Stars: ✭ 15 (-51.61%)
Mutual labels:  esp8266

micropython-bmp280

Inspired by
https://github.com/vitally/BMP280
https://github.com/micropython-IMU/micropython-bmp180

Constructor

BMP280(i2c_bus, addr=0x76, use_case=BMP280_CASE_HANDHELD_DYN)

  • i2c_bus - the I2C bus to use
  • addr - I2C address of the BMP280 (always the same)
  • use_case - Use case to start the BMP280 with. Set to None to disable measuring on boot.

Enums

Values for different settings are defined in the following constants. Reference to manual section in parenthesis.

Use cases (See 3.4, 3.8.2)

  • BMP280_CASE_HANDHELD_LOW
  • BMP280_CASE_HANDHELD_DYN (default)
  • BMP280_CASE_WEATHER
  • BMP280_CASE_FLOOR
  • BMP280_CASE_DROP
  • BMP280_CASE_INDOOR

Oversampling setting (See 3.3.1, 3.8.2)

  • BMP280_OS_ULTRALOW
  • BMP280_OS_LOW
  • BMP280_OS_STANDARD
  • BMP280_OS_HIGH
  • BMP280_OS_ULTRAHIGH

Pressure oversampling (See 3.3.1)

  • BMP280_PRES_OS_SKIP
  • BMP280_PRES_OS_1
  • BMP280_PRES_OS_2
  • BMP280_PRES_OS_4
  • BMP280_PRES_OS_8
  • BMP280_PRES_OS_16

Temperature oversampling (See 3.3.2)

  • BMP280_TEMP_OS_SKIP
  • BMP280_TEMP_OS_1
  • BMP280_TEMP_OS_2
  • BMP280_TEMP_OS_4
  • BMP280_TEMP_OS_8
  • BMP280_TEMP_OS_16

IIR filter (See 3.3.3)

  • BMP280_IIR_FILTER_OFF
  • BMP280_IIR_FILTER_2
  • BMP280_IIR_FILTER_4
  • BMP280_IIR_FILTER_8
  • BMP280_IIR_FILTER_16

Standby settings for Normal measure (See 3.6.3)

  • BMP280_STANDBY_0_5
  • BMP280_STANDBY_62_5
  • BMP280_STANDBY_125
  • BMP280_STANDBY_250
  • BMP280_STANDBY_500
  • BMP280_STANDBY_1000
  • BMP280_STANDBY_2000
  • BMP280_STANDBY_4000

Power modes

  • BMP280_POWER_SLEEP
  • BMP280_POWER_FORCED
  • BMP280_POWER_NORMAL

SPI 3-wire select

  • BMP280_SPI3W_ON
  • BMP280_SPI3W_OFF

Example

from machine import I2C
from bmp280 import *

bus = I2C()
bmp = BMP280(bus)

bmp.use_case(BMP280_CASE_WEATHER)
bmp.oversample(BMP280_OS_HIGH)

bmp.temp_os = BMP280_TEMP_OS_8
bmp.press_os = BMP280_PRES_OS_4

bmp.standby = BMP280_STANDBY_250
bmp.iir = BMP280_IIR_FILTER_2

bmp.spi3w = BMP280_SPI3W_ON

bmp.power_mode = BMP280_POWER_FORCED
# or 
bmp.force_measure()

bmp.power_mode = BMP280_POWER_NORMAL
# or 
bmp.normal_measure()
# also
bmp.in_normal_mode()

bmp.power_mode = BMP280_POWER_SLEEP
# or 
bmp.sleep()

print(bmp.temperature)
print(bmp.pressure)

#True while measuring
bmp.is_measuring

#True while copying data to registers
bmp.is_updating

TODO

  • SPI support
  • Filters
  • Oversampling settings (half done)
  • Power modes
  • Standby setting for Normal mode
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].