Water Rocket Flight Computer

About the project

Water rocket flight computer that logs data to an SD card and records onboard video, all in one package.

Project info

Difficulty: Moderate

Platforms: Espressif

Estimated time: 1 week

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Seeed Studio Xiao ESP32-S3 Sense Seeed Studio Xiao ESP32-S3 Sense x 1
BMP280 Barometer BMP280 Barometer x 1
MPU6050 IMU MPU6050 IMU x 1
OV2640 Camera OV2640 Camera x 1
Passive Buzzer Passive Buzzer x 1
Servo Motor Servo Motor x 1
Slide Switch Slide Switch x 1
7.4V 450 mAh Lipo Battery 7.4V 450 mAh Lipo Battery x 1
Battery Screw Terminal Battery Screw Terminal x 1
5V Linear Voltage Regulator 5V Linear Voltage Regulator x 1
22 uF Ceramic Capacitors 22 uF Ceramic Capacitors x 2
Resistors for Voltage Divider Resistors for Voltage Divider x 2
M3 Bolts 6mm M3 Bolts 6mm x 8
M3 Threaded Inserts M3 Threaded Inserts x 8
WS2812B RGB LED WS2812B RGB LED x 1

View all

Hand tools and fabrication machines

3D Printer 3D Printer x 1

Story


I've always enjoyed launching water rockets, but I wanted to learn more about what happens during flight. That's why I built Triton, a simple flight computer based on the Xiao ESP32-S3. Featuring a BMP280 barometer and a MPU6050 IMU, Triton combines data logging to an SD card at 50 Hz, onboard video recording and even automatic parachute deployment, all in one package!

Schematic

The flight computer is powered by a 2S Lipo battery (7.4V) with a capacity of 450 mAh, which is enough to keep the system running for about 2 hours. I used a linear voltage regulator to bring the battery voltage down to a stable 5V which is fed to the Xiao ESP32-S3 and the servo motor. The Xiao board integrates a 3.3V regulator.

Two resistors are wired in series to serve as a voltage divider. The values of 100k and 64.9k Ohms have been calculated so that when the battery is fully charged at 8.4V, a 3.3V signal goes to one of the ESP32's analog inputs.

I added a status LED (WS2812B), which only takes 1 digital pin, as well as a passive buzzer for additional feedback.

PCB Design


Next I layed out all of the components to design the PCB. As this was my first time ever making a PCB, there is definitely room for improvement. I also don't own a hot air gun, so I had trouble soldering the surface-mount components with just a soldering iron, but it worked out in the end.

The servo motor, that deploys the parachute, is plugged in via pin headers on the board. And the battery leads are screwed to the battery terminal block on the side.

3D Printed Mount

Next, I needed a way of actually mounting the flight computer to the rocket, so I designed 3D printed brackets in Fusion 360.

I added threaded inserts to the 3D printed parts to so that the PCB could be screwed in place with four M3 bolts. Four more bolts are used to secure the mount to the rocket's airframe.

Software

Here is the project's GitHub repo.

The Arduino sketch uses multiple libraries to work with the different sensors and devices: SD_MMC, FS, Wire, CircularBuffer, ESP32Servo, Adafruit_MPU6050, Adafruit_BMP280, Adafruit_NeoPixel. For the video recording part, I took the code from the ESP32-CAM_MJPEG2SD project and kept the necessary functions.

When the flight computer boots up, the LED flashes multiple colours while initializing every component and calibrating the sensors. Launch is detected when the acceleration hits a certain treshold. Then, Triton measures barometric altitude. When the altitude drops compared to the apogee, the parachute is deployed. It then calculates the rocket's speed to detect when the rocket has landed. Sensor data is constantly being written to the SD card at a rate of 50 Hz, in parallel with the video recording.

SD Card

Triton produces a flight directory on the SD card for each new flight.

  >  

Inside each flight directory, it saves:

  • flight_1.csv: a CSV file containing flight stats
  • flight_1_logs.csv: a CSV file containing flight data logged at ~50 Hz
  • flight_1.avi: an AVI video file of the onboard camera footage

To add more flexibility, Triton has a configuration system with different parameters that can be adjusted to achieve the desired behaviour. Triton will load the configuration from a config.cfg file at startup. If the file is not present, it will be created with a default configuration.

Send it !


Let's make this thing fly! I had to build a water rocket that could embark Triton as its payload. I present to you: Neptune. It was constructed by gluing together multiple 1L soda bottles to create a pressure chamber with a total volume of 6L. Triton was mounted at the top, with the camera sticking out the side of the rocket.

But this is a story for another time. If you'd like to learn more about how I made the rocket, check out the Youtube video. Let's focus on Triton: after multiple failed attempts and explosions, Neptune finally flew, which resulted in beautiful onboard footage:

(actual footage is twice the framerate, here the video was compressed into a GIF)

The parachute deployed right on time and the rocket landed smoothly.

Flight data

Let's check out the collected flight data from the SD card:

First is the flight stats file. Here are some stats:

  • Apogee: 107.27 m
  • Max velocity: 44 m/s
  • Apogee time: 5.55 s
  • Parachute deploy time: 5.89 s
  • Log frequency: 48 Hz

Next we can look at the logged sensor data:

That's a lot of numbers. Let's plot out graphs !

On the altitude graph, we can see a beautiful parabola, broken by the parachute opening. On the velocity graph, we can see the exact moment the parachute opens, at around 8 seconds, with a sudden change in speed. The roll axis graph shows that the rocket did not really spin at all, only completing half a rotation during its ascent.

Now, if we look at the acceleration, we can notice something interesting. Almost instantly, the acceleration jumped to 16 G. However, the altimeter that I used, the MPU6050, only has a range of +/- 16 G  (it was designed for smartphones, not rockets!) which means that the rocket exceeded the limit so the acceleration data is inaccurate at the beginning of the flight. Despite that, we can still get valuable data over the rest of the flight. For example, we can see that at apogee, the rocket experiences weightlessness with an acceleration of 0 G, before the parachute opens and produces a negative accel of -8 G.

Conclusion

This whole project has been an incredibly fun way to get into the world of PCB design and I'm glad I was able to combine it with my passion for rocketry. I couldn't be more satisfied with how Triton performed. The onboard footage is amazing and the collected data is exactly what I was hoping for! Although, in the future, I might need to pick out better sensors for my application.

Schematics, diagrams and documents

Schematic

Code

Triton Software

https://github.com/MaelStudio/TritonFC

Credits

Leave your feedback...