0

Raspberry Pi and the BMP085
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Raspberry Pi and the BMP085

by ktownsend on Mon Sep 02, 2013 3:14 pm

I just pushed a change to the BMP085 sketch that handles the 16-bit reads inside the BMP085 driver (which is where they should have been to begin with), calling Adafruit_I2C for the standard 8-bit reads.

https://github.com/adafruit/Adafruit-Ra ... 085.py#L66

Let me know if you have any problems with this!

ktownsend
 
Posts: 1222
Joined: Thu Nov 05, 2009 2:18 am

Re: Raspberry Pi and the BMP085

by static on Mon Sep 02, 2013 5:06 pm

Actually, it wasn't that issue that I read. It was another group that was having issues.

Is anyone getting good output from this? It sounds like some folks aren't having an issue. They've got to be doing something differently.

static
 
Posts: 182
Joined: Thu Dec 23, 2010 6:21 pm

Re: Raspberry Pi and the BMP085

by ktownsend on Tue Sep 03, 2013 4:06 am

Static wrote:Is anyone getting good output from this? It sounds like some folks aren't having an issue. They've got to be doing something differently.


My second last post should answer that ... you can see valid output from the sensor using the latest code from github. :)

ktownsend
 
Posts: 1222
Joined: Thu Nov 05, 2009 2:18 am

Re: Raspberry Pi and the BMP085

by bigt on Wed Sep 04, 2013 1:10 am

I pulled the latest code down from the repository today, and the readings are correct now with no mods to the I2C code.

bigt
 
Posts: 4
Joined: Sun Feb 26, 2012 2:50 am

Re: Raspberry Pi and the BMP085

by F481 on Thu Sep 05, 2013 10:44 am

Yeah, it's working correctly now! Thanks. =)

I think a major feature is missing atm.. the calculation of the real altitude.
I opened a pull request for this: https://github.com/adafruit/Adafruit-Ra ... de/pull/56
F481
 
Posts: 4
Joined: Mon Sep 02, 2013 6:42 am

Re: Raspberry Pi and the BMP085

by ktownsend on Fri Sep 06, 2013 9:52 am

I should really work these into the Adafruit drivers, but I always cringe whenever I touch them now since so many people depend on these files.

But here are some helper functions I wrote for pressure sensors for myself that you may find useful.

It should be possible to move them over to Python without too much effort: https://github.com/microbuilder/LPC11U_ ... pressure.c

- Convert barometric pressure to altitude
- Calculate sea level pressure from barometric pressure at a known altitude
- Calculate the estimated temperature at a given altitude
- Calculate the barometric pressure at a given altitude

Note: Pressure is in hPa, temperature is in C and altitude is in m

ktownsend
 
Posts: 1222
Joined: Thu Nov 05, 2009 2:18 am

Re: Raspberry Pi and the BMP085

by F481 on Fri Sep 06, 2013 5:38 pm

I didn't modify your code, I only added new functionality.. so it should work fine.
Sure you have to test it, perhaps it would be helpful to create an extra branch to merge and update the driver with critical code.

I don't know if your helper functions are useful for the BMP085.. the formula in the datasheet is different to yours.
If you need any help or information, contact me. I can do some more work on it.
F481
 
Posts: 4
Joined: Mon Sep 02, 2013 6:42 am

Re: Raspberry Pi and the BMP085

by hagak on Tue Dec 31, 2013 5:46 pm

I just recently received a BMP180 to use with a Rpi.

When I run sudo i2cdetect -y 1

I get the expected result showing 77.

However when whenever I run the latest Adafruit_BMP085_example.py, I get the following errors:
Error accessing 0x77: Check your I2C address

I noticed Adafruit_BMP085.py does not seem to need editing for RPi v2 as it appears to try to autodetect it. However in an attempt to solve the issue I did change
Code: Select all | TOGGLE FULL SIZE
#self.bus = smbus.SMBus(
    #  busnum if busnum >= 0 else Adafruit_I2C.getPiI2CBusNumber())


to
Code: Select all | TOGGLE FULL SIZE
self.bus = smbus.SMBus(1)


Still same result

hagak
 
Posts: 3
Joined: Tue Dec 31, 2013 5:40 pm

Re: Raspberry Pi and the BMP085

by adafruit_support_mike on Wed Jan 01, 2014 2:55 am

Are you running the script with `sudo`?

You need root permission to use the GPIO ports on a RasPi.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

adafruit_support_mike
 
Posts: 37301
Joined: Thu Feb 11, 2010 2:51 pm

Re: Raspberry Pi and the BMP085

by hagak on Wed Jan 01, 2014 12:49 pm

Yes I am running with sudo.

I decided to test my other I2C device, an LCD display. The LCD and buttons work great. Note though that if I connect both the LCD and BMP180 while i2cdetect sees both I can no longer communicate to either LCD or BMP180 until I disconnect the BMP180.

hagak
 
Posts: 3
Joined: Tue Dec 31, 2013 5:40 pm

Re: Raspberry Pi and the BMP085

by hagak on Wed Jan 01, 2014 2:32 pm

I figured it out. Completely forgot the power rails on breadboard is split in the middle. So my GND was not actually connected. What threw me off was that i2cdetect was seeing the device correctly.

hagak
 
Posts: 3
Joined: Tue Dec 31, 2013 5:40 pm

Please be positive and constructive with your questions and comments.