BioSamplr: An open source, low cost automated sampling system for bioreactors

Graphical abstract

tors, valve manifolds, and sterile filtering probes. A few commercial autosampling systems available for lab bioreactors include the BioProbe TM from Bbi-Biotech, the Omnicoll Fraction Collector and Sampler from Lambda Instruments, the Segflow TM by Flownamics, and the more general reactor sampling system, the EasySampler TM by Mettler Toledo. A summary of some of the key features of these systems with a comparison to the BioSamplr is given in Table 2 below. While to the user, the BioSamplr is lower cost compared to commercially available products, as open source hardware it lacks a safety certification (such as UL certification), a warranty and technical support and service [2]. These costs can be a large component of commercial products, such as those in Table 2, and not accounted for with the BioSamplr. A UL safety certificate alone can cost from $5,000 to over $25,000 per product and would be at the discretion of the user. Avoiding these costs is a primary benefit of open source hardware (Table 3).

Hardware description
The BioSamplr design was primarily based upon work by Cannizzaro and Von Stockar, (in a now abandoned US patent application) wherein sterile air can be used for ''flushing of sample tubing between or during individual sampling steps" [3]. In this design (Fig. 1a), a pump is used to pull the liquid/air and valves are used to switch from sampling the reactor to purging with filtered air. The BioSamplr hardware (Fig. 1b-e) can be broken down into four primary systems i) the pumping/valve system, ii) the cartesian system, iii) the sample block, and v) the electronics.

Cartesian system
The cartesian system (Fig. 1b) locates the blunt sample dispensing needle over a target sample tube (or waste) based on x, y coordinates. The sample needle is moved to a given x,y coordinate by first moving a gantry (via an actuated lead screw) along an aluminum rail. The needle is centered between two rows of five sample tubes. A stepper motor is used to rotate the needle to dispense the sample in a given tube.

Sample block
The sample block consists of a rack which holds tubes in a water filled, insulated aluminum box, cooled with peltiers, which in turn transfers heat to a CPU cooling unit containing a radiator and exhaust fan. Peltier modules are commonly used in cooling devices and more frequently in DIY thermal control equipment [4]. The temperature controlled sample block uses two custom fabricated thermal probes [5], to take readings from both the water bath and the radiator, which are then recorded and used to control the temperature. Pulse width modulation (PWM) is used to control the Peltier's duty cycle turning it on and off in order to modulate temperature control. PWM has been compared to constant current circuitry and it has been shown that while energy efficiency decreases slightly [6], the lifespan of the Peltier module is unaffected and the module can remain reliable over one hundred thousand hours [7]. With the current configuration the sample block has been validated for use up to 30 h and can maintain a 4°C setpoint within 1.2 degrees.

Pump/valve system
The pumping system uses two 24 V three-way pinch valves to direct fluid flow from the bioreactor, a cleaning solution, or external sterile filtered air. Liquid/air is pumped through sample tubing to a blunt sample dispensing needle. These fluids are propelled through the flowpath by a 12 V DC peristaltic pump. Fluid sensors along the flow path confirm that a sample has actually been taken.

Electronics housing
The electronics, two power source modules (24 V, 6-9 A and 5 V, 3A) and the Raspberry Pi controller are contained in a 3D printed housing beneath the cartesian system. Each system is discussed below. Real time cell free sampling can be performed

3D Print files
There are twenty four different 3D print files, some of which include multiple pieces. These include all BioSamplr components that are not directly purchased. All design/print files are obtainable at https://doi.org/10.17605/OSF.IO/EGTSU.

