Design and Construction of an Open Source-Based Photometer and its Applications in Flow Chemistry

The design and construction of a low-cost and compact USB photometer based on open source hardware and software is described. The device, featuring a 1 ms sample acquisition time, utilizes a single interchangeable light emitting diode (LED) as a light source in combination with photodiode detectors and a Texas Instruments LaunchPad as the main control unit. An appropriately constructed flow cell can be connected to a flow reactor made out of transparent polymeric material such as perfluoroalkoxy (PFA) tubing. The flow cell can be moved to different positions of the tube in order to take measurements at different residence times without having to disassemble the photometer or the flow reactor system. The bespoke photometer was used to determine the residence time distribution (RTD) of various microreactors/micromixers, as well as for measuring the reaction rate constant for the base-induced hydrolysis of p-nitrophenol acetate in a biphasic segmented flow system. Owing to the 1 ms sample acquisition time of the novel device the lengths of individual segments can be measured in real time.


Introduction
Advances in synthetic organic chemistry combined with a multitude of sophisticated analytical techniques capable of providing rapid information on the structure and/or concentration of reaction intermediates and products have revolutionized modern chemical and pharmaceutical manufacturing. Traditionally, pharmaceutical manufacturing is conducted mostly using well-established batch processes accompanied by offline process analysis and process control. Although very useful as multipurpose reactors, such batch processes often suffer from poor reproducibility, have safety issues associated with process control and may lead to inconsistent product quality. For this reason, pharmaceutical companies and manufacturers are currently considering to convert batch to continuous processes. This transition requires the development of novel process analytical technology (PAT) tools for rapid and accurate real-time process analysis in order to ensure optimum product quality. 1 The benefits of flow chemistry and continuous manufacturing, in general, can be divided into two categories. First of all, there is much better heat and mass transfer in microreactors as compared to batch reactors, allowing for much wider operating windows and at the same time better process control. 2 Secondly, the ability to use and generate hazardous, highly toxic or unstable reagents and intermediates, ideally on-site and on-demand, thereby increasing safety and allowing so-called "forbidden chemistries" to be developed. 3 To fully exploit these benefits there is a need to know the chemical composition of the reaction mixture at any given moment and at any position inside the flow reactor. Only then, this information can be used in an efficient manner to generate feedback loops that control reactor performance. 4 Among current examples of in-line analysis, spectroscopic techniques without doubt, play a very significant role. The use of NIR, 5 IR, 6 Raman, 7 and NMR 8 spectroscopy for the in-line monitoring of intermediates, impurities, and products in continuous processes has been extensively studied.
Even though UV-vis spectroscopy provides less structural information about specific species in the reaction mixture, it is often the method of choice for concentration measurements owing to a lower level of interference from the matrix, i.e., solvents and non-absorbing components in a particular wavelength range. 9 The majority of published examples using UVvis spectroscopy in continuous systems are related to measurements in biochemistry 10 and analytical chemistry applying chemical sensors. 11 In terms of flow chemistry applications UV-vis spectroscopy has been applied for, e.g., monitoring photocatalytic reactions, 12 esterifications, 13 oxidations, 14 nucleophilic aromatic substitutions 15 and for the online analysis of nanoparticles generated under segmented flow conditions. 16 In addition, UV-vis spectroscopy is often the method of choice for the characterization of microreactors and micromixers in terms of their efficiency. This can be accomplished by monitoring the change in concentration of inert tracer molecules in time, using simple photometry. From these measurements, information regarding mixing performance, 17 axial dispersion, 18 flow regimes 19 and residence time distribution (RTD) 20,26 can be derived, providing a relatively straightforward access to a variety of dimensionless numbers in fluid mechanics (e.g., Reynolds and Bodenstein numbers). 21 A clear advantage of using visible light absorption lies in the ready availability of equipment and the moderate cost of the required optical parts, making the overall measurement system accessible to many scientists in the field. To the best of our knowledge, the only commercial UV-vis spectrophotometer specifically dedicated to flow chemistry applications was recently introduced by Uniqsis (Flow-UV™). 22 The system uses optical fibers for light transmission from the source through a flow cell and on to the detector.
Herein we describe the development and use of a compact and inexpensive photometer system that is based on open source hardware and software. The system was designed utilizing the Texas Instruments MSP430 LaunchPad platform 23 as the main unit in combination with self-designed extension boards. These extension boards feature the detector circuitry, amplifiers and filters, LED drivers and an accompanying power supply for the complete system ( Fig. 1). A light emitting diode (LED) was selected as the light source owing to its narrow emission spectra, long-term stability, and ease of implementation. Additionally, replacement of the LED affords flexibility, providing access to more than one wavelength range to be used for measurements. The source code for communication with the LaunchPad was written in the Energīa 24 open source software featuring an integrated development environment (IDE) based on processing. 25 The photometer was evaluated for the measurement of dye concentrations over time (microreactor characterization) and for determining the concentration of p-nitrophenol product in the biphasic hydrolysis of p-nitrophenol acetate (reaction kinetics).

