SPACE MARINERKits
Code & setup guides

Flight computer code

Starter programs, wiring tables and setup notes for every Space Mariner kit that uses the Adafruit Feather RP2040 Adalogger. All code is CircuitPython and uses Adafruit's free libraries.

Do this once per board

Set up the Feather RP2040 Adalogger

  1. Use a USB-C cable that carries data (many cables only charge).
  2. Install CircuitPython 9.x: download the .UF2 file for “Feather RP2040 Adalogger” from circuitpython.org. Hold the BOOT button, tap RESET, and let go of BOOT. A drive called RPI-RP2 appears; drag the UF2 onto it. The board restarts and a drive called CIRCUITPY appears.
  3. Download the CircuitPython 9.x library bundle, unzip it, and copy the library files listed for your kit from the bundle's lib folder into CIRCUITPY/lib.
  4. Download your kit's zip below, unzip it, and copy code.py onto CIRCUITPY, replacing the one there. The board restarts and runs it.
  5. Insert a microSD card formatted FAT32 (cards 32 GB or smaller come formatted this way). Each power-on makes a new numbered CSV file, so old flights are never overwritten.
  6. To see live readings, install Mu, pick CircuitPython mode, and click Serial.

Never connect the AA battery pack and USB at the same time. Unplug the battery before plugging in USB.

Mission 01 · Cadet Kit · Lessons 3–4

Cadet flight computer starter code

Reads the MS8607 (pressure, inside temperature and humidity), the DS18B20 outside probe and the u-blox MAX-M10S GPS, and saves one line per second to FLIGHT000.csv, FLIGHT001.csv and so on. At startup it puts the GPS into airborne mode so it keeps reporting above 18 km.

Download starter code (.zip)View code.py

Wiring

PartConnects toHow
MS8607Feather STEMMA QT portSTEMMA QT cable 1
MAX-M10S GPSMS8607's second STEMMA QT portSTEMMA QT cable 2 (chain: Feather → MS8607 → GPS)
DS18B20 power wire (usually red)Feather 3VScrew terminal
DS18B20 ground wire (usually black)Feather GNDScrew terminal
DS18B20 data wire (usually yellow)Feather D5Screw terminal
4.7k resistorBetween the data wire (D5) and 3VScrew terminal
3xAA holderFeather battery (JST) connectorPlug

Library files for CIRCUITPY/lib: adafruit_ms8607.mpy, adafruit_gps.mpy, adafruit_ds18x20.mpy, adafruit_onewire/ folder, adafruit_bus_device/ folder.

CSV columns: seconds, gps_time, lat, lon, gps_alt_m, sats, fix, pressure_hpa, inside_temp_c, inside_rh, outside_temp_c. GPS columns stay blank until the GPS has a fix (take it outside; the first fix can take several minutes).

Virtual Mission · Mission Control Home Kit · Lesson 3

Data logger starter program

Reads the MS8607 sensor and prints pressure, temperature and humidity about once per second in Mu's Serial panel, and saves the same numbers to LOG000.csv on the microSD card.

Download starter program (.zip)View code.py

Setup notes

PartConnects to
MS8607 sensorFeather STEMMA QT socket, with the STEMMA QT cable
microSD cardSlot on the Feather, push until it clicks
3xAA holder (adult)Feather battery connector, only after USB is unplugged

Library files for CIRCUITPY/lib: adafruit_ms8607.mpy, adafruit_bus_device/ folder.

Ages 13+: in code.py, LOG_INTERVAL sets how often it logs, and the line under “this is the line that writes to the microSD card” saves the data. Keep a copy of the original before you change it.

Mission 02 · Atmospheric Science · Lesson 2

MAX31865 + SHT45 connections and code

Adds research-grade PT100 temperature (through the MAX31865 amplifier) and SHT45 precision humidity to the Cadet flight computer. Logs everything the Cadet code does, plus pt100_temp_c, sht45_temp_c, sht45_rh, rtd_fault, to SOUND000.csv. An adult does the wiring with the batteries out.

Download Mission 02 code (.zip)View code.py

MAX31865 to Feather (SPI)

MAX31865 pinFeather pin
Vin3V
GNDGND
CLKSCK
SDIMO (MOSI)
SDOMI (MISO)
CSD10

PT100 probe wires go to the MAX31865's screw terminals as shown on Adafruit's MAX31865 guide. The code assumes a 3-wire PT100 (set RTD_WIRES to 2 or 4 if yours differs) and the board's solder jumpers must be set to match. The amplifier's reference resistor is 430 Ω (standard for the PT100 version).

SHT45

PartConnects to
SHT45The GPS's free STEMMA QT port (end of the chain: Feather → MS8607 → GPS → SHT45)

Library files: everything for the Cadet code, plus adafruit_sht4x.mpy and adafruit_max31865.mpy.

Explorer crews: your logger came pre-assembled. Make the same connections; if your logger was shipped with different firmware, follow the card that came with it.

Mission 04 · Payload Engineering · Session 1

LTR390 + VEML7700 logging program

Runs on the second Feather RP2040 Adalogger in the experiment module. Writes one line per second to UV000.csv: seconds, uv_index, lux (seconds since power-on).

Download Mission 04 code (.zip)View code.py

Wiring

PartConnects to
LTR390 UV sensorAdalogger STEMMA QT port
VEML7700 light sensorLTR390's second STEMMA QT port
3xAA holderAdalogger battery connector (USB unplugged)

Library files: adafruit_ltr390.mpy, adafruit_veml7700.mpy, adafruit_bus_device/ folder, adafruit_register/ folder.

Test: cover each sensor with a finger and the numbers should drop; at a sunny window they rise. Note that bright direct sunlight can push the VEML7700 to its top reading.

Troubleshooting

No CIRCUITPY drive?