Home Built Rocket Altimeter

Quick Links
Home
Propellants
Rocket Motors
Rockets
Rocket Electronics
Ground Support
Launch & Static Tests
Software
Links
Motor Class Table
E-Mail Scott
 
 
Don't Click Here!
24 April, 2005: First of all, I must warn you. This is really just an attempt by me to see how many head aches I can give myself and what level of frustration I can tolerate. If all you want it an inexpensive altimeter, get a P6-K Altimeter Kit from Transolve or a CP Technologies altimeter kit. The P-6 kit looks especially attractive as it includes all the parts needed and shipping included for a very reasonable price.

But I would like to learn how to program and use microcontrollers, it seems a logical next step. But there is also a steep learning curve, I'm starting out with really no knowledge of how to use these critters. To make things a little easier on myself, I'm starting out with a Basic Stamp 2 from Parallax. They have a very nicely integrated software package that allows easy (relatively speaking) programing of a microcontroller. Plus they have have a lot of very good documentation and good product support. It would be a lot cheaper to build your own circuit using a PIC chip, but not as easy. So I decided to start out as easy as possible, then down the road perhaps move on to programing my own PIC's. ("Small steps Ellie.")


To start out, I purchased a Basic Stamp 2 homework board from Radio Shack for about $80. It's not intend to be integrated into a finished product, although I suppose you could. But rather as a tool to learn how to use the Basic Stamp 2. I've been going through the manual, working with the different projects and learning the PBASIC code as I go.

I ordered a Motorola MPX 5100A pressure sensor from Digi-Key, it reads pressure then sends out a voltage signal relative to the pressure. The data sheet claims the output voltage range is from .2 to 4.7 volts. The sensor needs a regulated 5 volt power supply, so I picked one up at Radio Shack. I soldered up a temporary PCB board with the regulator, and used a 9 volt battery to power the board. The pressure sensor was then wired in and a digital volt meter used to test the output. At my elevation of about 1,240' above sea level I was getting a reading of 3.73 volts. A little lower than I expected but within tolerance range of the sensor.

I placed my sensor/power supply board, the battery and my voltmeter into the melting pot I use to melt KNSU propellant. I then used my vacuum pump set-up to draw a vacuum in the chamber and take voltage readings at different levels of vacuum. This isn't highly accurate, but will give me an idea of how things work. Below is a list of the voltage readings at various vacuums in inches of Hg.


17"=1.03 volts

16"=1.14 volts

15"=1.3 volts

14"=1.48 volts

13"=1.63 volts

12"=1.78 volts

11"=1.93 volts

10"=2.11 volts

9"=2.25 volts

8"=2.41 volts

7"=2.58 volts

6"=2.72 volts

5"=2.87 volts

4"=3.01 volts

1 atma=3.73 volts

I did a little research and found that 1" of Hg = .491159 psi. Then using an interactive calculator found at a NASA web site, I was able to make rough approximations of altitude from my vacuum readings. Here's how I did it. Let's take the 17" of Hg as an example. 17 x .491159=8.3497 psi. Atmospheric pressure at sea level is 14.7 psia. So 14.7 - 8.3497=6.35 psi absolute pressure. Using the NASA calculator I found that 6.35 psia is equal to about 21,000'.

So why did I want to know that at this point? Well, I wanted to get an idea of the resolution I could get out of the altimeter. Here's the theory I'm using. I'll have to convert the analog signal from the sensor to a digital signal. If I use a 12 bit analog to digital convertor (ADC), the 12 bit ADC gives me a resolution of 4,096 possible output values. So in my expected altitude range of up to 21,000' that gives me a voltage of 1.03 volts. So I'm using 2.7 volts, (3.73 volts - 1.03 volts=2.7 volts) out of a possible 5 volts. So, (2.7 volt range x 4096 ADC resolution) / 5 volts =2,211 possible values. 21,000' / 2,211 = about 9.5' per value. Or, a resolution of about 9.5'. An 8 bit ADC would result in a resolution of only about 152' per sample. In reality, a resolution of 100' is likely as close as your going to get anyway.

For starters I'll keep it real simple, as I just plan on making a recording altimeter at this point. To keep it real simple, I'll simply record the voltage data out of the ADC and download the data post flight to analyze it. As I gain experience, I'll add apogee and main deployment to the altimeter.


29 April, 2005: I picked up my BASIC Stamp 2 kit on Saturday the 24th. On Sunday the 25th I ordered a few parts from Digi-Key, I ordered a couple of 8 bit ADC's, a couple of 12 bit ADC's and another pressure transducer. I really couldn't do much until I had an ADC chip in hand, so I patiently waited. On Wednesday the parts arrived. I quickly set up an 8 bit ADC on the breadboard area of the Basic Stamp 2 board. I wanted to start out with the 8 bit ADC as there was documentation and sample projects using this particular ADC. It didn't take me long to have a digital multimeter set up and working with the 8 bit ADC. So I started writing code to make the multimeter into a flight computer. It was quickly apparent the 12 bit ADC would be the way to go, but it was also apparent the 12 bit ADC was going to be a lot harder to use. In fact, I wasn't even sure if the 12 bit ADC I ordered would work. So I went about converting the code to 12 bit, then wiring the new chip into the circuit. As it turned out the 12 bit ADC worked with few problems.

Writing the code wasn't as easy as I expected. I do have some experience writing in basic, but it really only helped a little. The documentation with the Basic Stamp is fairly good, but there are a number of different versions of Stamps and software, and sometimes it's confusing as to which version of the software the documentation is using. Regardless, I can't really complain. Because in less than two days I had code written that seems to work. Not only to record maximum altitude, but to deploy at both apogee and a main chute at a lower altitude. Someone experienced at writing code for the Basic Stamp would cringe at what I came up with I'm sure. But what the heck, if it works...

