1 Introduction

Microfluidic technology promises to improve the analysis and synthesis of materials, by minimizing sample size, precisely controlling the microenvironment and by rapidly combining multiple chemical processes using micro-mechanical valves (Kartalov et al. 2006; Sanchez-Freire et al. 2012), droplets (Seemann et al. 2012) or electrochemistry (Zimmerman 2011). Microfluidics are especially suited for rapid combinatorial synthesis and high-throughput screening due to low reagent cost and precise fluid and environmental control (Ahrar et al. 2014) (Melin and Quake 2007). For example, Velncia and colleagues demonstrated the combinatorial micro-synthesis of nanoparticles evolved to evade macrophage uptake (Valencia et al. 2013), while Pascali and colleagues used a similar approach to optimize the production of 18F radiotracers (Pascali et al. 2014). However, the complexity of integrating the experimental measurements with the microfluidic circuits prevented these groups and others from completely automating their processes. It is clear that the ability to automate complex optimization algorithms in microfluidics would provide groundbreaking utility to many groups in the field.

One of the challenges facing the automation of microfluidic circuits is the lack of synchronization. Microfluidic platforms often contain analog perfusion components, digitally controlled micro-valves and experiment-specific sensors that are discreetly controlled by different communication protocols, have different power demands, and use different control interfaces. This distribution of control modalities complicates process integration and feedback. For example, sensors often need to be manually synchronized with the microfluidic unit, and their data acquisition can seldom be analyzed in time for experimental parameters to be adjusted automatically. One solution to synchronize microfluidic flow elements and data acquisition is to control all modules through a single open framework microprocessor. The advantage of this approach lies in the ability of microprocessors to carry out complex optimization algorithms such as simulated annealing (Kirkpatrick 1984), multiple hill climbing (Tovey 1985) or genetic algorithms (Kreutz et al. 2010). Each one of these optimization algorithms presents a different set of challenges, including: the implementation of prioritized data structures in a genetic algorithm, distributed computational efforts in multiple-hill climbing searches, and real-time realization of probabilistic models in simulated annealing.

Open source microprocessors, such as Arduino™, Raspberry Pi, and .NET Gadgeteer are common choice for cost-effective controllers (Pearce 2012). For example, Fobel and colleagues built a control unit for digital microfluidics using Arduino™ 8-bit Atmel AVR microcontroller, regulating high-voltage amplifiers and electrode array for precise control of electrostatic driving forces and velocity measurements (Fobel et al. 2013). Microsoft .NET Gadgeteer is a more recent product designed for object-oriented programming and multiple thread handling that simplify the implementation of complex algorithms. It features a 72 MHz 32-bit ARM7 microprocessor, 16 MB RAM, LCD controller, and a full support of TCP/IP Ethernet, WIFI, and Bluetooth communication. Importantly, the Gadgeteer supports all standard data protocols including USB, SPI, I2C and UART (i.e. RS-232). Notably, the Gadgeteer already supports a wide range of optical, electrical, and chemical sensors that were specifically designed for the platform and can be connected using its plug and play interface.

In this work, we developed a Gadgeteer 32-bit ARM7 microprocessor-based control unit, utilizing the .NET micro-framework, and mounted it on a high-current electronic interface that supported and synchronized digital solenoid-controlled micromechanical valves, analog pressure regulators for flow, and a UART-controlled optical CCD and electrochemical sensors. An integrated LCD touch screen and TCP/IP interface provided local and remote control of flow and data acquisition. To establish the ability of this control unit to synchronize complex microfluidic circuits we developed an equi-pressure combinatorial mixer. We demonstrate the generation of complex perfusion sequences, by connecting an electrochemical lactate sensor downstream of a liver bioreactor exposed to the environmental toxin rotenone. Our system permits automated sampling, washing, and calibration of the electrochemical sensor, providing continuous real-time measurement of cell viability. Finally, we demonstrate the ability of our system to close negative feedback loops through a CCD sensor that monitors color changes in real-time. We show the implementation of complex optimization protocols that require different computational challenges including a genetic algorithm, multiple-hill climbing searches, and simulated annealing. Our system offers the first comprehensive solution for establishing optimization protocols in complex microfluidic circuits.

2 Results

2.1 System design and specifications