Software
As mentioned above, the BioSamplr is controlled via a Raspberry Pi and python scripts. The scripts can be divided into 2 categories, those used for system initialization and calibration and those used for operation. These scripts are described below.
Initialization/Calibration Scripts d ''boot.py" is a boot file that when added to the Raspberry Pi startup process, sets both valves to their initial positions. d ''GPIO_cleanup.py" is a script that initializes all GPIO pins of use on the Raspberry Pi and sets them all to ''LOW" which turns off the pump, and Peltier while setting the valves to their default position.
d ''Cartesian_Test.py" is a script that locates the sample dispensing needle over each sample tube to test location coordinates d ''Photo_Transistor_Test.py" is a script that reads the two analog to digital converter channels for the two fluid sensors and converts their raw values into a value between 0 and 1. This script is used for calibrating fluid sensors.
d ''Pump_Test.py" is a script that has all pump and valve functions so that they can easily be controlled one by one. The purpose of this script is to validate that the pump and valves are functioning properly. d ''sleep.py" is a script that activates the stepper motors for five minutes to allow a voltage reading to be measured from the motor driver chips on the main PCB. This is necessary during setup to calibrate the current going to the stepper motors d ''simpletest.py" is a script written by Tony DiCola Adafruit Industries [8]. This script reads the eight different channels of the analog to digital converter and prints their values to the terminal. The purpose of this script is to validate that the thermal probes and fluid sensors are reading properly as well as that the other four channels are properly grounded and reading zero.
Operation Scripts d ''BioSamplr_Master.py" is the master control python script needed to control sampling. This control script will take ten samples at a user input time-interval and keep the sample block at a setpoint temperature while logging sampling data to a log file. d ''autoHome.py" is a script that first rotates the sample dispensing needle on the y-axis until it triggers the y-axis endstop switch, then rotates back to the vertical position between the two rows of sample tubes. Secondly, it moves the x gantry along the x axis until it engages the x-axis endstop switch and then backs off this switch slightly. The purpose of this motion is to ''home" the sample dispensing needle over a reference location that is also the location of the waste tube.
d ''Log_Temp.py" is a script that activates the sample block temperature control and logs temperature readings from two thermal probes to a log file.
d ''Measure_Temp.py" is a script that reads two thermal probes and prints their resulting temperature values to the terminal.
d ''Cleaning_Cycle.py" is a cleaning cycle script that gives instructions to place sample tubing in a cleaning solution or air to clean sample tubing.

Bill of materials
The bill of materials can be found at https://doi.org/10.17605/OSF.IO/EGTSU

Build instructions & operation
Due to the complexity of the instrument, we have prepared several videos which walk through the detailed BioSamplr assembly, calibration and unit operation including software set up. Links to these videos are found in Table 4 below. With a single low speed 3D printer, printing of components can be expected to take about 5 days. For someone with experience with these type of DIY projects as well as Raspberry Pi,~3 days should be planned for assembly and calibration. Additionally, to fabricate two thermal probes, follow the directions found online to make a waterproof, negative temperature coefficient (NTC) thermistor probe [5].

3D printing
Print all 3D printed components using the design files. There are twenty four different 3D print files, some of which include multiple pieces. These parts are listed in Table 5. All prints were performed using an Ender 3 Pro 3D Printer (Bill of Materials-Tools) with a layer height of 0.2 mm, an infill density of 50%, a print temperature of 210°C, a bed temperature of 60°C, and a print speed of 50 mm/sec. We expect that any 3D printer can be used.

Device safety
In addition to the details in the video, it is worth emphasizing device safety. When plugged into a socket as intended, there are live 120 V AC wires connecting the power socket to the two power modules as well as any exposed wiring inside the base housing. A safety bracket is installed covering the socket and the high voltage wires, however fingers should be kept outside of the box while it is plugged in and live. The water in the sample block as well as the sample dispensing need and sample tubes are located above the electronics. While the electronics housing is water resistant it is not water-proof. Care should be taken to ensure that excessive liquid does not spill into the lower housing which could damage the instrument. The sample block should only be filled halfway with water or a water/bleach mixture as the volume of the sample tubeswill fill the remainder of the aluminum box. We recommend plugging the instrument into a ground fault circuit interrupter (GFCI [9]) outlet in case of a short due to any leaks. If a GFCI outlet is not available we recommend using a GFCI surge protector. Additionally, we recommend taping the wires going into the electronics housing so that the wires enter from below the housing. This is to divert any accidental drips away from the housing. The sample dispensing needle moves along its trajectories as needed and is not covered or protected. Injury from this needle can be easily avoided following several precautions including using a blunt 18 gauge needle, keeping hands away from the needle while the device is live and/or operational and affixing it to the needle holder using a zip tie.

