• getConstants()
• get Temp(Celsius, Fahrenheit)
• getPressure(Pascals, Station, MSLP)
Now’s the time to mention that the BMP085 spits out
the atmospheric pressure in Pascals — a member of the so-called International System of Units. If you live in the
United States, you’ll probably find the traditional inches-of-mercury (inHg) scheme more familiar. The firmware takes
care of making this conversion. But there’s more!
The sensor reads the actual or absolute atmospheric
pressure of wherever it is sitting — whether you live in a
cave far below the surface of the earth or on top of a
mountain. This is referred to as station pressure.
On the other hand, newspapers and television
broadcasts report readings in what’s called mean sea level
pressure, abbreviated MSLP. The station pressure is
converted and standardized to what it would be if you
lived at sea level. This makes it
easier to compare values and trends
over vast regions of the earth.
Clearly, MSLP depends upon
the elevation of where you’re living.
I visited City Hall and found the
value for my very block from one of
the kindly civil engineers there.
In the source code, you’ll note
the constant BMP_PRESS_FACTOR
and how to set it based on your
elevation. If it isn’t clear, the
getPressure command in the library
file returns values for all three
systems: Pascals, station pressure,
and MSLP (the latter two in inHg).
Solid-state barometers tend to
bounce around a little compared to
mechanical types which, in effect,
exploit inertial averaging. To mitigate
this, the BMP085 has four different
levels of operation governed by
what the manufacturer calls the
“over-sampling setting.” It’s really
nothing more exotic than finding the
mean of several consecutive
readings.
Provision is made for taking
averages of one, two, four, and eight
samples, and this is set by the
constant BMP_OSS (with a value of
0, 1, 2 or 3, respectively). If you
look into the code, you’ll find other
niceties, along with various hints,
tips, and explanations.
Figure 4 shows my test rig
cranking along. In the top row of
the display, the temperature is given
both in Celsius and Fahrenheit. The
bottom row shows the station
pressure and the MSLP.
With that, you should be all set
to begin crafting your own
barometer with the BMP085. May
your forecasts ever come true! NV
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;
)('&(%$#""%!(&&% ; ;;;
; ;;;;;%;;;;;;;;;%;
)$);%
%;;
;;;%;;;;
;;;; ;;;;;;;;;;;;;;;; ; ;;;
);;;;$);%;;$;;
;;))!%;);;;;$);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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