Open-source lab hardware: A versatile microfluidic control and sensor platform

Graphical abstract


Hardware in Context
For the development of nano-, micro-, or mesofluidic experimental setups, lab automation, or lab-on-a-chip applications [1 -2], researchers often have to rely on relatively costly, specialized equipment to control, monitor, and automate their processes. These commercial microfluidic instruments then allow for the control of pumps and valves, and measure parameters such as flow, pressure, and temperature, often only via proprietary software. On the other hand, there are numerous OEM manufacturers of microfluidic components such as valves, pumps, and sensors, but these companies seldom supply the corresponding control electronics required for use. While there has been previous work on open-hardware controllers for microfluidics [3][4][5][6], they were still very application-specific and not generic enough to cover the broad spectrum of potential microfluidic applications.
Here, we present a compact (96.5 mm Â 96.5 mm), versatile, open-source platform which could be employed for a wide range of the everyday microfluidic needs (Fig. 1). The microfluidic control and sensor platform (MCSP) can control: solenoid valves, pumps, heater, lamps, or other DC loads an additional 16 latching valves one thermoelectric cooler (TEC) for temperature control a pressure controller and a high voltage power supply for electrokinetic or electrophoretic applications Additionally, it enables measurement and data acquisition from the following components: two temperature probes ambient temperature and relative humidity sensors two pressure sensors an electrochemical sensor for electrical conductivity. The board is also supports sensors for pH, oxidation-reduction potential (ORP), or ion-selective electrodes (ISE). a bubble (air/liquid) detector a liquid flow sensor voltage and current of an external high voltage power supply a current sensor The hardware can be directly controlled via USB by any serial console or terminal emulator (e.g., Arduino 1 Serial Monitor), can be automated with serial command/script execution (e.g., PuTTY 2 , or ZOC 3 ), or by writing a custom program and graphical user interface using, for example, Python 4 , LabVIEW 5 , or MATLAB 6 . We chose an Arduino and PlatformIO 7 IDE compatible Teensy 3.5 microcontroller, as it is compact but still provides sufficient computational power and memory, has an abundance of digital and analog pins, and is well-established within the open-source community.
With this versatile, easy to use, and comparatively low-cost microfluidic control and sensor board, we aim at lowering the entry barrier to microfluidics for research groups with a tighter budget all over the world. We provide an OEM platform for scientists with less background in electrical engineering, which can be used for a broad range of microfluidic applications, with no changes required to the hardware. The sequence of operation desired for a specific experimental setup can easily be defined using the documented serial commands. It is not necessary to make use of all the functional elements on the board. The platform will also work even if only a small section (any of the below features described in Sections 2.3 to 2.10) of the full board is used. For users more experienced in electronics, circuit design, and writing firmware, this manuscript aims at facilitating the development of novel, customized control boards by adapting the provided circuit elements and firmware libraries.
either the entire board can be populated to have access to all functionalities or just certain portions that are pertinent to a specific application, which can further lower the overall costs for the board. For example, if an application doesn't require temperature control, electrochemical or pressure sensors, these functional elements, and their components don't have to be soldered to the board. The only essential parts for any partial hardware configuration are the elements presented in sections 2.1 and 2.2.
In the following subchapters, the specific hardware elements will be presented in more detail:

Microcontroller
At its core, the board is controlled by a Teensy 3.5 development board (PJRC, CT, USA), a USB-based microcontroller development system. It features a 32-bit 120 MHz ARM Cortex-M4 processor with floating point unit, with 512 and 256 kB flash memory and RAM, respectively. With 58 digital I/O, 27 analog inputs at 13 Bits, two analog outputs at 12 Bits, 20 pulsewidth-modulated outputs, various communication protocols/bus systems such as USB, Serial, I 2 C, SPI and CAN bus, and an SD card, it is well equipped to control and read from a multitude of actuators and sensors (Fig. 2). All programming is done via the USB port, and the platform is compatible with the Arduino software and its libraries. The source code for this project, including all the required libraries, are made available in the supplementary materials. The Teensy can be powered directly through the USB cable, but here we recommend powering the Teensy via its VIN pin by applying 5 V, provided directly by the board. To avoid competition between the voltage from the USB and the voltage provided by the board through an external power supply, the VUSB line needs to be cut, which is explained in Section 5, Build Instructions.
The Teensy 3.5 also has a slot for a microSD card, which not only enables local data storage but also execution of programs and scripts directly from a file stored on the card. Since the potential application space of this hardware is vast, the users will have to adapt the firmware and implement this feature accordingly, and will hence not be covered in this manuscript.