Microfluidic platforms are composed of discrete analog and digital perfusion components and sensors that have separate communication protocols, power requirements, and control interfaces limiting system integration. To address this we designed a control unit based on Gadgeteer FEZ Spider mainboard containing 32-bit ARM7 microprocessor and 11 MB of user available RAM, extended with the Hub AP5 board for a total of 23 control sockets (Fig. 1a and b). The control unit was connected to analog pressure regulators driving two 12-valve pressure manifolds that control a microfluidic switchboard and positive-pressure perfusion. The switchboard fed into an equi-pressure combinatorial mixer containing an inspection chamber monitored by a UART-controlled optical CCD sensor connected back to the FEZ Spider mainboard, completing the circuit (Fig. 1a).

Fig. 1
figure 1

Schematic of a microfluidic multithreaded control circuit. a The microfluidic control circuit is composed of a microprocessor control unit that utilizes analog and digital signals to control pressure regulators and two solenoid valve manifolds, respectively. One manifold controls 12 pressurized fluid reservoirs, while the second manifold controls 12 elastomeric valves on a microfluidic switchboard. The switchboard is connected to a microfluidic mixer and an optical sensor that feeds back to the control unit using any number of communication protocols. b The control unit is composed of a 32-bit ARM7 microprocessor, extension board, touch screen interface, and an electronic interface that supports high-current digital components and generates the analog signal (Supplement Fig. S1, S2). c Dynamics of multiple optimization algorithms obtained using the closed loop microfluidic control circuit. d Microsoft .NET environment permits rapid modification of the design using a plug and play interface. e TCP/IP communication protocols allow a remote control interface with the microfluidic circuit

To bridge between the control unit and the perfusion components we designed a high-current electronic interface that bridges variable power consumption, modulates power distribution from a standard AC source, and implements control of analog lines (Fig. 1b, Supplement Fig. S1, S2). Specifically, analog signal modulation was carried out using passive linear voltage dividers, featuring an output range of 0–10 V and a 7-bit SPI controlled potentiometer with volatile memory. The electronic interface permits a rapid replacement of through-holes resistors in each voltage-dividing module, to modulate the system dynamic range. In addition, as solenoid valve actuation requires 1 W (5–10 V), we implemented a series of high current Darlington transistor arrays supporting 24 units of 1 W (5–10 V) digital lines, each line connected to two Darlington channels supplying up to 0.5A each. Our Darlington transistors have an operating delay time of 0.15 μs and a turn-off delay of 1.8 μs enabling 0.5 MHz of switching capabilities, significantly faster than solenoid response time of 30–50 msec.

This integration permits the fully automated implementation of optimization algorithms (Fig. 1c), utilizing either an embedded touch screen or remote interface through standard TCP/IP improving system portability and miniaturization (Fig. 1a and e). Importantly, our system provides the user with hardware plug and play interface embedded within the Microsoft .Net microenvironment that enables rapid prototyping utilizing programs such as MATLAB for user interface design (Fig. 1d and e).

2.2 Equi-pressure combinatorial mixing

Microfluidics permits both batch (Melin and Quake 2007) and continuous on-chip mixing (Lee et al. 2011). However, changing mixture combinations produces fluctuations in flow and shear forces, either due to batch loading (Tseng et al. 2007) or by adding or subtracting fluid from a passive mixers (El Moctar et al. 2003). As flow and shear fluctuation disturb biological applications and complicate sensor synchronization, we designed an equi-pressure combinatorial mixer composed of a microfluidic switchboard and a passive mixer (Fig. 2a and b). The microfluidic switchboard consists of 11 inlets and a common outlet (Fig. 2a) that are regulated by self-addressable micromechanical valves. The valves are controlled by one pressure manifold, delivering precise combinations of fluids to the mixer unit. Flow is driven by positive pressure provided by a second, independently controlled pressure manifold (Fig. 2c and d). Pressure across the manifold is held constant by an analog regulator, resulting in an equal pressure distribution on all open ports, and a constant fluid velocity irrespective of the number and combination of inputs (Fig. 2e). Importantly, the delay time required to refill the inspection chamber becomes constant, even with arbitrary combinations of inputs, allowing us to automate sensor sampling.

Fig. 2
figure 2