Photometer design
In order to meet the desired characteristics for an optical measurement system within a flow chemistry regime, certain boundary conditions had to be met. First of all, the system should utilize optical fibers for light transmission. Secondly, the light intensity should be high since the concentration of reagents in flow is usually in the range of 1 mol L −1 . In addition, the system electronics should be able to handle the high light intensity, fast signal acquisition (in the order of ms) and be configurable according to a specific application. Apart from these boundary conditions, it appeared desirable to design a UV-vis flow measurement cell which is not fixed but could be moved along the flow path. In the particular case described herein, the flow cell was constructed from a cross mixer wrapped in aluminum foil and black tape to protect the cell from external light interfering with the experiments ( Fig. 2a and b). 26 Having the boundary conditions mentioned above in mind, the light source was designed in a way that depending on the application and the absorption wavelength of the species of interest a single 1 or 3 W LED can easily be connected to a standard constant current LED driver module (Mean Well LDD-700L), with a feature that enables LED light intensity control by one digital signal. Light from the LED (see Fig.  S6 † for emission spectra of used LEDs) is split into two perpendicular light beams with the aid of a beam splitter cube (50 : 50 split ratio, Thorlabs), one for the reference detector and the second one for the application. The second light beam is focused on the optical fiber using a polyĲmethyl methacrylate) (PMMA) lens. Light is then focused on the perfluoroalkoxy (PFA) tube and the transmitted light ultimately passes through another optical fiber to the detector ( Fig. 2c and d).
Light intensity was measured using an OPT101 chip with integrated photodiode detector and transimpedance amplifier ( Fig. 3a) configured for the gain of 0.1 with external resistors (0.1% tolerance, 25 ppm temperature coefficient). The

View Article Online
second stage in the signal path is filtered through a low pass filter (4th order Sallen Key Butterworth) with a 1 kHz cutoff frequency (using TLV2141 IC-s as an active element). This is followed by summing of the reference and measured signal using a PGA205 zero-drift programmable gain instrumentation amplifier providing a low impedance output signal to the analog-to-digital converter (ADC), thus minimizing noise pickup in the signal path. The amplifier has the additional feature of adjusting the output offset voltage, which in turn provides the user with the ability to adjust the output of the system to zero for the blank measurements. In order to provide the system with some flexibility, digital gain control of the PGA205 amplifier is enabled, the gain is selected in the source code by a user and controlled by two digital signals directly from the MSP-EXP430G2 LaunchPad. The MSP-EXP430G2 LaunchPad development kit (Fig. 3b), is an easy-to-use microcontroller development board for the low-power and low-cost MSP430G2x MCUs. It has onboard emulation for programming and debugging. Finally, the power supply for the system is designed to reduce the incoming 12 V/1 A power from the power adapter to the appropriate voltage for the other boards in the system and to drive the light source and fan for cooling of the LED. In Fig. 1 a schematic representation of the constructed photometer is given. The cost of the parts used for the construction of the photometer is ca. 360 USD (see Table S1 † for the bill of materials).

