Kenneth M. Cruikshank
Using the Bosch BMP085 chip

Kenneth M. Cruikshank
Kinect Projects

This page documents some projects using the Arduino prototype board.

Introduction

If you found this page from a web search, you may first want to review the Arduino Introduction page and the Code Style page.

Here is the working code to read a Bosch BMP085 Temperature/Pressure sensor.

CAUTION: The sample calculation for the pressure in the data sheet is correct, but may not work as printed with when using the Arduino compiler. In a normal C compiler, a bitshift (<<) operator is at the same level as the addition (+) operator, with a Left to Right order. Thus, if there is a + and a << operator in the same line of code, it will execute the first one it encounters when reading from Left to Right. Thus A << B + C will be (A << B), and then add C to the result. Unfortunately, the Arduino compiler seems to be A << (B+ C). The sample code is wants (A << B) + C and is written out at A << B + C ... which works given the default operator sequence. However, the Arduino C does not seem to follow the appropriate sequence. So, as always, it is best to use parentheses to make sure the order is what you want. Don't rely of "default" precedence.

Temperature and Pressure Bosch BMP085

Data-sheet

 

 

Geology Department
http://www.pdx.edu/geology

Copyright © 1994-2015 · K.M. Cruikshank ·
http://geomechanics.research.pdx.edu