Temperature control
We first sought to validate the temperature control of the sample block. This was performed by monitoring the temperature of both the sample bath and radiator over 30 h, results of which are given in Fig. 2 below. When a 4°C setpoint was used, the sample block was maintained within 1.2°C of the set point.

Sample volume stability
In order to test the amount of evaporation from sample tubes the BioSamplr was set up to cool the sample block for a 30 h time period at a 4°C temperature setpoint with ten sample tubes holding 1.5 mL of water each. Initial weights of these tubes were recorded. Seven of these tubes were left open to the air while three were snapped shut. Following the designated time period the tubes were weighed again and these measurements were compared to the initial measurements. A difference of less than 1% (0.95% +/À 0.77%, n = 10) from the initial measurements was observed.

Sample volume precision
Sample volume is a user defined variable. For purposes in our lab we routinely manually sample 1-5 mL from bioreactors. In order to test variability of sample size the BioSamplr was set up to pump sixty samples of water (6 runs of 10 samples each) each targeting 0.75 mL. The weight of each sample was measured. Results are given in Fig. 3. The overall relative standard deviation was 25.7%, with the majority of samples within 0.2 mL of the target. 10% of the samples (6/60) were below 0.3 mL or less than half of the target. While this may seem imprecise, the BioSamplr is not an analytical instrument, and the key design specification is to draw sufficient sample, and store it properly (4°C), to enable additional offline analysis, not necessarily to have a very accurate volume. To this point, based on these results we would recommend target samples of >1.0 mL. Of course more sample may be needed depending on specific user requirements. The current design can be easily adapted to accommodate larger tubes (2 mL tubes or other vials) as needed.
The peristaltic pump in the current design, while reliable, is not extremely accurate or precise, which does lead to some variation in sample volume. If higher precision and accuracy is necessary, the current BioSamplr design could be adapted to use any pump although it will likely be significantly more expensive for this added hardware reliability. Alternatively, many precise, custom open-source peristaltic pumps have been described previously [10,11] and could be integrated into the BioSamplr for costs estimated at less than $100. Importantly for sampling from bioreactors, other factors can influence pump accuracy such as variable sample viscosity throughout a fermentation process, air bubbles that can potentially get into the sample tubing, pressure inside a bioreactor and the sampling flow rate. Furthermore the age of the pump tubing produces variable malleability and changes in accuracy overtime.

Fermentation sampling
A fermentation using a genetically modified strain of E. coli producing pyruvate as recently reported by Li et al, [12] was repeated in this work, where in addition to manual sampling, the BioSamplr was used to take online/automated samples for a head to head comparison. Specifically, in this validation study we used a FISP TM (Flownamics, Amsterdam, Netherlands) cell free sampling probe to draw cell free samples from the bioreactor. Specifically, strain DLF_Z0043, with plasmid pCASCADE-g2, was used in two-stage fermentations, wherein phosphate depletion triggers a productive stationary phase and pyruvate production. This strain was evaluated in a 1L instrumented bioreactor (Infors Multifors), and two analytes (glucose and pyruvate) were measured from both manual and BioSamplr samples using HPLC as previously described. [12]) Results are given in Fig. 4 below. In the case of glucose the average relative error for automated samples compared to manual samples was 6 ± 4% with a maximal error of 12%. In the case of glucose the average relative error for automated samples compared to manual samples was 2 ± 2.7% with a maximal error of 8%.