Combinatorial mixing of fluids. a Design of the microfluidic switchboard, which utilizes air pressure driven microfluidic channel gating achieved by a PDMS double layer pneumatic valve. The microfluidics switchboard consists of 11 inlets and a common outlet, where self-addressed control channels can open and close each of the inlets for combinatorial switching, delivering variable combinations of specified fluids to a diffusion mixer unit b The assembled microfluidic devices. The mixer is demonstrated using mixing of two color dyes. The switchboard was filled with two color dyes: red indicates flow channels blue indicates control channels. Bar = 8 mm. c Schematic of the system. The control unit is connected to two pressure manifolds and two pressure regulators. One manifold is connected to the switchboard via the control lines and the second is connected to pressurized fluid reservoirs via flow lines. The pressurized reservoirs are connected to the switchboard. Switchboard output is connected to a mixer, which is connected an inspection chamber. The inspection chamber is being continuously monitored optically with a camera that connected to the control unit. Bar = 3 mm. d Combinatorial mixing of three different colors using our system for the generation of two different colors e Creation of a dilution curve of the color blue while keeping a steady flow rate. Each dilution level is achieved by splitting the perfusion pressure to drive an additional velar fluid to the mixing chamber

To demonstrate this behavior, we programmed a serial dilution curve while automatically monitoring perfusion rates and color intensity (Fig. 2e). Results show that the perfusion rate variability was maintained within 2 % of baseline during pattern adjustment. Delay time remained constant in each step.

2.3 Real time monitoring of hepatic toxicity using automated sampling and calibration of electrochemical sensors

Monitoring of environmental toxicity requires the utilization of living cells to evaluate the presence of unknown toxins in drinking water and soil samples. Electrochemical sensors can provide real-time measurement of cell viability but require washing cycles between samples. In addition, to obtain absolute values the electrochemical sensors require air purging to calibrate for zero concentration.

Human Huh7 cells were seeded in a microfluidic chamber at a density of 1 × 106 cells/ml producing a confluent monolayer. Cells were exposed to 100 μM of the pesticide rotenone, a mitochondrial complex I inhibitor. Perfusate was connected to a high resistance waste syringe and a single inlet of the microfluidic switchboard for automated sampling (Fig. 3a). We used the microfluidic switchboard to perfuse a sequence of buffer, air, sample and air over an enzymatic-amperometric lactate sensor every 2 h (Fig. 3b–c). Introduction of air acts as a diffusion barrier preventing sample contamination and providing zero-point calibration. Between each experiment a calibration medium was introduced to correct sensor drift. The electrochemical sensor was connected to an embedded potentiostat that can communicate with the Gadgeteer using a UART protocol. A fully automated 16.5 h experiment was programed allowing the derivation a time-of-death of 5.5 h (Fig. 3d).

Fig. 3
figure 3

Real time monitoring of hepatic toxicity using automated sampling and calibration of electrochemical sensors a Flow system schematics: microfluidic switchboard (blue) connected to air (white), phosphate buffer saline (gray), a single outlet of the liver bioreactor, and the electrochemical lactate sensor (green). The second outlet of the liver bioreactor is connected to waste (W). Control valves are shown in black. b Sequential addition of sample (red), followed by air purging (white), and washing buffer (blue). Bar = 200 μm. c Readout from the sensor for a sequence of calibration fluid, buffer, air and a sample. The output current is proportional to the fluid Lactate concentration d Real time measurement of lactate production in perfusate of liver bioreactor exposed to 100 μM rotenone. Huh7 cells die within 5.5 h of exposure to the pesticide. e Image and schematics of the microfluidic lactate sensor and its low-volume PMMA housing

2.4 Implementation of optimization algorithms

Optimization algorithms present computational challenges ranging from data structures to multithreading. To demonstrate the ability of our control unit to execute and completely automate these algorithms, we optimized color matching using the combinatorial mixer described above. Three randomly generated target colors were provided to the optical CCD sensor and split into their red, green, and blue components. Fitness was defined as the additive sum of distances between the target and measured colors, for each component. Search space was composed of 11 random colors, constituting 211 different states.

