Sparkfun: BMP085 Barometric Pressure Sensor
The BMP085 Barometric Pressure Sensor is a sensor that can measure the atmospheric pressure as well as the temperature at its location. It communicates with host devices via I2C.
Connecting the Hardware
To connect the BMP085 to a BeagleBone, first supply the Vdd and GND from the Beagle to the BMP085 Breakout Board. Then connect SDA and SCLK from the BMP085 to one of the I2C bus pins on the Beagle. The XCLR and EOC pins do not have to be connected to the BMP085.
Reading the Pressure and Temperature
My BMP085 showed up at I2C address 0x77. To initilialize that sensor, type the following in your terminal:
echo bmp085 0x77 > /sys/class/i2c-adapter/i2c-3/new_device
If this was successful, enter:
dmesg | grep bmp
You should see:
[10420.903490] i2c i2c-3: new_device: Instantiated device bmp085 at 0x77 [10420.927608] bmp085 3-0077: BMP085 ver. 2.0 found. [10420.927659] bmp085 3-0077: Successfully initialized bmp085!
Congratulations! You're sensor is connected and ready to read the temperature and pressure at its location.
To read the temperature (in degrees C), type:
echo scale=1 \; $(cat /sys/bus/i2c/drivers/bmp085/3-0077/temp0_input) / 10 | bc
To read the pressure (in millibars), type:
echo scale=2 \; $(cat /sys/bus/i2c/drivers/bmp085/3-0077/pressure0_input) / 100 | bc