Whinis' Webpage
About Me
Hobbies
Projects
Random Pictures

Alti 0 Post


Created :04-24-2021
Last Updated:10-23-2023 13:25
How does a pharmacology graduate student build the worlds smallest altimeter?

Building The Worlds Smallest Altimeter

I have been working on this for quite a few years and originally wanted to make it a product but various things in my life prevented it. Overall this project was started as a dare as a manner of speaking, one of my gaming friends was an avid skydiver and complained about the cost of sky diving computers. During a conversation one night I stated that I felt I could make a cheaper alternative to the current ones and likely have more features. He doubted me but also told me there was no way I could do it and dared me to try. To add challenge he suggested we make this a HUD type system so that it didn't need to be one your wrist. I accepted the challenge

I knew that this device needed to be stable as it is a life-critical device similar to many scuba devices I use. From my research I also knew that rechargeable was preferred although a watch battery would also work if it was one of the common ones held at flight centers for other computers. My very first attempt was completed, ordered, and assembled within just a few weeks of our talk at the beginning of 2018 and left a fair amount to be desired as can be seen below.

First Board

I decided to go with two smaller batteries to get the ~ 3v typically required of most micros and screens. A ribbon cable was used to control the screen and interfaced directly with the micro. 4 pots were used to control various settings as I assumed they would not be changed often. A physical power switch was also used. Overall the screen was too large and expensive to be useful as a HUD as originally planned, the programming header used far too much of the board real estate, the pots control method was also much less than ideal, finally the processor I chose, a MSP430, had a rather difficult programming sequence that I was not aware of. The first prototype got bricked during programming so as some fun I pumped 20v into it and it exploded a bit as you can see in the image above.

I took the first version as a lesson and redesigned it from the ground up attempting to think of how I could decrease its size and make it more flexible. First step was choosing a well supported microprocessor, I found the ATSAMD21G set of micros which would work down to 1.8V without issue. This gave me a footprint and voltage to shoot for regarding the other components. For the battery I need a common battery but also preferably a rechargeable one. I wanted as much energy density as possible while staying within my power envelope, this led me to CR2450's. They come in a rechargeable as well as non-rechargeable form. The voltage profile of both are within the range required if a LDO regulator is used, and they are very common batteries to get. I then went with a common MCP73831T battery charger and battery voltage checker using a MIC94090 switch which allowed me effectively completely disconnect the battery and prevent as much parasitic drain as possible. Finally I needed a regulator to power everything and decided a NCP512 as it came in a relatively small package and allowed for a variety of voltages from 1.8 to 2.6v.

So this was cool, I had most of the basic functions I required but what about a screen? I already needed a large USB connector for charging and theoretically programming, adding a ribbon connector wouldn't work so well and the previous attempt was too bulky. So I looked at my options and realized that a USB 3.1 USB-C cable had plenty of extra pins, also if I didn't need it for communication I could reuse other pins.So I did just that and designed a separate board to house the screen only, with a high side switch for power should it become submerged. Added in a couple of LEDs for alerting the skydiver if the screen was not enough. This greatly reduced the footprint required. This however also meant I needed abit more circuitry main board side. To start I needed to prevent 5v from back feeding the VCC lines so added a MAX40200 ideal diode allowing me to turn off the power to the screen in event of overload but also prevent 5v from feeding Vcc. For more protection I also added a MAX9938 to monitor the current heading to the USB port from VCC in case of a short circuit.

This board was already getting significantly more complicated than the last and I had not even attempted to test it yet but a few features were left to go. A common aspect of most of the more expensive computers is a log to track the speed of your fall and your settings. This is simple enough to include so a MX25R6435 flash was added with more than enough space to hold everything. Another common feature is a buzzer for audio as well as visual alerts, so a common buzzer that would work off the battery voltage and would be switched by a BC848 was added. To keep settings as well as time for logs a RTP was added with a small eeprom, the MCP79410. For controls I added a set of 4 buttons set as up, down, set, and power. Finally to ensure accurate readings the LPS33HWTR was chosen to be both within the required voltage level and ease of interfacing.This completed the altimeter except for one important part, power management.

The first version had a physical power switch to allow total disconnection, this wouldn't work for this due to size limitations but also due to the requirement for the RTC to keep power.I looked on the market for many years but never managed to find a cheap power management chip to be turned on/off with a single button that was cheap with the only versions I found being over $4 an IC. Ideally I wanted the power button to work as a normal button, but also allow you to turn the device on, and finally turn the device off if the button is held. After lots of searching I finally decided to make my own using an attiny10 whose source code can be seen at https://github.com/whinis/AttinyPMIC . I added a TCR3UM18ALF to power just the attiny10 and designed it to pass in the button press directly to the micro.Finally I added a diode and several large capacitors to power the RTC and its eeprom while swapping the battery allowing up to 6 hours of time from removing a mostly dead battery to installing a new one.

The final design can be seen here

final board design

Testing showed that it could last 50 jumps off the charge of a single rechargeable CR2450 or over 200 off a non-rechargeable one. Power draw in sleep mode allowed it to use less than 50 microamps with nearly a picoamp when off, far below the battery self discharge rate. While I planned to eventually sell it issues came up with usability in testing and my sky diving testing partner lost interest. All code can be found on my gitlab https://gitlab.whinis.com/alti-0-altimeter including for the hardware schematics and gerbers. One interesting change I made to the bootloader is support for signed and encrypted UF2 files to prevent code copying.