Application 1: reactor characterization
The determination of residence time distribution (RTD) in a flow device is a valuable tool for the characterization of microreactors, micromixers, and flow reactors in general. 21,26 We have therefore set out to evaluate the usefulness of our flow photometer system for establishing the RTD of several commercial microreactors/micromixers as well as of a standard 0.8 mm (i.d.) PFA tubular reactor. The experiments were performed by measuring the change of concentration of Rose Bengal dye (RB) over time at the exit of the microreactor or micromixer, providing a so-called C-curve. 27 A 1 W green LED was used as the light source having an emission maximum at 565 nm, close to the absorption maximum of RB dye at 559 nm ( Fig. S7 †). Two types of experiments were performed based on the internal volume of the microreactor or micromixer. For microreactors with an internal volume larger than 100 μL a pulse experiment was used, where a small volume of tracer dye (13 μL) is injected and the exiting concentration of the dye is measured. For micromixers with an internal volume smaller than 100 μL a step experiment was used, where the concentration of dye at the exit is measured after an instant change from the constant flow of water to the flow of dye. For both, step and pulse experiments, a 1 mmol L −1 solution of RB was employed using a six-way valve to manipulate solvent and dye flows ( Fig. S8 and S9 †).
Initially, we have performed step experiments on two commercial glass micromixers: 1) a 26 μL Syrris Asia micromixer chip, and 2) a 4.64 μL Dolomite micromixer chip (see Table 1   for details). The experimental data ( Fig. 4 and Fig. S15-S17 †) clearly demonstrate the effectiveness of mixing as a function of flow rate through the micromixer. As expected, 21,27 decreasing the flow rate from 1.00 mL min −1 to 0.25 mL min −1 causes a broader distribution of the tracer dye as a consequence of decreased mixing efficiency, along with an increased tailing of the dye as seen for the Dolomite micromixer chip using the step experiment (Fig. 4). Next, pulse experiments were performed on two commercially available glass microreactors and a tubular PFA reactor, namely on 1) a 250 μL Syrris microreactor, 2) a 1800 μL Uniqsis microreactor, and 3) a 0.8 mm i.d. PFA tube of variable length (Table 1). For these experiments a 13 μL dye pulse was injected into the reactor with the help of a six-way valve. The output was connected via a short (15 mm) PFA tube to the UV-vis flow cell (in the case of the tubular PFA reactor the UV-vis flow cell was 50 cm downstream from the six-way valve thus providing an internal volume of 250 μL). Experiments were conducted applying flow rates ranging from 0.25 mL min −1 to 1.00 mL min −1 . In case of the 1.8 mL Uniqsis glass microreactor, the flow rate of 0.25 mL min −1 was not used since the dye was too diluted and thus the signal-to-noise ratio of the output signal was not high enough to be interpreted with confidence. The symmetrical shape of the curves indicates a good radial mixing performance in the microreactor, whereas an unsymmetrical shape indicates poor radial mixing and a parabolic shape of the flow profile within the reactor. 26,27 Similar to the observations with micromixers (see above), an increase in tailing and width of the dye signal with decreasing flow rate was observed for the investigated microreactors. The only microreactor exhibiting a relatively symmetrical signal shape for all applied flow rates was the Uniqsis microreactor (Fig. 5), which can be attributed to the internal mixing structure within the reactor. The other microreactors exhibited classic parabolic flow profiles owing to the lack of mixing structures (i.e., for the PFA tube) or in cases where the mixing structure is located only at the mixing point of the input feeds and does not stretch through the channels of the microreactor (Syrris microreactor, see Fig. S10 to S14 † for details). As expected, the tubular PFA reactor exhibited the highest axial diffusion and broadest distribution of the tracer dye. The completely unsymmetrical shape of the curves additionally indicates poor radial mixing, high axial diffusion and a significant tailing (Fig. S18-S22 †).
We have recently published the design and fabrication of a 3D printed stainless steel flow reactor specifically made for a low-temperature two-step continuous deprotonation/ difluoromethylation process. 28 The reactor design and mixing geometry was optimized for this process with channels being slightly oval in the cross section, affording better surface quality after the 3D printing process. The 4 m in total of reaction channels (0.8 mm i.d., ca. 1.9 mL internal volume) are serpentined around a cooling element in zig-zag form providing advanced advective mixing by stretching and folding of the flow stream (Fig. S14 †). Computational fluid dynamics was used to predict the mixing performace of the reactor. 28 Measuring the RTD with a step experiment (RB dye) at 1 mL min −1 suggests moderate axial diffusion through the reactor (Fig. S23 †). 28 The disadvantage of the general method used herein for measuring RTD is the assumption that the input of the tracer dye is following an ideal Dirac function. When this is not the case the same flow cell should be positioned at the input as well as output of the micromixer/microreactor in order to correct for the input. 29

