SkillAgentSearch skills...

Phenobottle

An open-source Raspberry-Pi based photobioreactor for cultivating and assessing physiology (photosynthesis & productivity) in microscopic algae.

Install / Use

/learn @HarveyBates/Phenobottle

README

Phenobottle

Phenobottle


Description

An open-source Raspberry-Pi based photobioreactor for cultivating and assessing physiology (photosynthesis & productivity) in microscopic algae. The device can be used to cultivate both green algae and cyanobacteria while continuiously (and non-invasively) probing photosynthetic and growth phenotypes.

Publication

The device was published in Algal Research in 2020:

The Phenobottle, an open-source photobioreactor platform for environmental simulation - Bates et al. 2020

DOI

Future of The Phenobottle

The Phenobottle is currently being updated to version 0.2. This will feature several environmental controls that were not featured the original version (v0.1) of the device. Additonal environmental sensors will also feature in version 0.2 along with a graphical user interface (GUI).

If you would like to learn more about the progress of this version please email: harvey_bates@hotmail.com


Live Preview

PhenobottleGIF


Operating Manual

Specifications

| Feature | Value / Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | | Growth light quality | Red, green and blue (Adjustable). 8-bit individual adjustment for each channel. | | Growth light intensity | Up to 200 μE (can be increased if needed). | | Mixing | Vertical mixing using magnetic stirrer (adjustable intensity) | | Bubbling | Included bubbling motor (adjustable) or solenoid control for external supply of CO<sub>2</sub> | | Main board | Raspberry Pi 3B+ (can accomidate the new 4 - 4B) | | Microcontroller | Teensy 3.5/3.6 or Teensy 4.1 (3.6 Recommended) | | Actinic LED colors | Blue 455 – 485 nm (466 nm), Green 517 – 555 nm (532 nm), Orange 583 – 600 nm (593 nm), Red 617 – 635 nm (626 nm). | | Resolution of optical density and chlorophyll fluorescence measurments | 10 to 16-bit (adjustable) | | Sampling rate of fluorometer | 8 μs at 12-bits (can be overclocked) | | Operating voltage | 15 V 1.2 A (Barrel plug), 12 V 2 A (Barrel Plug) and a 5 V 2 A (MicroUSB) power supply | | Data collection | SQL Server and local .csv |

Downloading files from this repository

As the Phenobottle is being updated constantly, please download a released version of the device from the releases tab (located on the right hand side of the screen). This contains all the files needed to 3D-print and control Phenobottles as well as some information about the required materials and tools.

If you wish to clone the main repository you may; however, as there are new versions of the Phenobottle in the works, the files may not work as planned.

Python dependencies

A number of packages are included in the Phenobottle_RaspberryPi.py. Some of which are already installed on a Raspberry Pi and as such wont be discussed. Others need to be installed using the Raspberry Pi terminal before compiling, these include:

PyMySQL - For SQL connection

Terminal

pip3 install PyMySQL

Python

import pymysql.cursors

This requires a Raspberry Pi to be configured as a dedicated SQL server. Information on how to do that can be found here. It is recomended that you use a dedicated Raspberry Pi for the SQL server; however, you can use one of the Phenobottle's Raspberry Pi's as a server if you are limited.

Adafruit_MotorHAT - For I2C communication with the Adafruit-MotorHAT

Terminal

git clone https://github.com/adafruit/Adafruit-Motor-HAT-Python-Library.git
cd Adafruit-Motor-HAT-Python-Library
python3 setup.py install

Python

from Adafruit_MotorHAT import Adafruit_MotorHAT

Unfortunatly this package is depreciated; however, its still fine to use for the Phenobottle.

Twilio - SMS messaging

Terminal

pip3 install twilio

Python

from twilio.rest import Client

This package is not required if you do not want to recieve SMS updates. Twilio is a paid service that you must sign up for here. However, this is non-essential and the Phenobottle runs fine without this addition. This can be handy if you are away from The Phenobottle and need to know how the experiment is running.

pySerial - Serial (USB) communication with the microcontroller

Terminal

python3 -m pip install pyserial

Python

import serial

Required for communication with the Teensy 3.6 microcontroller. Documentation on this package can be found here.

