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.

### Concept

The height with respect to sea level and atmospheric pressure is related through the formula: 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 try { window._mNHandle.queue.push(function (){ window._mNDetails.loadTag("814427361", "300x250", "814427361"); }); } catch (error) {}

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

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!

## Arduino Compass with HMC5883L Magnetometer

In general terms, a magnetometer measures the magnetism of objects or places. In fact, a …

### One comment

1. Thanks, it is very informative

This site uses Akismet to reduce spam. Learn how your comment data is processed.