We first implemented a naïve random walk to define the baseline (Fig. 4a). The algorithm requires that the microprocessor keep track of best fitness, producing relative poor results in 12 cycles (Fig. 4b–d). Multiple hill climbing is a more advanced algorithm that iteratively attempts to improve fitness by changing a single parameter, or in our case to remove or add a color to the mixture. As hill-climbing searches can get stuck at a local minima (Tovey 1985) (Fig. 4e), the ARM7 microprocessor was used to generate three independent parallel searches using multithreading (Fig 4f–h). Multiple hill climbing produced excellent results in 9 to 10 cycles.

Fig. 4
figure 4

Implementation of optimization algorithms. a Schematics of random walk, where states are evaluated consequently in a random manner. bd implementation of random walk for the generation of purple, green and cyan. e Schematics of multiple hill climbing search, where multithreaded initialization of searches are executed, where each step incrementally improve upon preceding state. fh implementation of multiple hill climbing search for the generation of purple, green and cyan. i Schematics of simulated annealing search, where consecutive states are tolerated based on a time-dependent mathematical formulation. jl implementation of a genetic search for the generation of purple, green and cyan. m Schematics of a genetic search, where generation of candidate states are screened, mutated and recombined in order to produce a more fitted generation (np) implementation of a genetic search for the generation of purple, green and cyan. In (ap) the red dashed line indicates the most fitted state, which was evaluated by the optimization algorithms by the current iteration. (qs) Comparison between the results of each of the implemented search algorithms. Results show that relative to the randomized search, all other algorithms show significant improvement, there is no specific optimization algorithm that persistently provides the most fitted result

Simulated annealing is a probability-guided algorithm for approximating a global optimum in a large search space (Fig. 4i). At each step, the algorithm considers an alternative and decides whether to jump or not based on probability function P, defined as,

