One of the requirements of the competition is designing a custom PCB to house the components. I'm going to talk a bit about the different things on the PCB:
For the microcontroller we went with an Adafruit RP 2040. We chose this because it has a built-in micro-SD card slot letting us get the data from the rocket after its lands very quickly as well as having a Li-Po battery charge built in. When you attach the USB and the battery at the same time, the battery starts charging.
We wanted the rocket to have a barometer, as well as an IMU and a temperature sensor. To do this we used BMP280 and MPU6050 which both work over I2C, making wiring very simple. For the temp sensor we used a TMP 36 analogue temperature sensor from Adafruit.
The competition requirements say you need a way to read the apogee from the rocket, just after the rocket has landed, without external equipment. To do this we used 4 RBG LEDs, one for each digit (e.g. flashing yellow colour be a 7).
The code for the microcontroller was fairly simple. When it gets power the code creats a new csv file on the SD card with a uique name. It then claculates a baseline for alitude, by takes averages over 10 seconds. With this it can creates a offset in order to get the starting alitiude close to zero.
After its done this it starts logging data. The data is saved as a csv file so the first line saved is the header (Time_s,Temperature_C,Altitude_ft,Acceleration_X,Acceleration_Y,Acceleration_Z,Gyro_X,Gyro_Y,Gyro_Z
) and the lines are that are the actual data e.g. 24.668,23.55,-0.06,-9.44,0.86,1.78,-0.04,0.60,2.85
The code needs a way to detect when the rocket has landed so it knows when too stop logging and display the appoge on the LEDs. To do this each time it logs data it checks if it has gone above 100 ft, at this piont it can be sure it has launched. After this piont it instead checks if the alitude has checked by less then 3 feet in 10 seconds of time. If it has it cabn be sure it has landed
We wanted a way to be able to quickly produce graphs from the data so I built a MATLAB app that lets you pick the csv file using the windows file picker, and then produce the graphs. The crops out any data recorded before the rocket atually lunched. After the data is loaded, on the orientation tab, and arrow starts moving to play back the rockets orientation in real time, using the data collected by the IMU.
I made the MATLAB program frist and found some IMU data online to test it with.
To test fully test the MATLAB and microncoller code together, I took it up a lift in order to see if it would detected the landing at the right time. Here is a video of that test.
The team was a bit nervous for the launch, but I thought we came very well prepared. All the needed doing was attaching the avionics board into the payload bay. The launch and landing were very successful. The rocket detected the landing successfully and we collected all the data we wanted.