Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensor: Added support for the BME280 from Bosch. #72

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

cfreeman
Copy link

Combined humidity, pressure and temperature sensor. Data sheet -- https://cdn-shop.adafruit.com/datasheets/BST-BME280_DS001-10.pdf

@cfreeman
Copy link
Author

cfreeman commented Sep 29, 2016

Doh. Sorry, still got my github training wells on. Not sure why support for the intel edison got automatically inserted into this pull request. Was aiming for a seperate pull request for that.

Pin outs for the Edison are based on this 'block' from sparkfun -- https://www.sparkfun.com/products/13038

@tve
Copy link
Contributor

tve commented Sep 29, 2016

when you open a PR it's for the delta between your branch and the base branch (such as master). Afterwards, as you add more commits to your branch these automatically go into the PR, so the PR is a "live" diff and not a diff snapshot.

@tve
Copy link
Contributor

tve commented Sep 29, 2016

I see an issue with your bme280 driver, which is that on page 21 section 4 & 4.1 of the datasheet it says "Shadowing will only work if all data registers are read in a single burst read. Therefore, the user must use burst reads if he does not synchronize data readout with the measurement cycle." So you should use a single read to read all registers into memory and then parse out the individual register values. This will also be a lot more efficient since that's only a single system call.

@cfreeman
Copy link
Author

cfreeman commented Sep 29, 2016

So the humidity, temp and pressure methods should read all of 0xF7 to 0xFE using

func (b *i2cBus) ReadFromReg(addr, reg byte, value []byte) error

That will perform a burst read?

Then assemble the uncalibrated pressure, humidity and temperature values from that []byte array?

@cfreeman
Copy link
Author

func (s *BME280) Measurements() ([]byte, error) {

Now performs a burst read (I think?) of all the measurements, while Humidity, Pressure and Temperature can be used to calculate calibrated readings from this data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants