Please vote for this Instructable if you think it deserves it! Thanks!

The Ultimate Altimeter is a super-compact, Arduino controlled altimeter capable of measuring the altitude with an accuracy of 0.3 meters, and saving the highest and lowest values it has measured. It is powered by a 40 mAh Lithium Polymer battery, uses a tiny LCD Bubble Display, and measures altitude with a MPL3115A2 Altitude Sensor. It's very simple and fairly easy to build with just six major components. Additionally, an optional 3D printed case can house the Altimeter.

The Altimeter has a couple of different modes: current altitude, highest altitude, lowest altitude, difference in altitude (highest minus lowest), and standby (turns display off to save power for ~6 hr battery life, not shown in video).

The entire build adds up to around $30, but you may have some or most of the parts lying around already.

You can make this! It is not a very difficult project, and could be good practice for through-hole soldering, and coding (if you want to do modifications). Read on and create!

Step 1: Materials List


Arduino Pro Mini

MPL3115A2 Altitude Sensor

Bubble Display

40 mAh LiPo battery



JST connector

Tools and other materials:

Soldering iron


Flush cutters or wire cutters

Wire strippers

Electrical tape

Liquid electrical tape or other insulative paint (you could also use regular electrical tape or heat shrink tubing)

24 guage stranded wire

Hot glue gun

FTDI Basic