Discussion
The combination of low cost microcontrollers and CPUs (such as Arduino and Raspberry Pi) and 3D printing has made DIY hardware for scientific applications more accessible than ever [20]. Advanced hardware and control systems have been developed in numerous areas including in bioreactor control and data collection [21]. Commercial online probes/sensors for pO2, redox, pH, and temperature are routinely available, with probes reading optical density and/or viable cells becoming more commonplace. While advanced sensors, such as those based on raman spectroscopy, may be able to monitor metabolite and product levels in realtime [22,23], sampling is still the gold standard used to measure analytes in fermentation broth. Manual sampling, particularly at regular intervals, is very time intensive and to date autosampling systems, which can significantly reduce the time required to execute a fermentation, have been expensive and inaccessible to many labs.
Open source technologies have in recent years revolutionized what is possible in scientific laboratories with low budgets. Free and open-source software (FOSS) has become a universal standard and open source hardware will soon follow suite [13]. The RepRap movement as well as other 3D printing enables people to build custom equipment for their unique purposes. It is through this sharing and customization that users can target specific instrument requirements while dispensing with unnecessary features, which not only saves resources but also increases the user's process knowledge allowing them to easily troubleshoot and better maintain their equipment without external assistance. As open source devices accrue complexity, advanced systems will be increasingly possible at fractional costs, and the prices of competing commercial devices will be driven lower [14].
With liquid handling instruments alone, many instruments have been described previously, each with their own strengths and weaknesses, depending on the design specifications and the target application. A few of these low cost designs include ''Osmar, the open-source microsyringe autosampler" [15], ''microIO: an open-source autosampler and fraction collector for automated microfluidic input-output" [16], the ''Ecosystem" instrument, which uses various 3-D printed customizations for diverse applications [17], an autosampler, ''OpenSampler" [18], and an open-source syringe pump [19]. Osmar for instance, while a physically large device, yields high precision and ease of integration with analytical instruments. microIO combines an AutoSipper with fraction collection enabling automation of microfluidic inputs and outputs (as opposed to simply managing output) The syringe based systems, with a simple design, yield high accuracy and precision for small volumes, but do not allow for continuous flow. To our knowledge the BioSamplr is the first open source instrument specifically designed for bioreactor sampling by integrating fraction collection and sample storage (refrigeration).
Since the BioSamplr is not a commercial device, some quality and reliability risk is taken by the user. Proper construction and device understanding followed by proper use is required to ensure safety. Maintenance will be required to keep the instrument functioning as intended. There is a trade off here as large amounts of money can be saved by bypassing commercial certifications and warranties. A quality certification for bioprocess equipment can easily cost over $15,000, [24] which is not necessary when the user is willing to personally build and troubleshoot the unit for themselves. The resulting quality of open source hardware is dependent on the maker. Commercial instruments also generally come with a warranty to cover the cost of repair or replacement. Many models exist to estimate warranty value [25,26,27] however for the BioSamplr, repairs and maintenance would be very affordable, short of a catastrophic user induced failure, and it is the authors' opinion that a warranty is unnecessary in this situation. Scientists interested in the BioSamplr, as well as other open-source hardware, must compare the benefits of quality certifications and warranties with the associated costs to determine the value of these features for their specific situation. Another variable in the choice to use open source hardware is time. We estimate that with all necessary design files the BioSamplr construction will take only a few hours to understand and once all printed components have been obtained approximately three days to build. A summary of required print times is provided above (Table 5).  While the capabilities of commercial autosampling devices are useful (such as measuring flow rates [28,29]) and perhaps essential in various contexts, they are not necessary for many, particularly those in an academic setting, where the primary value of automated sampling is reducing requirements for manual attention or sampling at odd hours. The BioSamplr, is an open source, low costs solution to autosampling. The initial version enables routine sampling, and refrigerated sample storage, greatly reducing the hands on time associated with bioreactor runs. Future iterations of the BioSamplr, will be focused on enabling larger sample numbers to extend unmanned operation, and perhaps the development of DIY sample probes.

Declaration of Competing Interest
The authors declare the following financial interests/personal relationships which may be considered as potential competing interests: M.D. Lynch has a financial interest in DMC Biotechnologies, Inc., and Roke Biotechnologies, Inc.