I'm using a potentiometer (pot) to simulate the output of the pressure transducer, and light emitting diodes (LEDs) to simulate the deployment charges. One thing the Basic Stamp doesn't do very well is complex math, as it doesn't have a floating decimal point. That means you have to program in the math like you would do it by hand on paper. So, for now at least I'm not going to program the computer to read in actual feet of altitude. The apogee and main deployment will be handled using the ADC output values. The values will be recorded in eeprom memory for later retrieval, then converted to actual feet once downloaded. The ability to record data in eeprom, then later retrieve it is significant, even if the battery dies, or the computer looses power the eeprom memory remains intact.

There's a lot to build on too. A variety of on board sensors could be incorporated into the rocket and the data recorded. I'll need to order a Basic Stamp module to actually incorporate into a flight computer, this project is moving a little faster than I expected so I'll have to do that soon.

Click Here to download the program scottalt1_2.bs2, you'll need the software from Parallax which you can download free. Or, if you want you can view the code here.

Well, I made a silly mistake in the first program code. I wrote the code like the readings from the ADC were in feet, the rocket goes up, the altitude goes up, right? Well, yes it does but the sensor reads the other way, the lower the pressure (as the rocket goes up) the lower the output value. So I had to change a few formulas and reverse a few things in the program. I found the error in my ways when I hooked up the real sensor to the circuit. It didn't work at all like it was working when I had the pot in the circuit. So a quick check of the data sheet from the pressure transducer answered that pretty quickly.

After I fixed the code, I decided it was time for a more realistic test of the altimeter. I hooked up my vacuum pump again and placed the altimeter in the container. I used a valve to slowly draw a vacuum over about 15 seconds, then I closed the valve and slowly started letting pressure back in, the yellow LED indicating apogee lit, then I continued equalizing the pressure. Just before reaching atmospheric pressure the red LED came on indicating main deployment. It works!

At least it's working on a test bench. The real world of a rocket flight is another matter. Vibration and shock waves still need to be considered. I did program in a mach delay, it is software adjustable and is a simple matter of changing one figure. I also built in a little buffer to the deployment code. I'm using 3 samples as a buffer, that way if there is a little drift from the sensor/ADC it won't fire the deployment charges prematurely. What that means is the apogee deployment charge should really go off about 30' below apogee on its way down.

One thing you need to remember too, air pressure as you move up the column of atmosphere is not linear. So my altimeter would be more accurate the lower the apogee is. I mentioned earlier, at 21,000' I should have a resolution of about 9.5'. At lower altitudes it gets better, higher, again is worse.

So what's this all going to cost you may wonder. For a flight ready computer you'll need a BASIC Stamp 2 module, that's a module you can solder to a board. That's $50. The pressure transducer is another $18, the 12 bit ADC was about $3.50. A couple of transistors for output to the deployment charges, a few small decoupling capacitors, a battery holder, maybe an LED or two. Total it all up and it's around $90, but you'll need a few other things too. So the cost isn't too bad, not considering how much more could be added to the computer. An extra 32k eeprom for a couple of bucks and you could record a lot of data. An accelerometer could be added as well. When I get a computer flying and working I'll post a parts listing and schematics.

Here's the formula to convert the computers output values to pressure in kPa.

(ADCvalue) / 4096 + .095 / .009 = kPa

The kPa pressure now needs to be converted to altitude by means of some rather complex math, or better yet, a handy little program to do it for you. I suppose if I can't find a calculator that does what I want I could write one in Visual Basic, but I'll see if I can find one and save myself the time.

The initial tests are going well. I've done about 20 runs in the vacuum chamber and the computer continues to perform well.

2 May, 2005: The next step was to hook up transistors to the Basic Stamp outputs, the transistors deliver the needed amps to the deployment initiators. I also used a separate battery for the deployment initiators to prevent pulling the voltage down on the Basic Stamp. In the photo above, you can see the size of the board I'm working with, the Basic Stamp itself is very small (indicated in the red box). What I will do is order a Basic Stamp module, it comes as a 24 pin package, just like a 24 pin IC. The module can be plugged into a carrier board and programed, then inserted on a PCB and soldered in place. Or you could use a plug in socket and move the Stamp module back and forth if needed.

With the initiator transistors in place it was time for a high amp test. So I hooked up a multimeter to each output, and using a small hose to suck on, I started the altimeter. Upon release of the suction the apogee transistor,followed by the main transistor opened up, flowing over 3.5 amps to each output. I repeated the test several times, getting the same results.

Next, was a test with actual deployment initiators. Both fired as expected.

I guess now I'm to the point of being ready to do a flight test. But I don't have a Stamp module to build onto a board yet. I may end up using what I have, and just solder the connections to the bottom of the Basic Stamp Homework board I have.

3 May, 2005: I decided to fly the altimeter as is, so I made a new module to hold the altimeter.

Here you can see the module I built for the altimeter. The Basic Stamp Homework board on the far left, the center board has the ADC chip, pressure sensor, and two output transistors, the last board was just to hold the screw down terminals for the deployment charges. The main power switch is on the top of the module. The back side of the module holds two 9 volt batteries, one for the Stamp power supply, the other for the deployment charges.

I decided to try a new approach to mounting this module. I made it a "floating module" with about .75" of heavy foam neoprene at either end of the module. The foam neoprene is compressed slightly, then a retaining bulkhead is secured into the rocket body tube. The idea is twofold, first it should help to dampen vibration and shock. Second, in the event of a hard landing it may prevent excessive damage to the electronics.

As it sits now, the altimeter is ready for a test flight.

4 May, 2005: The altimeter was tested in Launch Test 92.