Voltage Converters and Current Measurement
The board is powered via a 5.5 Â 2.1 mm barrel connector (J1) or a 2-pin header (EXT_PWR) (Fig. 3). We recommend applying 12 VDC, e.g., by connecting a wall adapter with sufficient power such as the Qualtek QFWB-65-12-US01, which can provide up to 5 A at 12 VDC. The input voltage is fed into two voltage regulators (VR1, VR2) to convert the 12 VDC to voltage rails of 5, 3.3, and À5 VDC. The voltage regulator for the 3.3 VDC rail (LMS8117, Texas Instruments) can provide a maximum current of 1 A, whereas the À5 and 5 VDC regulator (BEI15, Murata Power Solutions, UK) outputs up to 1.5 A per rail. The power to the board can be cut by a sliding switch (PSW), its state indicated by PWR_LED. The board's overall current can be measured by an INA169 current monitor chip, which can provide useful telemetry about the system and overall current (and hence also power) consumption of the peripherals. If no current sensing is required, U1, C1, and R1 can be  omitted and are therefore not essential. RSHUNT1 can be replaced with a 0 X resistor or the contacts can be bridged by other means. It is recommended that the user comments out the initialization and loop function pair in the firmware top page to stop querying the part which was omitted, in this case the INA169.

Load Switches for Valves, Pumps, Heaters, Actuators
A series of 16 N-channel MOSFET low-side load switches allow independent control of up to 16 components, such as DC motors, solenoids, pumps, valves, resistive heaters, etc., which can be connected to LS1 to LS16. The switches are equipped with a flyback diode, and 11 out of the 16 can be pulse-width modulated (PWM), marked with an asterisk, and are directly controlled via the Teensy's digital I/Os. Solder-jumpers on the back of the board (JP1 -JP16) allow selection between VIN (12 VDC) or 5 VDC for switches 1 to 12, and between VIN (12 VDC) or 3.3 VDC for switches 13 to 16, respectively, depending on what the end-user decides on connecting to the pin header. One instance of both variants (Load Switches LS1 and LS13) is depicted in Fig. 4. Examples of components with relevance in microfluidic applications which can be controlled by these switches include DC motor-driven diaphragm or peristaltic pumps (e.g., NMP series from KNF or RP-Q series from Takasago),   solenoid-actuated fixed volume dispense pumps (e.g., LP series, The Lee Co., CT, USA), or non-latching solenoid valves (e.g., LHD or LFN series from The Lee Co, Series 99 valves from Parker, OH, USA, or the NV series from Takasago, Japan). The PWM ports can be used as quasi-analog outputs to control the speed of a DC motor or a pump. They also allow actuation of socalled spike & hold valves, which are advantageous over variants which must be energized at 100% duty cycle. Not only do spike & hold valves provide reduced energy consumption, they also avoid valve damage resulting when valves are kept fully energized at 100% duty-cycle, such as the VHS series micro-dispensing valves from Lee Co. Both spike duration and hold voltage (PWM duty-cycle) can be controlled by a serial command. Also, if desired, the PWM frequency can easily be changed in the firmware settings. We recommend selecting frequencies beyond the audible range to avoid humming sounds of the solenoids. One should be aware that the PWM resolution is inversely proportional to the frequency, such as 3,750,000 Hz at 4 bits, but only 915.527 Hz at 16 bits 8 . For the provided firmware, the authors chose an 8-bit PWM resolution, with a frequency of 234,375 Hz.