Application 2: reaction kinetics
We next evaluated the performance of the flow photometer in monitoring the concentration of p-nitrophenol anion (p-NF) in the hydrolysis of p-nitrophenol acetate (p-NFA) with sodium hydroxide. When executed under biphasic conditions this transformation is often used as a model reaction in order to study e.g. the mixing performance/mass transfer of liquid-liquid biphasic reaction systems. 31 In a tubular reactor one can typically observe a segmented flow pattern of the organic phase containing the p-NFA in CH 2 Cl 2 and the aqueous sodium hydroxide phase. 32 As the reaction progresses the concentration of the strongly yellow colored (400 nm absorption max) p-nitrophenol anion ( p-NF) in the aqueous phase serves as a measure for conversion. Monitoring the concentration of p-NF at different positions along the PFA tubular reactor therefore enables determination of reaction kinetics. For this experiment, a 1 W LED with a maximum of emission at 400 nm was used as the light source with experiments performed at room temperature (25°C). Prior to performing a hydrolysis experiment, a calibration diagram was obtained by measuring the absorption (as ADC value) of stock solu-tions of p-NF in 2 M sodium hydroxide solution (Fig. S25 †) from which a response factor was calculated. For the hydrolysis reaction, two pumps were used to deliver the organic and aqueous solutions to a standard PEEK T mixer (17.5 μL, 1.25 mm i.d.) connected to a straight PFA tube as a reactor (0.8 mm i.d., 1.6 mm o.d., 120 cm total length) producing a biphasic reaction mixture (Fig. 6). One feed was composed of 2.0 mol L −1 sodium hydroxide solution in water (100 μL min −1 ) and the second one of 1.0 mol L −1 of a CH 2 Cl 2 solution of p-NFA (50 μL min −1 ) producing a 4 : 1 ratio of OH ions to p-NFA. Measuring the absorbance at defined locations from the mixing point allowed us to measure the concentration of p-NF at different residence times (Fig. 6). The hydrolysis reaction was monitored at 14 different points, initially 4 cm downstream from the mixing point, then 10 cm from mixing and subsequently every 5 cm until no further increase in the concentration of p-NF was observed (70 cm as the last measurement point).
Since the reaction is biphasic, segmented flow is produced immediately after mixing which potentially can interfere with absorption measurements at slow sampling times because of light refraction at the layer boundary. Gratifyingly, this was not the case when using a 1 ms sample acquisition time at the used flow rates. At the desired measurement location, at least 200 data points were recorded and the upper signal value was averaged providing the concentration value for p-NF ( Fig. 7a and b).
This was followed by connecting concentrations at specific locations with residence times at the corresponding positions of the tubular reactor. The ADC values of absorbance were thus converted to p-NF concentrations using the data obtained from the calibration graph (Fig. S25 †) and plotted vs. residence time (Fig. S26 †). These concentrations were used to calculate the corresponding concentrations of p-NFA during the reaction applying [ p-NFA] t = [ p-NFA] 0 − [ p-NF] t . To show that the reaction is first order in [ p-NFA] the Ln of [ p-NFA] t was calculated and plotted vs. residence time (Fig.  S27 †). The slope of the plotted data was used to calculate the reaction rate constant to be 2.26 min −1 at 25°C, assuming that the reaction is first order in p-NFA. The reaction has  been studied under biphasic conditions in microreactors [31][32][33] and under homogenous batch conditions, 34 indicating a significant influence of the reaction conditions on the reaction rate constant. It is not surprising that the conversion of p-NFA is time dependent which is in turn inversely proportional to the flow rate. In addition, the reaction is dependent on segment size, since the smaller the segments the larger the interfacial surface area, resulting in better mass transfer. The measurement of mass transfer between phases is an important tool in the characterization of a microreaction system. Mass transfer coefficients can be determined by knowing the lengths of the individual segments in the flow system. 35 Since channel shape and structure influences mass transfer between immiscible phases in microreactors, 36 such measurements are of importance for the rational design of microreactors. The design of the photometer described herein allows measuring the length of the segments in a biphasic system, being liquid-liquid or gas-liquid systems. This is due to the rapid sampling time of 1 ms and the difference in the refraction indexes of the two phases. 37 The first derivative of the signal was calculated and summed with the average of the signal in order to determine the boundary between segments (Fig. S28 and S29 †). Using eqn (1) where h is the length of the segment, F is the flow rate in mL min −1 , t is time between data points in s and r 2 is the square of the PFA tube radii, the length of the aqueous segments was calculated to be 3.5 mm. The calculation here is based on the assumption that segments have the same velocity as the total flow rate, since the small capillary numbers involved (<0.001) at which the liquid film surrounding the segment/segment body (if present) is negligibly thin. 38 (1) With the current photometer the flow cell can be readily moved along the PFA tube (see above) thus allowing the measurement of segment sizes at different residence times without disturbing the flow pattern during measurement. In principle, segment sizes and thus mass transfer coefficients can be derived for biphasic system where the sampling time is shorter than the time an individual segment spends in the optical path and the segment length is longer than the diameter of the optical fiber. Compared to the classical snapshot technique, 39 this truly in-line measurement allows for real time monitoring of segment lengths and reactor performance with respect to mass transfer.

