[Edit]; See version 2 in step 6 with manually baseline altitude input.
This is the building description of an Altimeter (Altitude Meter) based on an Arduino Nano and a Bosch BMP180 atmospheric pressure sensor.
The design is simple but the measurements are stable and quite accurate (1m precision).
Every second ten pressure samples are made and the average of these ten is calculated. This pressure is compared to a baseline pressure and is used to process the altitude. The baseline pressure is measured at the moment the altimeter is powered on so this represents an altitude of zero meter. If necessary the baseline pressure can be reset by pushing the button.
[Edit]: Version 2 has manually baseline altitude input. See description in Step 6
During setting the baseline (power on or button push) the current atmospheric pressure is displayed for one second. After this the altitude is on the 4-digit display and this will update about every second.
A red led is used for negative altitudes when going down-hill after setting the baseline.
[Edit]: With Version 2 this represents negative altitudes so below sea level.
The altimeter is powered by an USB cable so can be used in a car, motorcycle or on every other place with USB or a power bank.
The BMP180 is not the newest version. It seems to be
replaced by the BMP280. It should be simple to replace the BMP180 with the BMP280 in this design.
Parts of the sketch are based on the “BMP180_altitude_example.ino” delivered with the BMP180 library.
Step 1: Breadboard to Test the Design
I started with an Arduino Uno to test the design. In the final version I used a Nano because it's smaller.
Step 2: Board Creation and Housing
One single board is used. The cover of the housing holds the button, the led and the 4-digit display.
Step 3: Arduino Pin Connections
Connections for BMP180:
GND - GND
VCC - 3.3V (!!)
SDA - A4
SCL - A5
Connections for 4-digit TM1637 display:
GND - GND
VCC - 5V
CLK - D6
DIO - D8
Led voor negative values - Down-hill: D2
Button for reset baseline pressure: D4
Step 4: The Arduino Sketch
Step 5: Final
This is the result...
Step 6: Version 2 With Manually Baseline Altitude Input
In this version one extra button is introduced. Button 1 (black) is to start manually baseline altitude input. Button 2 (white) is to increase the value per digit.
Sequence during altitude input is:
Button 1 pushed - Led flashes 1 time - button 2 can be used to increase x digit in 000x
Button 1 pushed again - Led flashes 2 times - button 2 can be used to increase x digit in 00x0
Button 1 pushed again - Led flashes 3 times - button 2 can be used to increase x digit in 0x00
Button 1 pushed again - Led flashes 4 times - button 2 can be used to increase x digit in x000
Button 1 pushed again - Led flashes 5 times - button 2 can be used to change the sign: led_on=negative (below sea level), led_off=positive (above sea level)
Button 1 pushed again - Led flashes 1 time long - baseline altitude input ready
Sketch of version 2.