Latching Valves
Latching valves for fluidics or pneumatics, such as the LHL series from The Lee Co or NLV series from Takasago, are preferred for many applications, because they minimize power consumption and heat generation. The solenoid of these valves is latched by a permanent magnet, maintaining the valve in its current position even if de-energized. The valve is then toggled by inverting the applied potential, and hence current, to the solenoid pins, which is commonly accomplished by an H-bridge circuit. Here, we present an alternative, compact approach using a ½-H-bridge driver (DRV8844, Texas Instruments, TX, USA), which allows simultaneous and independent actuation up to four latching valves per chip. One valve pin is permanently grounded, while the applied potential on the other pin is either +5 VDC (to actuate the valve in the one direction) and À5 VDC (to toggle in the opposite direction). Whether the output of the DRV8844 is positive or negative depends on whether the inputs are HIGH or LOW. The driver chip is also equipped with independent Enable lines. If the Enable line is HIGH, the output is either +5 or À5 VDC, depending on the state of the Input line (hence the valve solenoid is energized). If the Enable line is LOW, the output is left floating, and therefore the valve is de-energized (see Table 1). The presented design (Fig. 5), as implemented on the board, allows actuating up to 16 latching valves (as well as any additional valves connected to the aforementioned Load Switches). Four DRV8844 are controlled by the 16 digital outputs of an I 2 C port expander (TCA6416, Texas Instruments). The Enable lines are bundled into two sets and directly controlled by the Teensy. To actuate a specific set of valves, the Input lines of the valves to toggle are inverted, and the Enable line is pulled HIGH for a short amount of time, usually 10-100 ms, causing the valves to switch their state before it returns to a floating and hence de-energized state (Fig. 16). Due to the voltage rating limitations of the DRV8844, only 5 VDC latching valves can be actuated with this circuit design. The valves can individually be connected to connector J3 by individual jumper wires or multiple valves by a ribbon cable. In the presented design, two Enable lines control eight valves at once to save I/O pins, but if the individual    input signal is kept unchanged, the valve position will remain unchanged even if energized for the duration of the Enable pulse.

Pressure Controller and Sensors
Many microfluidic applications are directly or indirectly controlled by pneumatics, such as using positive or negative pressure to push or pull liquids in a controlled fashion through microfluidic devices or to actuate pneumatic microvalves [7,8]. The board can power and control an electronic pressure regulator, such as the model 415 from Parker (Parker Hannifin Corporation, PA, USA) (Fig. 6). Via a digital-to-analog converter, the user can control the set pressure between 0 and 5 psi (0 to 0.34 bar) or up to 0-100 psi (0 -6.9 bar), depending on the model, with a pressure regulation accuracy of ± 1.5% and repeatability of ± 0.25%. The internally measured pressure can be read back via an analog pin. Additionally, two differential pressure sensors (various pressure ranges available) allow precise monitoring of these applied pressures via the microcontroller's analog inputs. The sensors' 5 V maximum output voltages are limited to 3.3 V by voltage dividers to account for the voltage range of the analog inputs. The pressure sensors can easily be connected by their barbed ends to rubber tubing.

Bubble Detector
It is often very useful for many automated fluidics processing systems to have liquid/gas interface sensors (often referred to as liquid or bubble detectors), be it to count or detect bubbles or droplets, which could, for example, automatically be diverted by valves upon their detection. Other applications include monitoring whether a specific reservoir runs dry to stop a pump or the entire routine automatically, or to check whether a system has sufficiently been primed with fluid (or the opposite, i.e. purged with gas). In combination with a precise, metered pump or known flow-rate, it is even possible to estimate the passing liquid volume in case gas bubbles separate it.
In this implementation, the board has been designed to accept one OCB350L liquid sensor (TT Electronics, UK), which can be connected to connector BD1 (Fig. 7). These sensors accept 1/16 00 , 1/8 00 , 3/16 00 , and 1/4 00 tubing, depending on their exact part number. The optical sensor will register whether there is liquid or gas in the tubing and relay it to the Teensy. Based on the nature of the liquid, its color, turbidity, or refractive index, as well as the transparency of the tubing, the detection threshold can be adjusted with the potentiometer (TRIM).

