Home / Projects / Arduino Projects / Arduino Altimeter Project Using BMP085

Arduino Altimeter Project Using BMP085

This Arduino Altimeter project features the BMP085 atmospheric pressure sensor by Bosch. Because atmospheric pressure is directly related to altitude above sea level, we can use this sensor to determine current height with respect to the height of the oceans. The height is given in meters and is displayed on a Nokia 3310/5110 LCD.

Materials

Concept

The height with respect to sea level and atmospheric pressure is related through the formula:

{\displaystyle p\approx p_{0}\cdot \exp \left(-{\frac {g\cdot M\cdot h}{R_{0}\cdot T_{0}}}\right)}

Where

p0 = sea level standard atmospheric pressure = 101325 Pa
T0 = sea level standard temperature = 288.15 K
g = Earth-surface gravitational acceleration = 9.80665 m/s2
M = molar mass of dry air = 0.0289644 kg/mol
R0 = universal gas constant = 8.31447 J/(mol•K)

Since most of these values are constants, we can create a simple formula to convert pressure to height. The Adafruit BMP085 library has done that for us and reading the altitude is simply:

This function, however, always assumes that sea level pressure (SLP) is always 101325 Pa which is not the case. The actual SLP can be the parameter for this function for a more accurate altitude reading. For example, this is what Accuweather tells me about my city:

That’s 29.80 inches of Mercury (another unit of pressure). A quick google reveals that this is equivalent to 100.9144 kiloPascals. I then used this value to adjust the altitude readings.

Wiring Diagram

 

The wiring between the BMP085 and Arduino Nano is simple:

BMP085 Arduino
SDA A4
SCL A5
VCC 5V
GND GND

Here’s the connection between the Arduino Nano and the Nokia 3310/5110 LCD:

Nokia 3310/5110 LCD Arduino
RST D3
CE D4
DC D5
DIN D11
CLK D13
VCC 3.3V
LIGHT 5V
GND GND

Arduino Sketch

For using the Nokia 3310/5110 LCD with the Arduino, I used Adafruit’s PCD8544 library and GFX library . More information about this library can be read on my Arduino Nokia 3310 interfacing article.

As for the sensor, I wrote an Arduino BMP085 tutorial on how to use it with Adafruit’s BMP085 library .

These libraries made the project fairly simple. All it needs to read altitude is this function:

The 100914 parameter is the SLP in my area according to Accuweather.

Writing to the LCD is simply,

The rest of the sketch are just for setting up the display (text color, size and contrast).

Project Images

Here’s some images for this project:

If you would like to replicate this project, I have provided the sketch, wiring diagram and libraries in one file for you:

Make sure you copy the libraries to Documents/Arduino/libraries! Have fun building!

Check Also

Arduino Motion Activated Alarm

Arduino Motion Activated Alarm

This Arduino motion activated alarm features a tilt sensor for detecting movements and a piezo …

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *