Testing digital altimeter for project Rocket 404

Testing digital altimeter for project Rocket 404

During elementary and high school I was quite into model rocketry, building and launching a number of model rockets. Most of them were bulit around commercially available rocket motors. At that time some of my colleagues were building their own rocket motors with quite crazy total impulses. I did however fiddle a bit with some micro rockets and with building miniature model rocket motors, which pose quite a different challenge.

IMG0122AIMG0123A(Pictured rocket motor (2008): 5mm ID, 6.2mm OD, ~20mm length, blackpowder endburner with 2mm nozzle made of compressed gypsum plaster, paper housing)

Sadly, due to shift in interests and general lack of time I didn’t bulid or launch a model rocket for quite some time now. But a few days ago I got contacted by Žan who I bulit an altimetry device for some time earlier. Altimetry devices / altimeters are used for determining the flight course and the rocket maximum altitude, but they can also be used for deploying parachutes for safe return of the model. The one that was bulit for him was based on Atmega8 microprocessor and MPX100A pressure sensor with additional analog signal conditioning, it also featured dual output channels.IMG_20150121_205113087The microprocessor is in TQFP package and is installed on the back of the PCB. The pressure sensor (round element on PCB) and power mosfets which are in heat shrink tubing can clearly be seen. Speaker is wired so it can be positioned more freely in the model.

Even before that I bulit a few altimeters based on Attiny26 microprocessor. Here you can find some old notes / posts (in Slovenian language) on testing one of my altimeters.im004662This image shows one of my early altimeters, the main chip is Attiny26, the analog pressure sensor MP3H6115 can not be seen as it is placed on the bottom side of the PCB. Analog pressure sensor was used and internal amplification of signal was implemented. Attiny26 (now replaced by Attiny261) and variants of it have a bit more powerful ADC which also allows for differential measurements and on-chip amplification of signal. These chips however are quite memory restrained and also don’t have a UART / serial hardware which is usually my preffered way of communication with embedded devices.

The small circuit on the brown protoboard is a quick and dirty implementation of diode voltage regulator which was later replaced with an actual regulator as I got it. The connector on the left side is used for programming the device and reading the stored data.

To jump back to the current project – What Žan wanted is for me to bulid a new altimeter for their new Rocket 404 (the official name has been changed to Cirrus project) model rocket project. They will be using a custom made rocket motor, so they wanted to log the flight performance with the altimeter and also use it to deploy the parachute at the highest altitude. Sadly when my old computer died, also part of the old projects were lost, including most of the altimeters. So both the hardware and software for the new altimeter had to be done from scratch.

As the deadline for the launch was quite near I had to use only the parts / devices that were on hand. I used Arduino Pro Mini (based on Atmega328P) and BMP180 absolute pressure sensor. The module also features two output channels with actuator presence testing and capacitor power backup for one second. For status indication the module has three LED diodes and a beeper. Complete altimetry device measures 3,7cm * 4,3cm. By using double sided PCB and directly mounting components (processor, sensor) probably the whole circuit could be made the size of the Arduino Pro mini 🙂IMG_20150111_220919945The altimeter works by measuring the ambient air pressure. Air pressure falls with higher altitude and you can conveniently calculate between them. For example you can use the forumulas from Wikipedia or here. (At lower altitudes pressure falls by approximately 1 millibar per 10 m.) The altimeter actually works with pressures directly, so no recalculation is done on the device. This way user has to calculate the altitudes from the pressures after downloading flight data from the device. This approach prevents precision loss when calculating height on the device directly.

When the altimeter starts it checks for output actuators presence and if they are not presents indicates this to the operator. Lack of output actuators is reported, however the altimeter still functions normally. After the initial checks it starts monitoring the air pressure. When it detects that the pressure has lowered (remember? – lower pressure means higher altitude) by a preset amount it goes into a liftoff state. This is also when the recording of the altitudes begin. When it liftoff state it will just record the pressures until it detects the lowest pressure – top of the flight. This is when the first actuator is activated. When another preset altitude above the start is detected also the second actuator is activated. In addition to 450 points of time log also some of the important points (start pressure, liftoff pressure, lowest pressure – highest altitude…) and their exact times are recorded by the software. The main limitation of the log size is the inbulit arduino memory, which is only 1kB, so everything has to be squeezed in this small amount of space.

As I currently don’t have any rockets to test the device on, two different ways of testing it were used. The first is using an elevator to activate the altimeter and second one was to use a pressure chamber. The altimeter was powered by 9V block battery and on the outputs leds were connected to indicate the output state. For the pressure chamber a canning jar with modified lid to allow cable passthru and a small diaphragm vacuum pump were used. Here is an image of the setup in pressure chamber:IMG_20150112_214913973The measurements were all according to predictions and here is the raw recorded data from the altimeter:altimeter_chamberTime distance between two sampling points is 100ms.

To calculate the pressure in millibar the raw data has to be divided by 40. To calculate the altitude in feet from the millibar value you have to use the this formula, which was published by NOAA.

Formula for use in Libreoffice/Excel to convert pressure in millibar to altitude in feet:

D6 should be the cell that holds the absolute measured pressure in millibars. You may need to replaxe the commas with dots depending on your system settings.

To convert to meters simply multiply the altitude in feet by 0.3048.

Formula for use in Libreoffice/Excel to convert pressure in millibar to altitude in meter:

Graph of the pressure in millibar and sensed altitude in meters:altimeter_chamber2The initial altitude was actually around 310m, so there seems to be some offset due to sensor itself and weather conditions.

And the measurement data from the test using the elevator to get altitude change:altimeter_elevatorThe measurement started in 4th story, going up to 8th story and then back down to the floor level. Change of the angle od graph at sample 233 is because the altimeter measures first 233 samples at 100ms sampling rate and then switches to 500ms sampling rate to conserve the amount of eeprom used for sampling. This way the altimeter can record data for around 5 minutes instead of 45s that it could record if the sample rate was fixed at 100ms.

1 Comment on “Testing digital altimeter for project Rocket 404

  1. Great post! I stumbled upon your post comparing cheap ebay boost modules as I was thinking of using one to power my altimeter that I am building for my water rocket project and then I read this post. I was trying to use an SD card module for logging but using EEPROM seems like a much better idea. All I have to do now is decide what is the cheapest & smallest power source I can use.

    Keep up the good work.

Leave a Reply

Your email address will not be published. Required fields are marked *