High Voltage Power Supply Interface
This board was specifically designed for the development of a capillary electrophoresis (CE) system, where high voltages are required to separate charged species. If it is the reader's intent to build a custom CE system, especially CE coupled to laser-induced fluorescence detection (CE-LIF), the authors would like to refer to two other parts of the series ''Open-Source Lab Hardware" [9,10]. However, not only CE, but a range of microfluidic applications require high voltages, such as electrochromatography, electrokinetic injections, isotachophoresis, electrowetting, and more [11][12][13][14]. The electronics described here are not capable of providing any high voltage (HV) output directly, but rather to interface with an auxiliary high voltage power supply (HVPS) through connector J_HV (Fig. 8). The interface is compatible with Spellman's UM8-40 series DC-DC HVPS (Spellman Corp., Hauppauge, NY), covering voltage ranges from 0 to (-)40 kV and output powers up to 30 W. Through this interface, the output voltage can be set to a specific value. Additionally, the maximum output current of the HVPS can be set by the controller, and while both the actual output voltage and current can be read back via two analog return signals. For safety precautions, the HVPS can be armed or disarmed by an enable line, indicated by an onboard LED (or also an external LED, e.g., for chassis mount, if connected to HV_LED).

TEC Controller, Thermistor, and Ambient Relative Humidity & Temperature Sensors
For precise fluid handling, controlled chemical reactions, or accurate sensor readings, it is often crucial to either keep a specific part, or the entire system itself, at a stable and well-defined temperature. This can be accomplished by Peltier elements, which can both actively cool or heat. On this board, we chose to implement an MTD1020T thermo-electric cooler (TEC) controller (Thorlabs, NJ, USA), with a cooling/heating capacity of up to 20 W (Fig. 9). It is mounted to the board by pin headers and controlled by the Teensy via UART. A Peltier element is connected to the TEC1 pin header, whereas the feedback thermistor, taking the temperature of the thermal mass being controlled, is connected to THERM1. The controller can be enabled or disabled by the Teensy via a digital pin, and its status can be read by a second pin and visualized by an LED (TEC_STS). One more thermistor can be connected to the connector THERM2, to take a second, independent measurement at a different location in the system. For specific commands and configuration of the TEC controller, the reader is kindly referred to Thorlab's MTD1020T manual.
To additionally monitor the ambient relative humidity and temperature, the board is equipped with a Si7021 sensor chip (Silicon Labs, TX, USA), which communicates via the I 2 C lines with the microcontroller directly. Keeping track of these key environmental factors is often desired for the reproducibility of experimental data and vital for lab automation.

Electrochemical Sensors
To measure pH, oxidation-reduction-potential (ORP), electrical conductivity (EC) of the studied liquids, the board also offers pin headers to accept one EZO TM circuit from Atlas Scientific (Atlas Scientific LCC, NY, USA). Depending on the mounted circuit and the corresponding probe connected to the SMA connector X1 (Fig. 10), the board is capable of measuring either pH, ORP, and EC, as well as dissolved oxygen, flow, and temperature. With the ORP circuit, it is even possible to read from  The user is referred to the EZO TM manual on how to use and calibrate the circuits appropriately.

Auxiliary I 2 C Ports
The board features two I 2 C pin headers, one for devices with a bus voltage of 3.3 VDC, and one for 5 VDC (Fig. 10). This enables connection of additional, auxiliary devices to the board, enabling it to be tailored to specific applications. Via these auxiliary ports, it is possible, for example, to add additional electrochemical sensor EZO TM boards if multiple parameters need to be monitored at the same time (i.e. temperature and pressure). These ports can also support any other I 2 C compatible device such as LED drivers, displays, non-volatile memory, optical sensors, etc.
For many microfluidic applications, having a precise, in-line flow-rate sensor can be particularly useful. To this end, we wrote libraries that can read from a variety of different, bi-directional liquid flow meters from Sensirion (LG16 and LPG10 series), covering flow ranges from 0.01 to 10,000 mL/min. The flow sensors can directly be connected to the board's auxiliary ports (J33 or J50, depending on voltage) and be monitored by the firmware via the Teensy. To enable operation of the flow sensor, uncomment line 51 in the void setup tab on the front page of the firmware, then re-upload the firmware to the board. Conversely, if a flow sensor is not implemented, line 51 needs to be commented out of the code, and then the new code should be uploaded. The LG16 flow sensor is a 5 V device and would therefore have to be connected to J50. The default unit for the flow-rate output is set to nL/min.
A CAD rendering of the assembled board, together with the component location is provided in Fig. 11. For convenience, a 3D-printable enclosure is also provided along with the rest of the design files (Fig. 12).  9. A Peltier element can be connected to TEC1 and controlled by U3. The temperature is monitored with a thermistor connected to THERM1. The TEC status is indicated by an LED (TEC_STS). An additional thermistor can be connected to THERM2 to independently measure an additional temperature. Ambient temperature and relative humidity are measured by U6.