Conclusion
With an ever-increasing awareness of flow chemistry and process analytical technology tools, there is growing interest in the development of novel analytical tools to enable rapid and cost efficient in-line analysis of reactions under flow conditions. Herein we have presented the design of a flexible photometer system from readily available electronic compo-nents enabled by the MSP-EXP430G2 LaunchPad prototyping board and Energīa, an open source electronic platform accompanied by a large support community. This brings electronics and programming closer to the chemist and chemical engineer, allowing a faster development of novel process analytics, as seen from recently published studies. 40 Our novel photometer system was used for concentration measurements at the outlet of glass micromixers and microreactors in order to perform residence time distribution measurements and for establishing the kinetics of chemical transformations in flow by performing concentration measurements at different residence times of the reactor. The latter approach is possible since in order to perform concentration measurements at different locations of the reactor the flow cell is simply moved up or down the PFA tubing. In summary, the novel system introduced herein appears to be an attractive tool for rapid and cost-efficient in-line concentration measurements, additionally enabling the determination of segment lengths in segmented flow regimes.

General information
Solvents and chemicals were obtained from standard commercial vendors and were used without any further purification unless otherwise noted. HPLC analysis (Shimadzu LC 20 AD) was carried out on a C18 reversed-phase analytical column (150 mm × 4.6 mm, particle size 5 μm) at 37°C using mobile phases A (water/acetonitrile, 90 : 10 (v/v) + 0.1% TFA) and B (acetonitrile + 0.1% TFA) at a flow rate of 1.5 mL min −1 . The following gradient was applied: linear increase from solution 30% B to 100% B in 5 min. GC-MS spectra were recorded using a Focus GC coupled with a DSQ II (EI, 70 eV). An HP5-MS column (30 m × 0.250 mm × 0.25 μm) was used with helium as carrier gas (1 mL min −1 constant flow). The injector temperature was set at 280°C. After 1 min at 50°C the temperature was increased in 25°C min −1 steps up to 300°C and kept at 300°C for 4 min.

