Software in iGEM should make synthetic biology based on standard parts easier, faster, better or more accessible to our community.
Astronaut DNA

Overview

Our software stack spans embedded C++ for microcontrollers and a lightweight HTML web UI. It controls two critical devices in our project: a 2‑axis clinostat for microgravity simulation and a PHBV filament extruder (built on Marlin firmware). The UI, interactions, and visual accents mirror our Entrepreneurship page—look for orange-highlighted key phrases and compact accordions throughout.

Clinostat Software

Introduction

To better prepare for human migration to Mars, our team designed a 2‑axis clinostat to simulate microgravity and mimic real space conditions for E. coli. This software component, written in C++ and HTML, works with our clinostat to provide a convenient way to access it via cell phones.

Coding can be a different world—especially for newcomers. For iGEM teams interested in space-related topics, that learning curve can be a barrier. We therefore developed software that simplifies communication with the clinostat so anyone can use a phone to control the clinostat and set the desired conditions.

Clinostat overview
Clinostat overview — 2‑axis microgravity simulator controlled via phone.
Arduino IDE setup
Setup — open the Arduino IDE to prepare the firmware upload.
Board & Port selection
Board & Port — choose LOLIN (WEMOS) D1 R2 & mini for ESP8266 and the correct serial port.
Upload speed
Upload speed — adjust as needed for your hardware to avoid timeouts.
Copy code from repo
Firmware — copy code from our repository and paste into the Arduino sketch.
Wi‑Fi credentials
Network — update Wi‑Fi credentials so the board can join your hotspot.
IP address display
Connect — power on and note the displayed IP address for the local web page.
Web UI overview
Web UI — on/off switch and connection test available in all layouts.
GPIO wiring D5/D6
Wiring — servo signal wire (orange) to D5 and D6.
RPM/ratio controls
Controls — select UI designs for individual servo, ratio, or RPM control.
Set up the Arduino IDE & Upload the Code

This software runs on Arduino‑compatible motherboards. Use the Arduino IDE to edit and upload the code. Some easy‑to‑miss but important steps:

  • Be sure to select the exact Board and Port matching your motherboard.
  • For Arduino ESP8266 Wi‑Fi, choose board: LOLIN(WEMOS) D1 R2 & mini.
  • Adjust the Upload Speed if needed—hardware setups vary.

Once configured, copy and upload the code from our repository: GitLab repository ↗. The only parameter you must modify is the Wi-Fi credentials so the board can connect to the Internet.

Accessing the Web Server

After entering valid credentials, power on the board. It will connect to the specified Wi‑Fi or hotspot and display an IP address. Enter that IP in your browser to load the local web page.

Controlling the Clinostat (UI Options)

The web interface provides full control with three UI layouts to choose from. All include a master On/Off and Test Connection. Depending on the layout, you can:

  • Individually drive each servo
  • Adjust servo ratio
  • Set RPM per axis

These cover the full range of typical clinostat applications.

Servo wiring to D5 and D6
Servo signal wire (orange) to D5 and D6.

Extruder Software

Introduction

To utilize the PHBV produced by engineered E. coli, our modeling team built a filament extruder to process it into uniform, high‑quality bioplastic filament for 3D printing. Our software builds on the Marlin firmware and manages the heater temperature, push motor, and winder motor to automate and stabilize extrusion while enforcing safety.

We chose Marlin because it is free, open‑source, and includes a comprehensive safety framework that guards against overheating and hardware damage. To suit our needs, we trimmed features to maintain a simple, focused build. Modified files are available in our repository: [Link].

Extruder overview
Extruder overview — PHBV filament production workflow.
Install VS Code
Install VS Code (development environment for Marlin).
Extensions search
VS Code → Extensions: search for PlatformIO.
PlatformIO icon
PlatformIO installed — alien icon appears in the sidebar.
Marlin website
Marlin firmware homepage (download section).
Extract ZIP
Extract the downloaded Marlin ZIP archive.
Open folder in VS Code
Open the Marlin folder in VS Code (Explorer view).
PlatformIO environments
PlatformIO environments — select the correct board target.
Configuration.h
Configuration.h — board, features, and thermistor settings.
Example configurations
Example configurations from Marlin’s config repo (board presets).
LCD menu basics
LCD menu structure — trimmed to essentials for our extruder.
Configuration_adv.h custom menu
Configuration_adv.h — enable custom menu and title (“Test 1”).
menu_main.cpp edits
menu_main.cpp — define items and actions for the LCD menu.
G-code M117
G-code messages — M117 updates LCD status text.
Heater setpoint
Heater setpoint control — M104 to 200 °C / 230 °C.
Relative/absolute motion
Motion modes — G91/G90 for relative vs absolute positioning.
Feed rates
Feed rates — e.g., F300 / F1000 for push motor speed.
Safety commands
Safety — M410 (quick stop), M18 (disable motors).
Menu options summary
“Test 1” menu — Set Temps, Push Fast/Slow, and safety shutdowns.
Thermistor setup
Thermistor — in Configuration.h, set type to 1.
Continuous extrusion
Continuous extrusion — large moves (e.g., 999999 mm) for long runs.
Winder motor
Winder motor — tension control and even spooling.
Heater block
Heater block — stable temperature improves filament uniformity.
Push motor speeds
Push motor — Fast vs Slow throughput.
Safety menu
Safety menu — Turn Off Heater, Push Stop, Shutdown All.
Final checks
Final checks — confirm configs and test extrusion.
Ready to run
Ready — simplified, safe operating interface.
VS Code UI
VS Code UI — typical layout with files and terminal.
Build output
Build — PlatformIO compile/upload console output.
VS Code Installation

Download from the official site: code.visualstudio.com.

PlatformIO Installation

Open the Extensions panel in VS Code, search PlatformIO, and install. An alien‑shaped icon will appear in the sidebar.

Install Marlin

Download Marlin from marlinfw.org. As of writing, the latest release is 2.1.2.5. Extract the ZIP, then open the folder in VS Code.

Key Modifications

1) Basic Settings

We used a Creality STM32F103RE board. Ensure the environment in platformio.ini and Configuration.h matches your motherboard’s layout and pins. The chosen environment tells the firmware which hardware to talk to and how.

Marlin maintains example configurations for many boards: GitHub examples.

2) LCD Control

We simplified the default LCD menu to just what we need: Temperature, Push Motors, and Shutdown. Modify Configuration_adv.h to enable a custom menu (uncomment the relevant block and set menu_main_title, e.g., “Test 1”). Then update menu_main.cpp to define the actual options and actions. For convenience, copy our version from the repository.

3) Thermistor

The thermistor is core to safety. In Configuration.h, set the sensor type to 1 to indicate a connected thermistor and enable temperature monitoring.

Available Functions (Test 1)

  • Set Temp: 200 °C / 230 °C
  • Push: Fast / Slow
  • Safety: Turn Off Heater, Push Stop, Shutdown All

Selecting an option sends the corresponding G‑code to the board (e.g., M117 sets an LCD message; M104 sets target temperature; G91/G90 toggles relative/absolute motion; long moves (e.g., Z/Y 999999) support continuous extrusion; M410/M18 are quick stop / disable motors).

Other Applications

Beyond clinostat control, the same platform can set speed or speed ratios for devices like stirrers, incubator fans, and even 3D printers. With added sensors (light, temperature, CO₂, pH) and attachments, the system can plot data in real time to aid analysis and future iterations.

Key Design Choices

Future Directions

References
Rocket