Bill of Materials
The main supplier of parts for this board is Digi-Key. There are additional suppliers for specific parts such as Atlas Scientifc, Sparkfun, and Thorlabs. Most of the components are 0805 supply package resistors and capacitors, as they do not take up too much board space, yet they are large enough to be easily soldered by hand. The additional integrated circuits were chosen with the same goal in mind, to easily be soldered by hand, hence IC's with underside pins were not used. Surface mount  Solder all SMD components to the PCB first, followed by soldering all through-hole components and connectors. Cut the trace between the two solder jumpers at the top right on the back of the Teensy to separate VIN from VUSB, to use the power provided by the mainboard (Fig. 13).
Although the Teensy controller itself and other components such as the TEC controller or electrochemical sensor board could be directly soldered to the mainboard, the authors recommend using female socket connectors for easy replacement. Make sure to mount these components in the correct orientation. Close solder bridges for individual load switches according to the required voltage for specific application (Fig. 14). Connect the middle pad to the left or right pad. Never bridge all three pads since this would cause a short between two power rails. If the solder jumpers J1 -J16 are not set in either configuration, the load switches will not be operational. Enclosure: 3D print enclosure bottom and lid. Install 4-40 (or M3) heat inserts or tap screw holes directly. Mount board inside the bottom enclosure using four 4-40 (or M3) screws. Close lid using four 4-40 (or M3) screws. Operation Instructions

Upload Firmware
In this section, the initial programming of the microcontroller is explained. Unless the user wishes to customize the firmware, this only needs to be done once. If the Teensy controller needs to be replaced, repeat steps 4 -6.

Serial Command List:
Below, a list of serial commands that can be sent to the microcontroller. Most commands must begin with { and end with }. Inside the brackets is the command itself. A command consists of a series of identifying characters and a number of arguments separated by spaces. An example command would be { A B 100 1000 }, where A and B are the identifying characters, 100 the first argument, and 1000 the second argument. It will be listed in the following format:  The user is referred to the Atlas Scientific EZO TM datasheet for detailed operation and calibration. The above is a selection of basic commands, allowing the user to explore the possibilities of the presented electronics board. The authors understand that some users might have different requirements and hence encourage them to amend the firmware and command library how they see best fit. Other Atlas Scientific EZO TM sensor boards (such as pH, ORP, DO) can also be used in combination with the presented hardware.

Automated Control
The hardware can be automated with serial command/script execution (e.g., PuTTY, or ZOC), or by writing a custom program and graphical user interface using, for example, Python, LabVIEW, or MATLAB. The firmware could also be modified in such a way that an automated protocol or state machine could be written as part of the firmware itself, or the sequence of operation could be read from a file on the SD card. Since the different options and applications are vast, this will not be covered in this publication and is considered beyond the scope of this paper. A general description on how to communicate with the SD card is, for example, provided here: https://github.com/greiman/SdFat.

Validation and Characterization
The potential applications with the presented hardware are countless and it is not possible to cover all of them here. A few basic and general functions are presented below. While the control interface of the thermo-electric controller and the flow sensor to this board have been verified by the authors, a comprehensive demonstration or validation is beyond the scope of this paper, and the reader is referred to the manual of the respective sensors.

