Build a DIY Rocket Flight Computer: Barometric Altimeter, Accelerometer Logging, and Apogee-Triggered Ejection
- ESP32-S3 or ESP32-C3 Dev Board (small form factor)
- BMP390 or MS5611 High-Precision Barometric Pressure Sensor
- MPU6050 or BNO055 IMU (Accelerometer/Gyro)
- MicroSD Card Module (SPI)
- Micro SD Card, 8-32GB
- 2S LiPo Battery, 300-500mAh
- Nichrome Wire, 28-32 AWG (for ejection charge igniter)
- Logic-Level MOSFET (IRLZ44N or similar) for Igniter Firing
- Screw Terminal Breakout Blocks
- Piezo Buzzer (for post-recovery locating beep)
- Perfboard or Custom PCB Blank
- Rocket Motor Igniters / E-Match (consumable, for ejection testing)
- Low-Density Foam Padding (for avionics bay)
Commercial rocketry altimeters like the PerfectFlite StratoLogger or Eggtimer are excellent, certified, and worth owning for any flight where recovery deployment absolutely has to work. But building your own flight computer teaches you exactly what those black boxes are doing internally, gives you full control over logging rate and data format, and is a genuinely good weekend electronics project that pairs a maker's existing 3D-printed or CNC-built rocket airframe with the one subsystem most builders buy instead of make: the avionics. This guide covers a dual-deploy-capable design that logs barometric altitude and acceleration at high rate, detects apogee reliably in software, and fires an ejection charge through a MOSFET-driven nichrome igniter.
Treat this as a hobby and backup/secondary system, not a replacement for a commercial, independently reviewed altimeter on any flight where a failed deployment is unacceptable (high-power flights, flights over people, or anything requiring certification). Flying it alongside a proven commercial unit — logging in parallel, only firing a backup ejection charge — is the right way to build confidence in your own design before trusting it alone.
Sensor selection: why barometric, not just GPS or accelerometer
Apogee detection fundamentally comes down to watching altitude climb, flatten, and start to fall. A barometric sensor like the BMP390 or the classic MS5611 (the same sensor family inside most commercial rocketry altimeters) gives you altitude resolution well under a meter at a sample rate of 50-100Hz, which is more than enough temporal resolution to catch apogee within a fraction of a second on a typical mid-power flight. GPS is too slow to update and too easily affected by multipath near launch to use for real-time deployment logic, though it's excellent for post-flight recovery once the rocket is on the ground and the receiver has a clear sky view. The IMU's job here is secondary: it provides a fast, independent check (zero vertical acceleration and a sign change from positive to negative on the integrated velocity) that guards against a barometric glitch — a sudden pressure pulse from the ejection charge of a sustainer stage, for instance — triggering a false apogee detection.
Apogee detection logic
The simplest barometric apogee detector just watches for N consecutive altitude samples that are each lower than the previous one, which avoids tripping on sensor noise during the mostly-flat burnout coast. A more robust version — what this build uses — keeps a short rolling buffer of the last 10 altitude readings, fits a simple linear trend to them, and declares apogee when that trend's slope has been negative for a sustained window. This smooths out individual noisy samples far better than a raw "is this reading lower than the last" check, which is prone to false triggers from sensor jitter on an otherwise-still rocket near the top of its arc.
Flight phaseDetection signalComputer action Pad / pre-launchAcceleration near 1g, altitude stableIdle logging at reduced rate, arm check BoostAcceleration spike above launch threshold (typically 2-3g)Switch to high-rate logging (50-100Hz), start flight timer CoastAcceleration drops near 0g or negative (deceleration), altitude still climbingContinue high-rate logging, begin apogee trend window ApogeeRolling altitude trend slope negative for >0.75s AND velocity estimate near zeroFire main/drogue ejection charge via MOSFET Descent / landingAltitude stable within a few meters for >10sDrop to low-rate logging, sound locator beeperFiring the ejection charge safely
The igniter circuit is a logic-level N-channel MOSFET (an IRLZ44N or equivalent with a low enough gate threshold to switch fully on from a 3.3V GPIO) gating a short loop of nichrome wire embedded in the black powder charge, powered from a dedicated connection to the LiPo rather than sharing a rail with the sensor logic. Put a flyback-safe design in from the start even though there's no inductive load here — the real hazard is an accidental fire from a GPIO glitching high during boot or brownout. Use a pull-down resistor on the MOSFET gate so it defaults OFF with no power applied, and gate the firing routine in software behind an explicit "armed" state that only activates after a stable pad-idle period is detected, never immediately on power-up.
Physically separate the igniter firing circuit and its wiring from the black powder charge well until you're at the pad, and never work with a charge-connected board on your bench. Follow your motor and recovery charge manufacturer's loading procedures, follow NAR/Tripoli range safety rules for your flight's power class, and never fly a self-built ejection system over spectators until it has a solid flight history on open, sparsely attended range days.
Data logging and post-flight analysis
Log raw altitude, acceleration, and detected flight state to the SD card at the full sample rate — storage is cheap and you will want the fine-grained data the first few times you fly this to tune the apogee detection window and confirm it would have fired at the right moment even if you're also flying a commercial altimeter as the primary. Pulling the CSV off the card after recovery and plotting altitude vs. time in a spreadsheet or Python notebook is genuinely satisfying, and it's the fastest way to catch a sensor that needs a tighter noise filter or an ejection delay that fired a half-second later than it should have.
Pair this project with the airframe-building side of the hobby already covered in this library's 3D printing and CNC rocketry content — nose cones, fin cans, and recovery bays — and you've got a complete from-scratch rocket, electronics included. Start with low-power, well-understood motors and open fields before trusting a self-built ejection system on anything bigger.