Required setup in Phenobottle_RaspberryPi.py

Basic Setup

PHENOBOTTLE_NUMBER = 3 # Arbitary number to differentiate between Phenobottles
INITIAL_OPTICAL_DENSITY = 888 # 12-bit value obtained by calibrating the optical density sensor
ARDUINO_FLUORESCENCE_REFERENCE = 3.3 # Teensy microntrollers have 2 analog reference values 1.1 and 3.3 
MIXING_SPEED = 32 # Mixing speed of the mixing motor (0 - 255)
BUBBLING_INTENSITY = 60 # Bubbling intensity of the bubbling motor (0 - 255)
LIGHT_INTENSITY = 220 # Overall light intensity of the grow lights (0 - 255) 
PERISTALTIC_SPEED = 160 # Speed of the peristaltic pump (0 - 255)
EXPERIMENT_START_TIME = "07:00:00" # Specify when the experiment should start 

ser = serial.Serial('/dev/ttyACM0', 115200) # Serial port and baud rate of Teensy 3.6 microcontroller

The INITAL_OPTICAL_DENSITY value is obtained by reading the raw value of optical density BEFORE adding microalgae to the flask. This can be acheived by writing "MeasureOpticalDensity" in the serial input of the Teensy 3.6 microcontroller (in the ArduinoIDE) or calling Test.prelim_od() in the python file. This is required to obtain a 100% transmission reading for which optical density measurments can be formulated from in the code.

SQL Setup

connection = pymysql.connect(host='IP_ADDRESS', # IP address of Raspberry Pi SQL server
                             port=port_number, # Usually 3306
                             user='Username', # Username of phpmyadmin 
                             password='Password', # Password of phpmyadmin
                             db='Phenobottle No.%s' %PHENOBOTTLE_NUMBER, # Database name
                             charset='utf8mb4',
                             cursorclass=pymysql.cursors.DictCursor)

For a SQL server connection this command must be compiled. See here for some documentation related to PyMySQL. For the database name you can change this to whichever name you choose; however, here we have premaded databases in out SQL server named "Phenobottle No.1", "Phenobottle No.2" ..., so that the PHENOBOTTLE_NUMBER corresponds with the correct database.

Messaging Setup

acc_sid = "Account SSID" # Accound SSID from Twilio
auth_token = "Account Token" # Accound token from Twilio
client = Client(acc_sid, auth_token)
from_number = "Twilio Phone Number" # Designated twilio phone number
to_number = "Mobile Phone Number" # Your phone number

As mentioned above, this part isn't really nessessary. However, information regarding the setup of SMS messaging can be found here.

Experimental procedure

Measurment Intervals

The Phenobottle is capable of measuring/controling environmental variables at described intervals. This is done through this set of commands:

""" Here we can check if the current time in minutes is devisable by our required measuring interval in this case 10 minutes. This means every 10 minutes a routine (day or night) will be run."""
if datetime.datetime.now().minute % 10 == 0: 
    """ Here we can setup or morning (8:00) and night times (20:00)"""
    if Experiment.experiment_schedule(datetime.time(8, 00), datetime.time(20, 00)): 
        NOW = datetime.datetime.now()
        Experiment.day_routine() # Runs the day routine
    else:
        NOW = datetime.datetime.now() 
        Experiment.night_routine() # Runs the night routine

Routines

The day and the night routine are idential except for the fact that during the night the LED grow lights are constantly switched OFF.

MotorsAndLights.light_on(None) # Turn on lights (daytime only) with desired color
MotorsAndLights.mixing_motor_on() # Mixing on at set speed
time.sleep(30) # Wait 30 seconds for mixing 

MotorsAndLights.mixing_motor_off() # Mixing off
MotorsAndLights.light_off() # Lights off to ensure no noise from PWM interferes with measurments
Sensors.measure_optical_density() # Measures optical density
Sensors.measure_fluorescence() # Measures fluorescence

MotorsAndLights.light_on(None) # Turn on lights (daytime only) with desired color
MotorsAndLights.peristaltic_mo
View on GitHub
GitHub Stars79
CategoryDevelopment
Updated5d ago
Forks9

Languages

C++

Security Score

85/100

Audited on Mar 24, 2026

No findings