Skip to main content

Software

Logo of STREAM Chemostat Control

Follow this link to get to the software!

Bridging Hardware and Usability

Chemostats are powerful tools in synthetic biology, but manual operation can be labor-intensive, error-prone, and difficult to standardize. Our Chemostat Controller software is a custom-built platform designed to make continuous microbial culture experiments more precise, accessible, and reproducible. While we invested heavily in building reliable, modular chemostat hardware to lower the technical barrier of entry, true accessibility for other small research groups and iGEM teams could only be achieved through reliable and translatable control software. The idea for the software emerged towards the end of hardware development, when we realized that a graphical user interface (GUI) would significantly enhance usability, enabling more intuitive interaction and real-time monitoring for both live experiments and educational demonstrations. The software thus became the crucial bridge between our hardware innovation and its practical usability, ensuring that anyone can operate complex continuous culture systems with confidence and precision. By integrating automated control, real-time monitoring, and intuitive data visualization, our software provides a seamless interface for both researchers and students to interact safely and effectively with complex microbial experiments.

Automated Precision for Continuous Cultivation

At the heart of the software is its ability to control four programmable pumps, which regulate nutrient input, pH, inducer addition, waste removal, etc. Users can set specific pump speeds, apply short-term inducer spikes, or adjust flows in real time, enabling highly customizable experimental protocols. Additionally, the software includes a real-time pH PI (Proportional-Integral) controller, which automatically adjusts the flow of acid or base through one of the pumps to maintain a stable pH setpoint. The controller continuously calculates the pH error, integrates it over time, and modifies the pump speed accordingly, providing automatic feedback that can be observed directly in the graphical user interface (GUI) with live console updates.

To ensure safety and maintain physically feasible operation, the software enforces hard limits on all sensors: pH is restricted to -1 to 15, dissolved oxygen cannot exceed 120%, temperature is limited to 1538 °C (1811 K), CO₂ is capped at 1 atm, and gas flow is capped to 200 mL/s to ensure tubing integrity. These limits are also applied to the pumps controlling these parameters: for instance, the Temperature pump cannot increase the culture above the maximum temperature, and the Gasflow pump will stop if flows become unsafe. Similarly, Inducer and Media pumps are modulated to avoid exceeding DO or CO₂ safety limits. This ensures both live experiments and simulated data remain within safe, physically meaningful ranges.

Operating Modes

The software operates in two modes: live and demo. In live mode, the software connects directly to an Arduino and ESP module to control a real laboratory setup, sending commands to pumps, reading sensor data, and providing accurate, real-time feedback from a functioning microbial culture. In demo mode, the software generates simulated microbial data to replicate culture behavior. Sensor readings such as pH, dissolved oxygen, temperature, CO₂ concentration, and gas flow are computed from realistic baseline values, random fluctuations, and user-controlled pump effects. Adjusting pump speeds in demo mode directly influences the simulated data, including the PI-controlled pH regulation, allowing users to explore how environmental changes affect the system without handling live organisms. This approach blends educational accessibility with realistic experimental dynamics.

Figure 1: STREAM Chemostat Controller in Demo Mode

Figure 1: STREAM Chemostat Controller in Demo Mode

The GUI offers the following tools: Pump speed control, where the user can input the desired pump speeds manually; Inducer spiking; Print outs of the individual sensor values; Plot and CSV export options; pH Setpoint (target value), Kp (proportional gain), and Ki (integral gain). A higher Kp makes the pump respond more aggressively to changes in pH: the larger the deviation from the setpoint, the stronger the correction. Ki determines how strongly the controller reacts to the accumulated error over time. Adjusting the Ki helps the system reach and hold the exact setpoint, not just hover near it. In the Serial Printout, the pH adjustments can be seen.

Monitoring and Control

The software also continuously monitors key parameters, including pH, dissolved oxygen, temperature, CO₂ concentration, and gas flow. This information is displayed both numerically and graphically within the GUI, which features dynamic plots that update every few seconds. Users can easily track trends, identify anomalies, and make informed decisions during experiments. All data is automatically logged to a CSV file, which along with the plots, can be exported directly from the interface, ensuring that experimental results are well-documented and readily available for further analysis or presentation.

Beyond basic monitoring, the software supports dynamic feedback control, enabling future development of closed-loop experiments where environmental parameters automatically trigger adjustments in pump flows or inducer addition. This allows scientists to maintain cells in specific metabolic states or test dynamic gene circuits. The pH PI controller demonstrates this capability by maintaining a stable culture pH, reducing manual intervention and improving reproducibility. By simulating complex conditions in demo mode, users can safely refine control strategies and predict culture behavior before conducting live experiments, reducing risk and resource usage.

Flexibility, Modularity, and Scalability

STREAM Chemostat Controller is designed with flexibility and scalability in mind. Its modular architecture supports integration of new sensors, pumps, or actuators, making it a perfect match for our modular chemostat, and adaptable for evolving experimental protocols or for use by other iGEM teams. With minimal modifications, the system could manage multiple chemostats simultaneously, enabling parallel experiments, high-throughput testing, or remote collaborative studies.

Installation and Usage

All information can also be found in our GitHub

Installation

Step 1: Clone the Repository

git clone <repository-url>
cd <repository-folder>

Step 2: Install Required Python Packages

pip install -r requirements.txt

Required packages:

  • customtkinter
  • matplotlib
  • numpy
  • pyserial

Usage

Step 1: Run the Software

python chemostat_controller.py

Step 2: Mode Selection

  • A popup will appear asking you to choose between Demo Mode or Live Mode
  • Demo Mode: Simulates sensor data (no hardware required)
  • Live Mode: Requires hardware connections

Step 3: Using the GUI

  • Adjust pump speeds using the left panel and click Apply Pumps
  • Spike an inducer using the Spike Inducer button
  • Monitor pH, DO, temperature, CO₂, and gas flow in real time
  • Export plots or CSV files using the buttons provided

Hardware Requirements (Live Mode Only)

  • Arduino microcontroller
  • ESP module
  • Sensors for pH, DO, temperature, CO₂, and gas flow
  • Four programmable pumps

File Structure

  • chemostat_controller.py – Main GUI and control code
  • log.csv – Automatically generated data log

Pump and Sensor Files (Live Mode)

To ensure correct functioning in Live Mode, upload the appropriate files to your microcontrollers:

Arduino:

  • 4_pumps_arduino.ino

ESP:

  • esp_spectrophotometer_gfp.ino
  • esp_i2c_comms.ino

GFP Logging:

  • Use log_gfp_readings.py to log GFP readings
Figure 2: Demonstration of how to run the software in Demo Mode

Figure 2: Demonstration of how to run the software in Demo Mode


Conclusion

By combining automation, real-time monitoring, and data logging, the STREAM Chemostat Controller software transforms a complex laboratory device into an intuitive, interactive tool. It supports reproducible research, facilitates learning, and enables small research groups, such as iGEM teams, to demonstrate their synthetic biology projects effectively. The STREAM Chemostat Controller software is a big step towards accessible research, upscaling experimental processes, and empowering users to explore and optimize bioproduction with precision and safety. Whether managing live experiments or exploring the dynamics of different parameters with changes in pump speed, the software makes it possible to observe, record, and analyze culture conditions with precision, safety, and clarity.