Giter Club home page Giter Club logo

adafruit_python_bme280's Introduction

DEPRECATED LIBRARY Adafruit_Python_BME280

This library has been deprecated!

we are now only using our circuitpython sensor libraries in python

we are leaving the code up for historical/research purposes but archiving the repository.

check out this guide for using the bme280 with python! https://learn.adafruit.com/adafruit-bme280-humidity-barometric-pressure-temperature-sensor-breakout

This Python driver allows you to read data from the Adafruit BME280 Breakout on a Raspberry Pi, Pi2 or similar device.

Requirements

This driver requires that you have previously installed the Adafruit_Python_GPIO package.

On Raspbian, you can install this package with the following commands:

sudo apt-get update
sudo apt-get install build-essential python-pip python-dev python-smbus git
git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
cd Adafruit_Python_GPIO
sudo python setup.py install

Usage

To read a single set of data points from the BME, connect your Pi to the BME280 breakout using I2C (connect SCL to the SCK pin and SDA to the SDI pin), and run the following command from this folder:

python Adafruit_BME280_Example.py

Credits

This driver is based on the Adafruit_BMP driver by Tony DiCola (Adafruit Industries), with BME280 additions kindly provided by David J. Taylor (www.satsignal.eu).

MIT License

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.

adafruit_python_bme280's People

Contributors

dewhisna avatar ladyada avatar microbuilder avatar ms3fgx avatar ryankurte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_python_bme280's Issues

Example code mislabels t_fine output as "Timestamp"

The Adafruit_BME280_Example.py code outputs the sensor.t_fine value with a label of "Timestamp", but from what I can tell this is actually a "fine temperature" value used in pressure and/or humidity compensation calculations. It doesn't appear to have anything to do with time and is probably of little value to anyone except in debugging. See for reference section 4.2.3 of the datasheet http://www.adafruit.com/datasheets/BST-BME280_DS001-10.pdf .

Make a PyPI package

I think it would be nice to have this as a PyPI package. Is anyone looking into this already?

Python program for subscription and publication of BME280 Sensor in RPI 3 in MQTT broker

Dear Friends,
I am doing a master project in IOT!
How can I Publish and subscribe RPI 3 -BME280 sensor data in MQTT broker using Python script??
I know the simple message subscription and publication python programs, but to publish BME 280 sensor data and subscribe the published data in MQTT protocol, I don't know. Could anyone help me with this issue?
Thanks in advance!

Regards,
Thangaraj

Humidity calculation uses 16384.8 instead of 16384.0

From what I can understand of the datasheet (6.2.3 Compensation formulas), it seems that there is a typo in the code: the value 16384.8 is used instead of 16384.0.

It produces a little error in the humidity value.

read_raw_temp() will "fail" with BME280_STANDBY_0p5 for high-rate conversion

read_raw_temp() blocks for the conversion-in-progress indication to drop before trying to read. While this may be appropriate for the BME280 "forced" mode, data is available at all times for "normal" mode, as far as I can discern from the data sheet and my experience.

In the case that high-rate operation is desired, BME280_STANDBY_0p5 reduces the standby time between conversions to 0.5 ms. As a result, the use of time.sleep(0.002) will often "miss" the window between when the conversion is completed and another begins. What should be jitter of the conversion period itself, now can be several periods. In early testing, I was seeing delays that often were 100-300 ms with a conversion period of under 50 ms.

If anything, the check should probably be done on bit 0, the "im_update" flag. It probably should be done with a block read of the sensor data, as I imagine that the duration of the time that the data in the registers many not be valid is very short. As that is described as an "NVM" data copy, I'm not sure that it even impacts the sensor registers (see data sheet section 7.4.4).

Should the library ever be expanded to support "forced" mode directly (the ability to write the proper registers is not exposed in the current API) there would be a need to have a blocking read until the conversion is complete. Until that time, this blocking behavior is detrimental for high-rate sensing applications.

For anyone reading this, one work-around is subclass BME280 and override read_raw_temp() removing the blocking wait

        # while (self._device.readU8(BME280_REGISTER_STATUS) & 0x08):    # Wait for conversion to complete (TODO : add timeout)
        #     time.sleep(0.002)

Returns 0.00% humidity for BMP280

Hi,

when running it on a Pi Zero with a BMP280 connected via i2c it returns 0.00 for humidity:

root@zero:~/Adafruit_Python_BME280# python Adafruit_BME280_Example.py 
Timestamp = 114731.000
Temp      = 22.409 deg C
Pressure  = 986.51 hPa
Humidity  = 0.00 %

Is there a way to get the humidity?

Support different operating modes and soft-reset

Hi,

I modified the library to be able to put the device in sleep mode (almost no power consumption) when I don't need it and to support a soft-reset, because sometimes my sensor gets stuck and reports the same temperature for hours. Until today I always just unplugged all wires when that happened. Next time I'll try to reset the sensor.
I would like to contribute these changes here (if you're interested, that is), but I have no clue how github works. I need a pull request, right? Do you have a little tutorial for me to start with? :)

Greetings!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.