$$ P\left(s,T\right)=\left\{\begin{array}{cc}\hfill {e}^{-\varDelta f(s)/T},\hfill & \hfill \varDelta f(s)\ge 0\hfill \\ {}\hfill 1,\hfill & \hfill \varDelta f(s)<0\hfill \end{array}\right. $$

where Δf(s) is the difference in fitness between two states and T is a parameter that decreases risk tolerance with time. We used the control unit to implement simulated annealing, when T was initially set to 80 decreasing 10 per cycle (Fig. 4j–l). Simulated annealing produced excellent results, continuing a steady improvement even after 12 cycles.

Finally, we implemented a genetic algorithm that adaptively exploits historical information to direct the search, using prioritized data structures. The algorithm evaluates four randomly generated states, selecting the top 2 states to recombine as new candidates. The candidates are ranked against the early states and the top 4 candidates constitute the next generation (Fig. 4m). The control unit constantly assessed progress in terms of average fitness, worst and best states (Fig. 4n–p). A genetic algorithm produced excellent results in 8 to 9 generations. Overall perfusion time was 5 ± 0.5 min per iteration. The control time was 0.2 ± 0.1 s for random walk, 0.75 ± 0.3 s for multiple hill climbing, 0.5 ± 0.1 s for simulated annealing and 0.5 ± 0.35 s for the genetic algorithm.

As expected, all three optimization algorithms showed significant improvement over random walk. Interestingly, while a genetic algorithm and multiple hill climbing converged faster than simulated annealing, the latter showed constant improvement even after 12 cycles (Fig. 4q–s). The inability to declare one optimization algorithm as an ideal choice gives a robust system able to execute different algorithms automatically a great advantage.

3 Discussion

In this work, we demonstrate a complete integration of a microfluidic system using a single microprocessor-based control unit. Analog perfusion and digital valve control were regulated using a newly designed high-current circuit, while Microsoft .NET plug and play interface allowed the integration of a UART-controlled optical CCD sensor, electrochemical lactate sensor, LCD touch screen and TCP/IP access. In fact, this open environment allows designers to access libraries of commercially available Gadgeteer sensors and open source software. Importantly, system integration can naturally synchronize between sensors, valves, and fluid permitting the realization of feedback loops and complex control logic.

System integration is an imperative developmental milestone for the field of microfluidics, both in terms of the scalability of increasingly complex platforms, the efficient incorporation of emerging technologies, and in overcoming barriers to the adoption of the technology. Recent work outlined approaches for integration of microfluidic system design (Neuzil et al. 2014; Araci and Brisk 2014) as well as modular system fabrication (Bhargava et al. 2014). It is clear that integration of control processes is a necessary next step in the evolution of the microfluidics.

We note that system integration presented in this work goes beyond current commercial and academic effort to control flow in microfluidic systems. For example, Fobel’s open-source digital microfluidic automation system enables the control of drop position and velocity using electro-wetting (Fobel et al. 2013), but cannot be readily extended to handle flow component or complex algorithms. The power of our system was demonstrated by the implementation of computationally intensive optimization algorithms, including a genetic algorithm, multiple-hill climbing, and simulated annealing. While our work demonstrated a solution for a simple color-matching problem it is readily applicable for other systems. For example, Kreutz and colleagues used plug-based microfluidics to discover new catalysts for methane oxidation by implementing a genetic algorithm based evolution (Kreutz et al. 2010). Microfluidics permitted the screening of 192 plugs using an optical indicator dye, but library construction and evolution was carried out in a microliter plate. Similarly, Pascali and colleagues approach to optimize PET tracer production relied on an off-chip analytical characterization and evolution (Pascali et al. 2014). Wang and colleagues used microfluidics to identify rare xylose-consuming cells using microfluidic droplets. Cells had to be compartmentalized in one device, incubated and introduced manually into a second device for sorting (Wang et al. 2014). Our system would enable a complete automation of many such processes, improving yield and permitting the realization of complex optimization algorithms.

In fact, as microfluidic applications rapidly expand from engineering laboratories to chemists and biologists, we believe it is critical to create an open-source platform that would allow non-programmers to rapidly expand and control their system. The simple plug and play interface supported by the auto-generated code engine of the Gadgeteer is uniquely powerful, making the system readily accessible to chemists and biologists that have little background in software or electrical engineering. The Gadgeteer is specifically designed for object-oriented programming and multiple thread handling, permitting the rapid implementation of complex data structures and optimization algorithms.

4 Methods

4.1 Microcontroller

Gadgeteer mainboard and extension modules were purchased from GHI electronics (Madison Heights, MI). The control unit was composed of a 32-bit ARM7 microprocessor mounted on the Microsoft FEZ Spider Gadgeteer mainboard. Mainboard functionality was extended with Hub AP5 module that adds 9 additional sockets, a USB client Dual Power module to enable microprocessor programming, a TE35 LCA 3.5″ touchscreen display module, USB and RS-232 modules that allows the control of sensors and peripherals. A serial camera L1 module was added directed for optical inspection. Finally, Ethernet ENC28 module provided a TCP/IP operation mode (Fig. 1).

4.2 High-current electronic interface

The high-current circuit was designed using DipTrace software (Supplement Fig. S1), and printed in a two-layer layout at Beta LAYOUT (Aarbergen, Germany). Controller unit case was designed and fabricated in the Hebrew University workshop. Our control system required a branched voltage module that integrates numerous voltage stabilization circuits and an array of capacitors that filter high frequency ripple voltages and spikes. The control unit was connected to a standard 220v 50 Hz AC power outlet, which was reduced to 5v using a transformer (MeanWell, New Taipei City, Taiwan) to power the microprocessor and the digital control unit and to 26v to power the pressure regulators and the analog voltage module via an 18v linear voltage regulator (Toshiba, Tokyo, Japan).

The electrical circuit design and part list are available online (Supplement Table 1, Supplement Fig. S2). The 24 controllable high current digital lines were controlled by the general-purpose input output (GPIO) sockets via a series of high current TD62783 Darlington transistor arrays (Toshiba, Tokyo, Japan). Each driver supports 3.3v logic operation and a 5v driving voltage. The analog control module was composed of passive linear voltage dividers, which were implemented using a passive resistor and an 8-bit SPI controlled MCP4131 potentiometer with volatile memory (Microschip, Chandler, AZ). Gadgeteer driver library was expanded to support the SPI data protocol controlling the potentiometer.

4.3 Fabrication of Combinatorial Mixer

Poly(dimethyl)siloxane (PDMS) was purchased from Dow Corning (Midland, MI). SU8 and AZ-4652 were purchased from MicroChem (Newton, MA). The microfluidic switchboard was fabricated using two photo-lithographically defined masters, one for the flow layer and the second for the control. The flow layer mold was defined by reflow of AZ-4652 photoresist to allow tight sealing, and cast to 40 μm height. Briefly, an adherent layer of Hexamethyldisilazane (HDMS) (Sigma, 440191) was spin coated at 4000 rpm for 30 s. Four layers of AZ-4652 were sequentially spin coated at 800 rpm for 40 s, baked for 5 min at 100 °C and exposed to UV light for 90 s. Reflow was gained by gradual increase of temperature rising from 35 to 150 °C over 3 h and hard-baked over night at 150 °C. Both the control layer of the switchboard and the microfluidic mixer were defined by SU-8 photoresist, cast to 100 μm height at 2000 rpm for 60 s, pre-baked for 25 min at 100 °C, exposed to UV light for 15 s and post-baked for 12 min. Masters were developed treated with Trichlorosilane (Sigma, 175552) to allow easier removal of the PDMS after curing. Fabrication was performed in a class-100 clean room environment of the Hebrew University Center for Nanoscience and Nanotechnology. Each layer was cast separately by replica molding of PDMS and then aligned and bonded via curing agent diffusion as previously described (Melin and Quake 2007). PDMS devices were covalently bonded to glass using oxygen plasma activation.

4.4 Flow system

Flow components include 24 1W/5v digitally controlled normally open solenoid valves (Festo, Yehud, Israel) that were assembled in two independently controlled pressure manifolds. Each manifold was connected to a 3-way proportional pressure regulator (Festo, Yehud, Israel), with an analog set-point signal of 10v and a linear range of 0.15 to 6 bar. One manifold was connected to 15 mL fluid reservoirs (Fluigent, Paris, France) and pressurized at 0.4 bar. The second manifold was used to actuate the switchboard’s control channels with a pressure of 1.05 bar. The switchboard flow outlet was connected to a microfluidic mixer monitored by an optical camera, as described above. For the implementation of the color matching, we perfused a set of food coloring (Hanamal, Beer Yaakov, Israel).

4.5 Cell culture, seeding and sampling

Huh-7 cells were obtained from the American Type Culture Collection (ATCC, USA). Cells were cultured under standard conditions in a humidified incubator at 37 °C under 5 % CO2 in Dulbecco’s Modified Eagle Medium (DMEM) supplemented with 10 % fetal bovine serum (FBS), 100 U/ml penicillin and 100 μg/ml streptomycin. Growing cells were trypsinized, counted, mixed and centrifuged at 300g for 5 min at 4 °C. The cell pellet was suspended with serum free DMEM to a suspension density of 1 × 106 cells/ml and introduced to the device at 5 μl/min to create a confluent monolayer (Fig. 2b). The microfluidic device was continuously perfused with serum free DMEM containing 100 μM of Rotenone at 0.4 μl/min.

4.6 Lactate measurements

An enzymatic-amperometric lactate sensor (BST, Berlin, Germany), was placed in a modular Poly(methyl methacrylate) (PMMA) flow-cell chamber (Fig. 3e) with an inner working volume of 2 μl as was previously described (Prill et al. 2014), connected to the Gadgeteer via an embedded potentiostat (EmStat3 OEM, PalmSense, Germany) and controlled with UART using the .Net software development kit provided by the manufacturer. The sensor is based on the enzymatic reactions of lactate oxidase (LOx, linear range of the sensor: 0.5 to 20 mM), which was employed in the 2-electrode configuration (Fig. 2e). The sensor yields H2O2 in amounts proportional to the lactate concentration, detected with polarized platinum electrodes. The control system was programed to perfuse the sampled aliquots in regular intervals of 2 h at 5 μl/min in a repeated sequence of buffer (PBS, Sigma, Israel), air that acts as a diffusion barrier, and sample. The buffer and the sampled aliquot were perfused for 200 s for proper sensor reading and air was introduced for a few seconds. Between each experiment a calibration medium was perfused to correct drifts of the sensed signals (CAL 4 + M, Eschweiler, Kiel, Germany).

5 Conclusions

System Integration is an imperative developmental milestone for the field of microfluidics, both in terms of the scalability of increasingly complex platforms that still lack standardization, as well as the incorporation and adoption of emerging technologies in biomedical research. This work describes the first modular integration and synchronization of a complex microfluidic platform permitting the first implementation of user-independent optimization algorithms. The versatility and modularity of our open-system unit can be rapidly adopted by leading groups in the field for automation and optimization of droplet generation, inertial focusing purification, single cell analysis and large-scale integration (LSI).