Closed quantenschaum closed 9 years ago
Please raise this on the support forums. We can't do support via github since the support team doesn't monitor the issues actively here (they aren't subscribed to every repo for alerts, etc.).
@quantenschaum Did you get anywhere with this query?
I don't remember exactly what I did, but on a similiar setup with different hardware the issue disappeared. Probably it was a fault of the single device I was using.
I'm using a BMP180 pressure sensor hooked up to a Raspberry Pi on the I2C bus. I read the data from the sensors using your BMP085 library. This works fine in general, but sometimes I get bogus values for the pressure (I did not monitor temperature). These wrong values are always smaller than the correct (within the device's accuracy) pressure value.
I'm logging the pressure data with rrdtool and this is what I get (y axis ranges from 980 to 1020):
The blue curve shows the values in question, a new value is fed into the RRD every 10s.
I looked into the datasheet of the BMP180 and found that after requesting a conversion (measurement) you need to wait some time before performing the readout of the data from the sensor. Depending on the sensor mode this takes about 5 to 26ms (page 12).
The code in
Adafruit_BMP085.py
reads:So, python's
time.sleep()
is used to make the code wait for the conversion. This seems to be a problem, since the timing is not sufficiently accurate (maybe?). If I reduce the sleep time, I always get bogus results. Increasing the sleep times by a factor of 10 seems to make it better, but does to fix it in general.What is going on here?