Air Pressure and Temperature Sensor

It was decided on a whim to purchase and install a Air Pressure + Temperature sensor for the next flight. I purchased a :-

http://core-electronics.com.au/search/?q=MPL3115A2

I picked this because the pins were arrange in same order as the Gyroscope pins. So I had a relatively easy job of just soldering this on top of the Gyroscope.

Programming wasn’t as simple. The libraries that you can get from AdaFruit or SparkFun generally are one-shot, in that you need to wait a significant time for the sensor to return a value (in the order of a second). This is not satisfactory because we need to capture as much gyroscope data as possible. So we looked into a demo Arduino program by Sparkfun called SparkFunMPL3115A2AdvancedExample.ino. In this example it would get the sensor to collect data autonomously and at the end it would fetch all the data. It utilises a FIFO that can store up to 32 measurements of air pressure/temperature. We programmed our sensor to collect data every second. We allowed sufficient time at the end of the~8 seconds of gyroscope collected data (FRAM memory only has enough space for ~8 seconds of data) to get another 24 data points, by employing a 24 second delay. This should allow us to get 32 seconds (~ 3/4 flight profile) of air pressure and temperature. The program then stores this data at the very end of the FRAM.

We then modified the dumpFRAM routine to process the air pressure/temperature data to allow us to see what was recorded!

I tested this out by running up the hill with the sensor. Sure enough, the air pressure reduced as I ran up the hill. This extra sensor is a great addition to the flight. It will allow us to approximate the flight altitude over time, allowing us to compare it with the predicted flight altitude over time (generated from Open Rocket).

Below is an extra from a dump from the routine dumpFRAM.

2 151 79 32
RS: 0.02, -1.14, 0.01
2 151 115 216
RS: 0.03, -1.25, 0.07
2 151 152 144
RS: 0.02, -1.22, 0.02
2 151 189 72
RS: 0.04, -1.26, 0.11
2 151 226 0
, Temperature = ,26.7, C, Pressure = ,101.41, kPa
, Temperature = ,26.7, C, Pressure = ,101.41, kPa
, Temperature = ,26.7, C, Pressure = ,101.41, kPa
, Temperature = ,26.7, C, Pressure = ,101.41, kPa
, Temperature = ,26.7, C, Pressure = ,101.41, kPa

Here RS means Rotational Speed

The other lines with 4 numbers can be combined to produce the time in microseconds

At the end is the Temperature and Pressure. These are ~1 second apart.