Load Switches
Besides switching connected loads, such as valves, pumps, motors, etc. at 3.3, 5, or 12 V, the load switches can be operated in the previously mentioned spike & hold fashion. To do so, the full potential is applied for a brief period of time (''spike", e.g., to provide sufficient energy to move a valve piston), but then less power is required to ''hold" this piston in its position. This is achieved by reducing the duty-cycle of the PWM signal. Fig. 15 depicts a recorded oscillograph across a dummy load (250 X resistor) using an HMO1024 oscilloscope (Rohde & Schwarz, Germany), spiking to 12 V and then switching to a duty-cycle of 50%.
These load switches have been verified to work with a series of spike & hold valves (e.g. LFN and VHS series from The Lee Co, Series 99 valves from Parker), pumps both for liquid and air (e.g. RP-Q series from Takasago, LPM and LPL series from The Lee Co., and CTS series from Parker).

Latching Valves
As a permanent magnet keeps latching valves in their current state, no holding current is required, and the valve can be de-energized after an initial spike. This spike allows the valve to switch its state. If the polarity of this spike is reversed, the valve switches to its opposite state, and the valve can be de-energized again. In Fig. 16, a sequence of four spikes is recorded using the abovementioned oscilloscope. A first peak to +5 V for 100 ms is used to actuate the latching valve in one direction, followed by a second spike to À5 V after 1 s, to switch the valve position, and a third spike again at +5 V.
This circuit to control latching valves has been verified with LHL Series 2-and 3-port magnetically latched solenoid valves from The Lee Co.

Pressure Controller & Sensors
To demonstrate the board's ability to precisely control and measure pressure, a Parker Model 415 electronic pressure regulator was connected to J2. The resulting output pressure was measured with one of the two onboard pressure sensors. Two Model 415 were tested, one with a full-scale range of 15 psi and another with 50 psi. Fig. 17, left, depicts the measured linear dependency of the set versus measured pressure over the full range of the 15-psi controller. On the right, the measurement has been repeated for the 50-psi controller while focusing on the very end (<2.5 psi) of the controlled pressure range. Even at these low pressures, there is still a linear dependency of the control voltage versus pressure, with an average standard deviation of < 0.02 psi. Again, depending on the pressure controller and sensor used, the firmware needs to be adjusted to make sure the pressure values are scaled correctly. The firmware controls and reads both the pressure sensor and pressure con- Fig. 15. Oscillograph of a spike & hold actuation of a load switch across a 250 X resistor. The spike duration was 16 ms at 12 VDC, before switching to a 50% duty-cycle. troller in bit integers. If the user prefers different units, such as kPa or mBar, this can also directly be implemented in the scaling factor.

High Voltage Power Supply Interface
A high voltage power supply can be connected to J_HV and controlled through the provided firmware. For the experiments below, a UM20N4/C/T/M HVPS from Spellman was used. Once enabled, the output voltage of the HVPS can be controlled via the interface's HV_VSET pin. As depicted in Fig. 18, the output voltage linearly depends on the set voltage. The high voltage was measured used a Fluke 174 multimeter equipped with a high voltage probe (Fluke Corporation, WA, USA). To measure and calibrate the current output of the HVPS, a 100 MX resistor was installed between the HV output and ground, and the current monitor output was measured versus various voltages. In combination with the measured output voltage, the known resistor value, and Ohms-Law, the resulting current can be calculated based on the current monitor output and expressed in uA. As mentioned above, if an HVPS with a different voltage and current range is used, this calibration needs to be repeated, and the firmware adjusted to represent the output correctly in HVPS.cpp lines 39 and 49 for current and voltage, respectively.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Dr. Willis is the Supervisor of JPL's Chemical Analysis and Life Detection Group. His research focuses on invention of methods and technologies capable of identifying and characterizing signatures of extraterrestrial life at the molecular level. He has played a key role in the formulation of a variety of mission concepts to explore Titan, Enceladus, and Europa. In addition to laying the foundation for these missions of the coming decades, Dr. Willis also serves as a project staff scientist for the NASA Perseverance rover mission to Mars, and is an Adjunct Professor in the Department of Chemistry at University of Kansas.