Rocket Apogee Parachute

On an Arduino Nano 33 BLE, configure an ADXL345 (HW-579) for boost-level acceleration, detect launch with a debounced threshold, integrate vertical velocity to find apogee, fire the parachute pyro channel exactly once at apogee, and beep a recovery buzzer afterwards. A simulated flight shows whether the parachute opened.

Carte
Nano 33 BLE · Arduino
Difficulté
Moyen
Thème
Sensors
Accès
Gratuit

La tâche

Rocket Flight Computer: Parachute at Apogee

You are writing the flight computer for your club's model rocket. When the rocket reaches its highest point (apogee), the board must fire the parachute. A parachute fired too early opens at high speed and tears; one that never fires lets the rocket hit the ground. Firing by mistake on the launch pad is dangerous for the crew.

There is no barometer on the board: apogee has to be found from the accelerometer alone.

Hardware

  • Arduino Nano 33 BLE (nRF52840, 3.3 V logic). Serial console on Serial1 (D0/D1), 115200 baud. Serial is USB and is not seen by the tests.
  • HW-579 IMU board on Wire (A4 = SDA, A5 = SCL). Its ADXL345 accelerometer is at I2C address 0x53. The board is mounted with the sensor's +Z axis pointing at the rocket's nose; standing on the pad, Z reads about +1 g. The board has pull-up resistors.
  • D2: parachute pyro channel (logic-level N-MOSFET, e-match). HIGH = fire.
  • D3: active buzzer. HIGH = sound.

Register addresses, scale and data format are in the Datasheet tab.

Requirements

Write the sketch in sketch/sketch.ino (setup() and loop()).

  1. Start-up. Put the accelerometer in measurement mode. Boost acceleration can reach 13 g: set the range and resolution so it is read without clipping. When ready, print READY on Serial1.
  2. Sampling. Read the Z axis at 100 Hz or faster and convert it to g.
  3. Launch detection. The rocket has launched when Z stays above 2.5 g for at least 50 ms without a break. At that moment print LAUNCH <ms> (<ms> = millis()). Shorter knocks (a bump on the pad, handling) are not a launch.
  4. Vertical velocity. From launch on, update the vertical velocity on every sample with v += (a_z − 1 g) × 9.80665 × dt (dt = the real sample interval in seconds). Include the 50 ms spent confirming the launch, or the start of the boost is lost.
  5. Apogee and parachute. In flight, when the velocity drops to zero or below, the rocket is at apogee: drive D2 HIGH for 1000 ms, then LOW, and print DEPLOY <ms>. The parachute fires once.
  6. Pad safety. D2 is never HIGH before launch is detected. At start-up D2 and D3 are outputs driven LOW.
  7. Recovery buzzer. The buzzer is silent until the parachute fires. After that it beeps 200 ms on / 200 ms off continuously, so the rocket can be found.
  8. Console. Only the READY, LAUNCH <ms> and DEPLOY <ms> lines are printed on Serial1.

Example console output:

READY
LAUNCH 1560
DEPLOY 7810
What does an accelerometer measure?

An accelerometer reads 0 g in free fall and +1 g on the pad: it measures acceleration without gravity. That is why 1 g is subtracted from the reading for the vertical velocity.

Why is velocity zero at apogee?

While the rocket climbs its vertical velocity is positive; at the top it crosses zero, and it is negative while falling. The moment the integrated velocity changes sign is apogee.

Wiring

Build the circuit in the Wiring tab. The parachute MOSFET's gate must never float while the board powers up or resets: a floating gate can fire the parachute on the pad.

Success criteria

  1. The sketch builds.
  2. In flights with different motors the parachute fires no more than 250 ms before and no more than 750 ms after apogee.
  3. Knocks on the pad neither fire the parachute nor print a launch line.
  4. The buzzer only sounds after the parachute has fired.

After Run, the Flight tab replays the flight: the climb, apogee, and whether the parachute opened.

Ce que vous obtenez

  • Votre firmware est compilé et exécuté sur une carte émulée, puis vérifié par des tests matériels.
  • Une explication écrite de la solution.
  • Aucune carte de développement ni toolchain locale requise.

Débutant en embarqué ? Commencez par la feuille de route : Apprendre les systèmes embarqués (en anglais)