Years ago, probably in 2004/2005, I built an altimeter, consisting of MPX4115A pressure sensor, MAX1241 ADC, PIC18F258 (don’t ask me why this one, instead of more common 18F252 without CAN interface), 2x16 LCD, DS1624 to measure temperature and EEPROM to save the data. I built it into box with dimensions approx. 3x6x9cm. Most of internal circuits was powered by 5V, generated from two AA cells, at the expense of current consumption – in this case 30-35mA from the batteries (you know, only the sensor draw 8mA@5V). The altimeter measured barometric pressure and calculated altitude by using known formula – nothing special indeed, just a bit of floating point arithmetic. In fact, this was the first project I actually used C language and it came very handy. User has to enter pressure at zero level – I call this reference pressure. There are two ways of how to get it: you either know it directly (from weather report) or you enter your current altitude (known from map or tourist mark), altimeter measures the current pressure at this level and from reverse calculation it spits out reference pressure to be used in further calculations.
The device just sits, measure altitude and – if enabled – saves into EEPROM memory. I can then recall the data and transfer into computer, so I can see how high I during my hiking trip, how my climbing capacity decreased after a few beers or how fast I could get into valley, when storm started. It served long years and now I decided to build something smaller, with modern components.
I chose MPL3115A2 as pressure sensor. It comes in tiny LGA package, draws two or three orders of magnitude less power than MPX4115A and provides digital interface, so no AD converter is needed. I whacked PIC18F25J50 on the board too, serving as main controller with USB interface. Data logging function use classic IIC EEPROM. Display is MC0802 from Farnell. USB interface is used as data interface and charging source too. When plugged into PC, it enumerates as CDC device, allowing creating virtual serial port and charges internal Li-Ion accumulator. Power source is switched from Li-Ion to USB and accumulator is being charged with current ~20mA. Yes, slowly but adequate for 150mAh accumulator. I’m not in hurry, just leave it overnight, it stops charging when done. There is opamp on the board, allowing main MCU to monitor the battery voltage. There is no power switch; most of the components is under bias all the time, so I’m using power saving features of the components to achieve minimal consumption when “turned off”. Currently it is approx. 4uA, but it could be lower, but I didn’t bother much – 4uA would discharge 150mAh accumulator in 4 years. Current consumption when running is 2-2,5mA, so it lasts a few days after charging. Total dimensions are 39x25x18mm.
There is no enclosure in here for now. Front and back panels are custom PCB.
I won’t provide much details of how it works from user’s standpoint; I believe it is clear from youtube video, but comments section is open for questions. It is fully open-source, so anyone can adjust it to his own needs.