Photometer design
All the circuit board layouts were designed using the EAGLE 7.3.0 Light version, an open-access graphical software. CAD drawings of the Beam splitter cube and lens holder were done using the AutoCAD 2018 software. The Texas Instruments MSP430 LaunchPad platform and integrated circuits (IC) were purchased from Texas Instruments. LEDs, constant current LED driver modules, passive components and the required equipment for construction were purchased from a local electronics supplier. Data files for the printed circuit board assembly and CAD files for manufacturing the optics holder can be obtained on request from the authors.
Step experiments RTD experiments were performed using either step or pulse experiments. For the step experiments, a setup shown in  Fig. S9 † was used. The evaluated micromixers (Table 1) were connected via a PFA (1.6 mm o.d., 0.8 mm i.d.) tube (5 cm length) to the six-way valve. One feed was a 1 mM solution of RB dye in water, the second feed was pure water. Both feeds were pumped with the same flow rate (0.25, 0.50, 0.75 or 1.00 mL min −1 ) using continuous syringe pumps (Syrris Asia). Initially, the micromixer was purged with pure water and a baseline was recorded with the photometer. The measurement was started immediately upon changing from the water flow to the dye flow accomplished by switching the six-way-valve. The PFA tube was connected to the output of the micromixer and the flow cell was positioned as close as possible to the output. The timing of the measurements was set to every 1 ms for all experiments. After the values from one flow rate were recorded, flow rate values were changed on both pumps and the procedure was repeated.

Pulse experiment
Pulse experiments were performed using the setup shown in Fig. S8. † The 13 μL loop was loaded with 1 mM solution of RB dye using the syringe. The microreactor was connected to the six-way valve using a 5 cm long PFA (1.6 mm o.d, 0.8 mm i.d.) tube. The flow rate on the syringe pump (Syrris Asia) was set (0.25, 0.50, 0.75 or 1.00 mL min −1 ), and the reactor was purged with pure water. The recording was started immediately upon switching the six-way-valve whereupon a 13 μL pulse of the dye was injected into the microreactor. The PFA tube was connected to the output of the microreactor, and the flow cell was positioned as close as possible to the output. After the values for one flow rate were recorded the flow rate values were changed on both pumps and the procedure was repeated. The timing of the measurements was depending on the evaluated microreactor and the used flow rate. For flow rates of 0.25 and 0.50 mL min −1 the recording time was set to every 10 ms and for flow rates of 0.75 and 1.00 mL min −1 timing was set to 1 ms. The exception was the Uniqsis microreactor (internal volume of 1.8 mL) where timing was set to 50 ms for the 0.50 and 0.75 mL min −1 runs and to 25 ms for the 1.00 mL min −1 experiment.

Hydrolysis of p-nitrophenyl acetate
The flow setup consisted of two syringe pumps (Syrris Asia) to introduce a 2 M solution of sodium hydroxide and a 1 M solution of p-NFA in CH 2 Cl 2 with flow rates of 100 μL min −1 and 50 μL min −1 , respectively. Solutions were mixed in a standard T mixer (IDEX, 17.5 μL, 1.25 mm i.d.) to which a PFA tube (1.6 mm o.d, 0.8 mm i.d., 120 cm total length) was connected. The flow cell was positioned as close to the mixing point as possible (4 cm), see Fig. S24. † Initially, pure water and CH 2 Cl 2 were mixed and a baseline recorded. Subsequently, the two reaction solutions were pumped and the recording was initiated. For each spatial point, 200 data points were recorded at 1 ms time intervals between data points. After recording at the length of 4 cm from the mixing point, the flow cell was moved along the PFA tube in incre-ments of 5 cm and 200 data points where measured at each location. At the length of 70 cm from the mixing point, the measurements were finished. The output feed was analyzed to determine if any residual p-NFA was present. HPLC and GC-MS analysis confirmed complete conversion to p-nitrophenol and absence of any p-NFA in the CH 2 Cl 2 layer.

Conflicts of interest
There are no conflicts to declare.