MicroPython code for BerryRocket-based board
(“BerryRocket code”) (github.com)
This repository contains the firmware and application logic for controlling a rocket’s avionics using MicroPython on a Raspberry Pi Pico (or equivalent board). The code handles:
- Flight sequencing (launch detection, apogee detection, parachute deployment)
- Sensor acquisition (pressure, acceleration, angular velocity, etc.)
- Payload operations (user‑customizable experiments, data logging)
- Buzzer or audio feedback
- Configuration and parameters
It is intended for use in BerryRocket’s “Mini Avionic” / rocket avionics stack. (berryrocket.com)
- Detect liftoff (via accelerometer or accel-contact)
- Detect apogee / max altitude
- Trigger parachute deployment
- Read and log sensor data (IMU, pressure / temperature)
- Buzzer / audio notifications
- Configurable parameters for thresholds, timing, etc.
.
├── .gitignore
├── LICENSE
├── README.md ← (this file)
├── board.py
├── buzzer.py
├── cu.py
├── main.py
├── parameters.py
└── lib/
├── icm20984.py
├── lps22.py
└── (other sensor or utility modules)
Here’s a brief description of each important file:
| File / Module | Purpose |
|---|---|
main.py |
Rocket sequencer and payload logic — main entry point |
buzzer.py |
Buzzer control and notification routines |
cu.py |
Custom payload logic to be filled if needed |
parameters.py |
Configuration parameters, thresholds, constants |
lib/icm20984.py |
Driver for the ICM‑20984 IMU sensor |
lib/lps22.py |
Driver for the LPS22 pressure / temperature sensor |
lib/lsm6dsx.py |
Driver for the LSM6DSx IMU sensor |
lib/mpu9250.py |
Driver for the MPU9250 IMU sensor |
- A BerryRocket-based board (e.g. Raspberry Pico + BR Interface + optionally BR Mini Sensor) (berryrocket.com)
- MicroPython firmware compatible with your board
- A development environment (Thonny is a good choice for beginners) (berryrocket.com)
- Flash MicroPython
.uf2(or equivalent) to the board - Upload all
.pyfiles from this repository onto the board (root level +lib/) - Adjust
parameters.pyas needed (thresholds, sampling rates, timings) - Reset / power-cycle the device to start execution
parameters.pycontains all tunable constants (e.g. acceleration thresholds, delay times, data logging intervals)- You can modify behavior (e.g. how parachute is triggered) in
main.py
Once powered, the system:
- Monitors acceleration or other signals to detect liftoff
- During ascent, reads sensors and logs data
- Wait for apogee time
- Triggers parachute deployment (via servo, GPIO, etc.)
- Continues logging / optional payload operations until mission ends
You can hook into or customize the payload operations inside cu.py or main.py.
Here are a few ideas:
- Add new sensor drivers
- Support additional board types
- Improve stability / robustness / speed of sensor acquisitions
- Add logging/data upload support (e.g. via SD card, external flash, radio link)
This project is licensed under the CC BY-NC-SA (see LICENSE)