<p>I made it using a BP180 instead of the MPL3115A2 and added in a charge cable. Works well! I also added in a calibration offset and am working on making this adjustable without reprogramming.</p>
<p>Had a few requests for my code using the BP180,</p><p><a href="https://drive.google.com/file/d/0BzWffzyOLS1vWERUd3I2c1NVX28/view?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0BzWffzyOLS1vWERUd...</a></p>
<p>Hi StephenC15.</p><p>I would like to build using the BMP180. Could you share your code?</p><p>Thanks!</p>
<p>Just finished to build and calibrate my second one using BMP180 sensor and StephenC15's code. I wanted to build cheaper using the BMP180 sensor to gift to my RC buddies, and StephenC15's code was the solution.</p><p>Thanks a lot Stephen, and Qubist for the original idea.</p>
<p>For those of us that live in high elevation, would this work for a five digit display?</p>
<p>Also, also want to have the display in feet. For us american folk.</p>
<p>I placed my Spark fun order. I added a DeadOn RTC <a href="https://www.sparkfun.com/products/10160" rel="nofollow">https://www.sparkfun.com/products/10160</a> and an OpenLog https://www.sparkfun.com/products/9530</p><p>I'm making a HUD altimeter for skydiving. I'll post back as I make progress.</p>
<p>Hey Richard,</p><p>I know it is a year or so later, but found this info as I am looking for a HUD for skydiving. Did you manage to get some kind of HUD working for skydiving. I would be interested.</p><p>Regards</p><p>Trevor.</p>
I have built out the hardware and developed the software and made several jumps (and skiing, and downhill mountain biking) with it. However, as of yet I've only ever had it safely tucked away in my pocket. I have never managed to figure out to get the optics set up to allow me to actually READ the display when it is in close proximity to my eye. I have done much experimentation and tried to talk to many people about it. I've even tried getting my question answered on the weekly Ask An Engineer program done by Adafruit. They have never taken my question. I haven't updated my Open Source project because I ran out of storage space on the Atmel and had to do a lot of hacking to get it to fit. I'm planning to rewrite it for the Particle Photon https://store.particle.io/?product=particle-photon but without the optics, I'm kind of stalled.
Did you get anywhere with you HUD project, as I am currently working on a very similar project
<p>Hey Dominic,</p><p>I am looking for a HUD for skydiving. What have you done so far?</p><p>Thanks</p><p>Trevor.</p>
<p><strong>Dude! </strong>This sounds soooooo awesome! Definitely share how this goes. I've always thought about having an Arduino turn itself off/on with code and it seems like this is the way to do it! Can't wait to see the end result!</p>
<p>Excellent project... I am gathering the parts now to build it for some balloon tests I am running... I do have one question - would a 3.7V 600mAH Lipo work in place of the 40mAh one?</p>
<p>Here is my setup in a small plastic bottle that was utilized for eye drops...</p>
<p>COOL man I think I may go that route, I have several of those type bottles.</p>
<p>Just returned from our trip to the Custer Battlefield in MT, and Yellowstone Ntl Park in Wyoming. An altimiter would have been a nice addition to our Motor Home sensor setup. You haven't done anything till you are guiding a 36 foot Class A motor home through Yellowstone, on under contruction highways, and your breaks fail! As we used to say when I was a kid, WHAT A TRIP MAN! Everything came out OK other then the 1800 dollar bill for new front breaks, and later on 360 dollars for two blown tires (on the rear, thank God) and 160 bucks for new exhaust pipes where the blown tires blew the old ones off! Going to make one of these for my next trip. I have the bubble display that I purchased for another project, then blew the wearable arduino before getting them soldered on. Thanks a MILLION for the DIY, it is exactly what I wanted. I have a 3 volt arduino on order, but am considering going forward with a 5-3.3 volt board.</p>
<p>An excellent project!</p><p>The use of the bubble display is inspired. According to the sevSeg cpp </p><p>&quot; //Each digit is displayed for ~2000us, and cycles through the 4 digits<br> //After running through the 4 numbers, the display is turned off &quot;</p><p>So no continuous current demand to damage parts at 8mS per display. As the cpp advises repeatedly call the library to continue viewing the displayed items.</p><p>I did find a bug in the SevSeg library- if you want a decimal point at the 3rd digit you have to specify 4. (strange multiple decimal points appear when specifying for digits 2 and 3)</p><p>I built the hardware in a similar manner to the instructable. I opted for a more standard radio control type single cell lipo with two wires from the raw and gnd to a miniature trailing 1.25mm plug. I have some indoor planes and already have the tiny lipos and charger. I made the enclosure with balsa, resulting in an all up mass of 10g (The same mass as a standard rc plane servo).</p><p>I found the MPL3115A2 library to be a bit buggy and have rewritten the code without the sensor and debounce libraries.</p><p>I have added pressure calibration by using the base altitude to reverse calculate the pressure at sea level. This pressure must be correct for accurate altitude fixes.</p><p>As the fix also depends on temperature, I added a temperature adjustment.</p><p> Here is the code <a href="http://www.davepatterson.me.uk/public/Mini_Altimeter.ino" rel="nofollow">http://www.davepatterson.me.uk/public/Mini_Altimet...</a></p><p>The accuracy is fine. Sitting in the house the altitude varied by 5m. This is no worse than a 3d gps fix (vertically.)</p><p>The temperature response is slow- hardly surprising as the temperature sensor appears to be inside the MPL3115A2 case. </p><p>Thanks for the inspiration!</p>
<p>After tinkering with the code...I was able to adapt it to my location's elevated altitude of 540 meters by replacing your Float ALTBASIS to 540 and also the line for tweaking base altitude ....if(ALTBASIS &gt;600) ALTBASIS =500 If I would have kept it at -10 you can imagine how long I would have to depress the button to reach my area's base altitude that is in the mid 500 meters. Again thanks for you code and especially to qubist for sharing this great project!</p><p>Is there a location in the code to reflect displaying feet vice meters? </p>
<p>To convert to feet, why not asign a variable to the last line in alt_read:</p><p>float something = ((float)((m_altitude &lt;&lt; 8)|c_altitude) + l_altitude);</p><p>Then multiply by the conversion factor for metres to feet, before returning the value.</p><p>You would have to fiddle with the code for tweaking altbasis to adjust your base height. </p><p>On the down side this limits you to 9999 feet, which is not very high!</p><p>That's why I chose metres, because of the 4 digit limitation.</p>
<p>would it be a viable solution to have the display in feet but the have the altitude divided by 1000 and expressed to 2 decimal places for a total of 4 displayed digits? this would remove the 9999ft altitude ceiling.</p><p>my only experience in this field has been this project but it occurred to me that it could be a viable solution. thoughts would be much appreciated.</p>
<p>for example if we use alt (expressed in metres) represented by x and multiply it by the factor to convert to feet (3.28084 as provided in the alt sensor library), divide the result by 1000 and display to 2dp</p><p>(3.28084(x))/1000</p><p>eg- x=1200 metres</p><p>displayed as 3.94</p><p>or am i following an incorrect line of thinking?</p>
<p>Hi Ricky,</p><p>If you divide ft by 1000, then display to 2 decimal places, the result is to the nearest 10 ft.</p><p>99.99 would be 99990ft.</p>
<p>I made this using headers to prop up the bubble display for enough room to put a battery underneath. I am using a 3.7V 30mAh RC plane battery. I had problems verifying the libraries but after updating Arduino to 1.6.5, it worked. I am having a few issues with accuracy, though. I live at 3600 ft and the altimeter says 3300. Not sure how to correct this. Any help would be appreciated as i am an Arduino newb. Great project! Thanks!</p>
<p>This is an AWESOME project!! It took a little time to get the bubble display but everything is working perfectly. The hard part was getting everything to balance properly on my tiny quadcopter. I had to make a few tweaks to the 3D printed enclosure but for the most part everything went together well. Thank you for your time and efforts.</p>
<p>I can't get the Ultimate Altimeter code to verify. Anyone else have that problem?</p>
<p>Hi, I had a problem with the code, would not verify. </p><p>If it says, MPL3115A2 dose not name a type, And saying it could not find file or directory. Every thing was correct it just would not verify. I updated the Arduino software to the latest version and the code verified OK ?,and loaded OK.</p><p>Just had my first test with it today on a V636 in very high/gusty winds, took it up to 109mtr from the ground.</p><p>I am using David Patterson code as this has temperature sensing, standby, height adjust as well.</p><p><a href="http://www.davepatterson.me.uk/public/Mini_Altimeter.ino" rel="nofollow">http://www.davepatterson.me.uk/public/Mini_Altimet...</a></p>
<p>Made it up at last, Sent for the parts when instructable first got posted, Managed to keep it compact (see pics) but putting all the components on the back of the Arduino. </p><p>Used shrink tube for 18650 lipo as it very thin and light, with battery 110mAh it ways in at 7.3gram. </p><p>Many thanks for the ible,and input from all as i know zip about coding.</p>
<p>After playing around with the sensor, I noticed that it calculates the altitude by observing the air pressure, which makes it not very useful for rc planes as the airflow will disturb the pressure around the sensor. so my question is: how do you get around this?</p>
<p>sorry, I didn't read the last part of the instructions! Thank you!</p>
<p>Kudos on a great design. I want you to know that you've helped a kid out with a science project. The idea was to test the effects of temperature on model rocket altitudes. Since the project isn't due until May that will give him a wide variety of temps to test in.</p><p>Today it was 33&ordm; and we launched on a frozen lake. On the the last flight I heard a &quot;ping&quot; well before the rocket drifted down and my son retrieved it. He immediately started looking around. &quot;Oh no.&quot; I thought in horror.</p><p>&quot;What are looking for?&quot;</p><p>&quot;The nose cone is gone!&quot;</p><p>&quot;And the altitude sensor?&quot;</p><p>&quot;It's gone too.&quot;</p><p>&quot;Crap!&quot; (or something like that)</p><p>After some hunting we were able to find both the nose code and the sensor, - and it was still working! This after a 700 ft drop onto the ice. We never would have found it in grass.</p><p>Thanks again !</p>
<p>Just what I need! I want to place it in the corner of the image of the the Go Pro on my DJI Phantom. I bought an Estes but I didn't research it enough and it was a waste of money (good for rockets to measures peek alt only).<br>All I want is current altitude displayed, that's it - if anyone has one made and is willing to sell it, please let me know.<br>Thanks!</p>
<p>Hello qubist, </p><p>not knowing your project, i was making nearly the exact same thing! I only used a different altimeter sensor, a cheap 2$ BMP 185 from ebay worked well. Needing an Altimeter for my Model-Rockets and beeing unhappy with commercial altimeters (very expensive) i decided to make my own.</p><p>My first version (tested on a quadcopter) only saved the highest altitude to EEPROM and i had to read out the EEPROM saved Data on a pc via TTL connection. I had the wish for a really small display to read out altitude on field, and the smallest i could find (on model rockets every gramm counts!) was the 7 seg bubble display from Sparkfun you used as well!</p><p> My first idea was to use PWM Output for the common cathodes, to make the design as small as possible (without resistors), but for now i made this &quot;secure&quot; version. I soldered 330 Ohm SMD resistors to the segment pins, as i like to play with multiplexing and do not use any 7seg librarys in my sketch (only some minor code fragments). Still very small and only one 2,54 mm spacing wider than the pro mini pins (see attached image). Hole setup was also tested on a breadbord, i&acute;m only waiting on my new order of 3,3V pro mini&acute;s without header-pins, to solder the display and sensor directly on the arduino pro mini board. </p><p>That was really fun to see, that someone build nearly the same thing!</p><p>greetings from Germany<br>Ardufreak</p>
<p>That's Awesome ! </p>
<p>Hi, nice project! I'm thinking about use just the Atmega 328 micro controller from arduino UNO(rather than the entire board) and external components needed (capacitors, crystal) to make it smaller and lightweight. Maybe it can be supplied by a lithium battery (ie. CR2025) and turn the display timed (press the buttom and the display keeps on for seconds). Its just suppositions hehe, I'll make and post the results. Again, nice work dude, congrats.</p>
<p>Works great on my Quadcopter thanks for the cool little project... I first tried other Altimeter sensor's that looked the same but none ever worked.. only the Sparkfun did the trick</p>
<p>I would love to get rid of the switch and make the button act as press and hold a few seconds to turn on and agin to turn off. Any idea how to accomplish this?</p>
<p>So, this is the plan...</p><p>I'm going to add a diode and a p-channel mosfet to the project. I'm going to connect the button to the battery + rather than GND. I'll make the button supply power to the Arduino as well as be sensed by pin 3. The setup routine will activate the mosfet which will hold the power supply on. I'll watch for a long button press and that will cut the signal to the mosfet and cause the power to cut off when the button is released.</p><p>I'll post more details when I get it built.</p>
<p>Great Project Just what i have just been looking for. been on ebay and a ready made unit are expensive I fly Large Quads all the time and allways getting people asking how high is that. this is the ticket . and have all parts allready from other Arduino projects.. but the display do you think you could use a larger 7 segment display as im not worried about weight.. do you have a schematic/drawing or pin layout of this project that you could send me Thanks </p>
<p>Using a different display seems do-able, but it might be a bit tricky since the pins won't be as nicely lined up as they are on the Bubble Display. I don't have a pin layout diagram for the entire project, but there is a table in the Arduino sketch that defines all the pins for the display. Using that, my instructions, and Sparkfun's hookup guide for the Bubble Display, I'm sure you can find what you need.</p><p>Good luck!</p>
<p>Hi, HELP, My Arduino Pro mini turned up of eBay, it's 3.3v/5.0v selectable version ,</p><p>BUT it runs at 16mHz only, will it still work with your using your code (8mHz).<br></p>
<p>It should run fine. Just make sure to have the Arduino on3.3v or else you will burn everthing out. If it doesn't work, let me know and I will help you out! Good luck!</p>
<p>Thanks so much for sharing! Found this post on G+ (the youtube video that is) and love the displays! I used it as a way to learn 123d.circuits.io. I made a quick little mini pro &quot;shield&quot; with this display, and a ds18s20. I also left the i2c holes open for adding any i2c sensor later. Thanks for the idea!!!</p>
<p>Sounds awesome! You are welcome!</p>
<p>Nice. Good idea. You cut some corners though. The theory says that current limiting resistors should be for those LED. Also, from practical standpoint, there should be a LiPo charger on board. The JST connectors you used for battery won't last too many plugging-ins and outs.</p>
<p>Thanks for the feedback! Resistors are necessary for the display if you are using 5v which we are not. For 3.3v, resistors are just if you want to be super safe. I wanted to make it as compact as possible, so I left out an on-board charger. The white plastic JST connector itself should last for as long as any other connector in my understanding, but the way I stripped and soldered the battery's wires was not great. I really should have used heat shrink tubing or something. </p>
<p>For a 3v3 supply with 2v drop across the LED, you would need a 68 ohm resistor to get 20 mW. With no resistor, not only are you probably overdriving the LED, but you may also be over-driving the digital pins, which are only rated to source 40 mA each. However, there may be another source of resistance in your circuit, because 1.3v across an LED with no resistor should pull 1.3 amps, which would immediately blow the LED and maybe the digital pin or the voltage regulator.</p>
<p>Vf LED 2.0v (Max)</p><p>Vcc 3.3v</p><p>If LED 5ma</p><p>R=260 ohm</p><p>Or @ Vf LED 1.6v (Min) = 340 ohm</p>
<p>This would be right if the LEDs would be powered continuously. SevSeg library takes care of multiplexing, turning on and off the LEDs. That's why they don't blow out right away. But relying on software to take care of the current limitation is not considered a good design (think what happens if, for some reason, the multiplexing is stopped).</p>
<p>Forward voltage on a red LED is max 2V, according to the datasheet. Even if they work now, they won't work much longer, since you stress them.</p><p>I understand that space was an issue, but for your next project check Sparkfun's display hookup: <a href="https://learn.sparkfun.com/tutorials/bubble-display-hookup-guide/hardware-overview" rel="nofollow">https://learn.sparkfun.com/tutorials/bubble-displa...</a></p><p>Those particular JST connectors are used for semi-permanent connections. They are physically hard to unplug because of the retention mechanism.</p><p>(Please don't take this as criticism, but as a lesson for your future projects.)</p>
<p>OK I will take this into account next time. If I build another Altimeter I will update the Instructable.</p><p>I am OK with the JST connectors being used more than they &quot;should&quot; be. The people over at Adafruit use them all the time for wearables and never mention problems, so I am going to not worry too much about that.</p><p>Thank you so much for the feedback. I try not to take it as criticism but if I do it is my fault :P</p>

About This Instructable