I have been flying model rockets, airplanes and multirotors for a while now and I have always been curious to know how high they go up. Without GPS, these numbers are tricky to estimate. So to figure out how high they really go up, I am making a small gadget with the BMP 180 barometer, Pro Trinket and a display to find the approximate altitude.
Additionally, with the FAA guidelines, hobbyist are limited to flying below 400 feet. Neither myself or my flying buddies have a good estimate of what that altitude looks like so this device could help us make sure we are flying per the guidelines.
Details
Components
1×
Pro Trinket - 3V
Microcontroller
1×
BMP 180
Digital pressure and temperature sensor
1×
HP QDSP-6064 bubble display
A tiny, 4-digit, 7-segment numerical indicator. Can be found on Sparkfun
I just finished the first prototype! The display now shows the current and max altitude.
If I gently blow on the BMP 180, the altitude changes so I'm thinking that the wind from the aircraft might affect the readings. I may have to put the device in an enclosure.
Also, I'd like to verify the readings but I'm not sure if I should bring my phone up that high.
Now I'm off to charge some batteries and do some testing!
So I'm not sure if I'm supposed to be updating the project log this often but this is kind of fun so I'm doing it anyways. I got the BMP 180 to play nicely with the Pro Trinket without a problem. Storing the data was not as straightforward, however.
The chips EEPROM memory is 512 Bytes and is written 1 byte at a time. I'm using a double type form ( because its much more precise than an integer) which is 4 Bytes long. This means that in order to store a point in memory I must divide it up into four groups and then combine it when I need to read it. I thought this was going to be difficult but I found a simple functions that will help with this:
voidEEPROM_Write(double *num, int MemPos){
byte ByteArray[4];
memcpy(ByteArray, num, 4);
for(int x = 0; x < 4; x++)
{
EEPROM.write((MemPos * 4) + x, ByteArray[x]);
}
}
memcpy(1,2,3) takes the destination location, adresss of source and the size of an object to move in memory. Moving it to and from an array of 4 bytes makes this process simple.
I decided to store the altitude data on the Pro Trinket's EEPROM instead of an external memory to keep it simpler. This means that I only have 512 Bytes of storage available. So here's how much data I can hold:
About 2 hours of data at 1 sample per minute
About 1 Hour of data at 2 samples per min
About 20 Minutes of data at 6 Samples per minute
I opted for the 20 minutes of data since my flights don't last more than that.
The BMP 180 module uses the Analog 4 and Analog 5 pins. These pins on the Pro Mini are not broken out on with the other border pins (see image below). However, these two pins are broken out normally on the Pro Trinket (see image). This makes it easier for me to prototype with any chip that uses Analog 4 and Analog 5 pins such as those that use I2C protocol at a gain of overall size ofcourse.
The first thing I needed to do was to choose the components. We will need a microcontroller, a pressure sensor and a display. For the microcontroller, I had always wanted to try the Pro Trinket and I had one laying around so I thought this would be a great time to try it out. When it came time to choose the pressure sensor I had debated between the BMP 180 and the MS5611. MS5611 is much much more precise than the BMP 180 but the ladder is cheaper and I had already worked with it before. Plus the difference in precision (10 cm vs 250 cm) was not really that important to me. So I went with the BMP 180. At this point, I'm not sure which display to use. I was originally thinking of using a seven segment single digit display but while I was digging through my components I found a HP QDSP-6064 bubble display. Its a cute little DIP sized 4 digit seven segment display. Ive never worked with it before and It looks kinda cool. Hopefully it'll be visible in the daylight.
Enough talking, now I'm off to get the microcontroller and the pressure sensor to work with eachother....
Let's begin by making sure the Pro Trinket is correctly installed and working. Then we will install the necessary libraries to get the code to work.
1. If you are already familiar with the Pro Trinket or are planning on using an Arduino UNO or Pro Mini skip to step 3.
2. To get the Pro Trinket to work with the Arduino IDE you have two options: Either install the Adafruit IDE ( almost exactly like the Arduino IDE but automatically supports the Pro Trhinket) or add the hardware files to your Arduino folder. Download links and instructions are here: https://learn.adafruit.com/introducing-pro-trinket/setting-up-arduino-ide
3. Now on to downloading and installing the libraries used by the sketch:
http://www.nar.org/high-power-rocketry-info/filing-for-faa-launch-authorization/filing-for-faa-waiver/