Introduction

Encouraged by academic breakthroughs and pressure from regulatory agencies over the last decade, chemical industries (fine, pharmaceutical and agrochemical) are witnessing a paradigm shift in their toolkit for complex molecule synthesis. Photochemistry is now a prominent field in contemporary organic synthesis that becomes attractive particularly to discovery chemists. This is owed to (i) its fundamental provision of different reactive intermediates and therefore reactivity compared to thermal chemistry – allowing to access novel structures with higher three-dimensionality for enhancing physical properties and patentability of molecules – and (ii) its ability to drive redox reactions with visible photons as sustainable, traceless energy input under exceptionally mild reaction conditions that therefore achieve highly selective processes. Elsewhere, compared to traditional batch reactors, continuous flow reactors appeal to process and manufacturing chemists due to (among many other advantages) (i) their cost savings from their smaller size footprints and waste footprints in case of irregularities/shut-down, (ii) their exquisite control over energy transfer to/from the reaction and thus superior safety profile, (iii) their amenability to ‘on-the-fly’ monitoring, control and automation. The latter is rarely introduced in the standard practical curriculum of taught organic chemists, despite its increasing importance and capabilities.

Our group's efforts so far to familiarize Master students with flow chemistry at the University of Regensburg, a public-funded research university, have relied upon commercial, user-friendly flow reactors [1,2,3]. However, we appreciate how undergraduate teaching lab budgets at public-funded research Universities typically prohibit the purchase of such equipment, or where available limit the ability to allocate multiple reactor stations needed for undergraduate laboratories. Moreover, such commercial flow reactors come pre-assembled with a ‘push and go’ user interface software that is not conducive to learning hardware-software interactions. Students that have experience in setup-building and hardware aspects of the system will benefit in the future when facing the need to customize available resources and troubleshoot unavoidable problems in real-life applications. The Universities of Strasbourg and Regensburg, represented by the respective authors herein, started a teaching exchange cooperation to address these issues. Our first goal was to develop a teaching laboratory exercise that captures key skills in photochemistry and continuous processing. As well as teaching the theoretical, safety and wet chemistry aspects of preparing the target chemical reaction, it was judged to be just as important for the students to ‘get their hands dirty’ in actually constructing the flow reactor from scratch. This included electronically connecting an unconfigured pump module via a microcontroller to a PC and programming the operation of the pump module. From a didactic point of view, we felt that the students touching and connecting all the physical components of the reactor with their own hands would be the fastest way to break down inhibition barriers and give students the confidence to approach future problems ‘hands on’.

Our second goal was to develop this course in a way that could fit within the constraints of budget (each reactor station between 250-500 €, depending on light source), staff (min. 2 on-the-floor supervisors) and timeslots (2-3 h afternoon slot) of a typical organic synthetic teaching laboratory. Therefore, the target reaction had to be rapid enough to realize in a <1 h and robust enough that it would work for the majority of a class of 25 students without substantial laboratory experience following a recipe. Considering that some undergraduate teaching laboratories do not have routine access to NMR facilities, we sought to make the exercise accessible even to less-funded public institutions by selecting a target chemical reaction that could be easily followed by thin-layer chromatography.

Despite being somewhat underrepresented in the teaching practice for synthetic organic chemistry, there are several excellent and informative published works in the field of flow photochemistry [4] and continuous flow in general [5,6,7,8]. In most available relevant undergraduate protocols, the primary spotlight is put on the introduction of flow-chemistry topology and the microreactor design and operation. The high price of commercial flow systems and their pump modules results motivated previous didactic exercises to opt for syringe pumps as a less expensive solution for undergraduate experiments (with the exception of the pneumatically-driven 3D-printed system used by Hilton and co-workers [8]). This limits the exposure of students to a different approach and might result in a presumption that a highly specialized and expensive setup is required for experiments and that benefits of continuous flow might not justify the required preparations and expenses. Moreover, syringe pumps while useful for didactic purposes generally require re-filling after their discharge which risks further exposure of students to chemical hazards and exposing potentially air- or moisture-sensitive reaction mixtures to atmosphere. They are predisposed to blocking by (and sedimentation of) particulates. Peristaltic pumps represent a cheap alternative that avoid some of the aforementioned issues, and that can be operated in forward and reverse modes. In the case of an incomplete chemical reaction, this would allow to continue the reaction without exposure of the closed system.

Herein, we describe an approach to show undergraduate students that the setup of continuous flow photoreactions can be realized using very inexpensive and basic elements. Emphasis on control and interaction with the system is achieved by interfacing the pump with a microcontroller. In contrast to the "plug and play" approach, the students are employed as the constructors of both the pumping hardware and software. This DIY approach nurtures a problem-solving attitude and creativity outside of a typical synthetic chemist’s field of view.

By focusing on this DIY approach to the question of how to realize continuous flow, we endeavor to fill a gap in the standard curriculum by allowing less generously funded and equipped institutions to teach continuous flow chemistry. Students that have experience in setup-building and hardware aspects of the system benefit in the future when facing the need to customize available resources and troubleshoot unavoidable problems in real-life applications. The class of participating students were undertaking a Masters course in a taught-led program in Green Chemistry, in their second year. A few days prior to the practical session, they received a one-off introductory lecture on flow chemistry as part of a more comprehensive lecture curriculum on green chemistry.

Results and discussion

Target reaction selection

The photooxidation of N-phenyl-1,2,3,4-tetrahydroisoquinoline (N-Ph-THIQ, 1) to its iminium salt (2) (Scheme 1) is a robust candidate reaction [9,10,11]. This rapid reaction can be realized in <2 h even with a low power hardware store LED strip [10], its product 2 is stable enough to atmosphere (O2/water) to persist for days upon isolation and it has substantially different to 1 in polarity by TLC (2 exists as a strongly colored spot on the baseline, see Fig. 3). The [Ru]-based photocatalyst is commercial and affordable at the low loadings employed (2 mol%). While the designed experiment involves the use of the catalyst for robustness and simplicity when explaining the theoretical reaction mechanism, it is noted that this reaction even proceeds without photocatalyst with high intensity LED irradiation under certain conditions by more complex mechanisms [12, 13]; as a potential failsafe in case students accidentally missed addition of the photocatalyst or did not degas the reaction thoroughly enough.

Scheme 1
scheme 1

Visible light photoredox catalyzed oxidation of N-phenyl THIQ 1 to its iminium salt 2

Iminium intermediate 2 is synthetically useful since it is known to react with a variety of nucleophiles in the literature, such as nitromethane in a nitro-Mannich reaction reaction [9, 14], or organometallics [10] in the dark (Scheme 2). Since the BrCCl3 itself, its by-product (CHCl3) and the reaction solvent are all volatile enough to remove by a standard rotary evaporator, the reaction mixture can be directly evaporated, the crude iminium salt re-dissolved/suspended in toluene and the desired nucleophile added. Though such downstream chemistry was not pursued in the study herein, the advantage of this one-pot process is the avoidance of extractions/work-ups, which may benefit the context of a teaching laboratory. Although important routine manipulations for any wet chemistry lab exercise, extractions/work-ups can present considerable time burdens and opportunities for error that could result – in the worst case – in losing the reaction mixture.

Scheme 2
scheme 2

Example of the synthetic utility of the downstream chemistry of N-phenyl THIQ iminium salt 2, by its nitro-Mannich reaction in the dark to give product 3

Despite its simple structure and synthesis (a coupling reaction of 1,2,3,4-tetrahydroisoquinoline with an aryl halide), starting material N-phenyl-1,2,3,4-tetrahydroisoquinoline 1 carries a cost at common suppliers that could be prohibitive for the purposes of teaching labs. Therefore, a high-yielding, metal-free and inexpensive multi-gram synthesis of 1 was developed, with minimal need for work-up / purification manipulations, which can be realized in just 2 h by students in a preceding lab exercise or by a laboratory assistant in advance of the session (see the discussion and procedures in the SI file).

Materials and reactor design

In order to create a reactor accessible to any teaching laboratory, as far as possible standard laboratory equipment was employed; a Dewar as a reflective housing for the reactor, a glass beaker around which to coil the flow reactor tubing, and two round-bottomed flasks to house the reaction mixture before and after the flow path (Fig. 1). For the blue light source, Kessil LED lamps were chosen as commonly used by academic researchers in the field (here we utilized Kessil A160WE), but the reaction works equally well when using inexpensive 50 W 450 nm LED COB modules. Reactor tubing was standard 1/16”(0.5 mm ID, 1.0 mL volume, ~5 m) chemically resistant and transparent FEP tubing available in bulk at numerous suppliers and 0.5 m of 4 mm OD soft silicone tubing (3 mm ID) for the pump. Depending on the LED chosen, the cost ‘per station’ was estimated at 250-500 € (Table 1). The practical session was organized to include 5 stations for a class of 25 students (5× groups of 5, groups of 2-3 students would be optimal if enough of fume-hood space is available), therefore the overall hardware cost for the course ranged from 1250-2500 €.

Fig. 1
figure 1

Schematic representation of the setup and photoreactor coil placed in a Dewar flask

Table 1 Cost estimate for reactor components

To create the hardware-software interfacing aspect for students, an inexpensive commercial peristaltic pump was purchased from Atlas Scientific (EZO-PMP), communicating via UART interface. ARDUINO UNO was chosen as an affordable microcontroller to control the peristaltic pump, which could be connected to the students’ laptops by a USB interface. To interface and control the pump, a simple 3 button circuit is presented (Fig 1). Very tight time constraints for the laboratory session (2.5 h) led us to abandon more sophisticated designs with a display or different flow rate controls, however such items could be easily integrated based on the existing design and code (see SI) and the pump displays status information to the ARDUINO application monitor if a computer is plugged into it. A schematic of the reactor is shown in Fig. 2, and the assembled reactor in Fig. 3.

Fig. 2
figure 2

Pictures of: A. Assembled flow path. B. electronic circuit and microcontroller. C. Connecting the pump with the tubing. D. Assembled flow reactor during operation in Regensburg. E. Reactor operation during exercise with students in Strasbourg

Fig. 3
figure 3

Representative TLC plates of N-Ph THIQ 1 ‘S’ and the processed reaction mixture, showing iminium salt 2 ‘P’

Program logic was designed to be as simple as possible, such that it could be understandable by students without any programming background (description in the SI and pure code in the "flow left-rigt" file). Three implemented button functions are Pump Forward, Stop and Reverse. Parameters of the reaction are selected to achieve full conversion in a single pass in most of the attempts. The reverse function allowed to re-expose the mixture to the reactor in case TLC analysis upon the ‘first pass’ revealed incomplete conversion, without compromising the inert atmosphere or exposing students further to chemical entities. The pumping rate was limited by the flow resistance of narrow FEP tubing reducing the flow rate from nominal ~50 mL/min to approximately 5 mL/min (with the pump installed after the reactor coil) which was enough to achieve full conversion with 2% of the [Ru] photocatalyst under full power irradiation from the Kessil lamp.

Before the lab course with students, the reaction setup was evaluated to determine the parameters for the reaction. Initially, a 4.5 mL coil, 3 equivalents of oxidant BrCCl3 and 1% [Ru] catalyst were employed. With the peristaltic pump placed before the reactor coil the measured flow rate was 10 mL/min resulting in around 30 seconds residence time. However, this resulted in incomplete conversion as judged by TLC of the collected reaction mixture. Conversion improved only marginally upon doubling the oxidant, however raising [Ru] catalyst loading to 2% and placing the pump after the reaction coil (measured flow rate dropped to less than 2 mL/min, due to cavitation) full conversion (by TLC) was achieved. After removing the volatiles, the NMR analysis revealed the target iminium in the form of its monohydrate.

As an alternative solution a code with implemented variable flow rate is provided in the Supporting Materials (filename “flowrate_control”). This code allows to vary the speed of the pump in discrete increments of 1 mL/min (for a pump without load). Real flow rate depends on the attached flow path together with fluid properties and must be individually determined after assembly. Experiments with the pump speed set to '1' (measured flow rate from 0.5 to 0.6 mL/min) resulted in 2 minutes of residence time, sufficient for full conversion (TLC) with both Kessil and 50W COB LED light sources.

Results

Starting material 1 is commercial, however more costly (~150×) than 1,2,3,4-tetrahydroisoquinoline per gram. Thus, preparation of 1 was carried out in a prior laboratory exercise using a provided procedure (see SI). The difficulty of the procedure was evaluated by a volunteering Bachelor-level student at the University of Regensburg. Following instructions, this resulted in a 60% isolated yield upon the first try, which was acceptable. The protocol was then handed to Bachelor-level laboratory students at the University of Strasbourg and used to synthesize the material required for the photochemical step. Over 2× 2 h sessions (Reaction itself, and then subsequent purification and product characterization) students achieved isolated yields of 40-87% without any major complications or safety incidents. In addition, an additional batch of 1 was synthesized by a laboratory assistant in case more material would be required.

The flow exercise was conducted with students of a Master program in Green Chemistry at the University of Strasbourg, after a lecture in flow chemistry. The key target outcomes of the exercise: to demonstrate how to build a flow (photo)chemistry synthesis setup, control and monitoring of a flow reactor and an introduction to microcontrollers and programming in laboratory context. In the introductory workshop students were familiarized with the ARDUINO programming language (a version of C language) and ARDUINO IDE, together with the explanation of the logic of the provided example code, as well as the compilation and software transfer procedures.

During the 2.5 h afternoon laboratory session students (25 divided into 5× groups of 5) followed an instruction manual with pictures to build the electronic controls (see SI file), uploaded the program to the microcontroller and assembled the reactor from provided elements. All groups managed to successfully assemble the reactor and the questions and problems were addressed by 2 tutors monitoring and advising students.

Following reactor construction, the students measured all listed chemicals to prepare the reaction mixture within the fume hoods. The reaction mixture was then sealed with a septum already pierced with the FEP inlet tubing and the students were instructed to degas by bubbling argon, before sealing to ambient light with foil. The receiving flask was also kept under an Argon blanket using a balloon, replaced after TLC sampling. Flow reactor setups were operating outside of fume hoods since the closed nature of the flow system (except TLC sampling) limited any potential exposure to chemicals.

Three out of 5× groups successfully processed the reaction mixture through the flow reactor and achieved full conversion to the iminium salt, as judged by Thin Layer Chromatography (disappearance of the N-Ph THIQ 1 and appearance of the polar iminium salt 2 as a dark spot on the baseline). Quantification was not possible within the time pressure of the 2.5 h session and fulfilling the top-priority deliverables (didactics) was prioritized. 1H NMR was used to confirm the formation of 2 for two of the groups. Unfortunately, two out of the 5× groups did not detect any conversion by TLC, although they succeeded in physically processing the reaction mixture using the flow reactor. In these cases, the students did not degas the reaction mixture thoroughly with Ar gas (the bubbling needle was inserted after excluding light from the flask, so the students could not see if the needle was really below the level of the solvent). This was quickly diagnosed when the students in question processed the reaction mixture through the flow reactor, by rapid formation of a dark green colored species (i.e. [RuIII], from oxidation of *[RuII] by O2). This showed the utility of the chosen model reaction for diagnosing issues during the teaching laboratory. It was not expected that some students would be too anxious to remove the aluminium foil cover in order to monitor their operations, and so in future iterations it is recommended to include a more explicit instruction that the inserted needle must be placed below the solvent level before shielding the flask to light.

Some students encountered problems with the electronics, such as plugging in the module to the current. Thankfully, the pump was able to diagnose itself, so that electronic issues using the ARDUINO monitor could be quickly tracked down. Bugs can potentially appear when flashing the Arduino controller. While this did not occur in the session herein, this is easily solved by flashing the memory and reinstalling the standard version of the software. Therefore, it is recommend (as was the case in this session) that at least one tutor be present who is trained in understanding the output messages of the ARDUINO monitor and holds a copy of the software in case reinstallation is needed for debugging. Another issue is the physical preparation of the electronic module (button malfunction, error flashing microcontroller, power supply issues). While this did not happen in the session described, a spare electronic kit was on hand for such eventualities and would be recommend for future iterations.

Within the 2 hours of the laboratory session, the nitro-Mannich step of the reaction could not be achieved however this would be possible for a longer duration exercise. Nonetheless, the purpose of the course was not to achieve the reaction but to achieve the construction of the flow reactor and to successfully physically process the reaction mixture through it, using a computer-controlled pump module built, coded and programmed by the students themselves. These goals were successfully achieved by all groups without any complications or safety incidents.

A helpful reviewer suggested that a group size of 2 (rather than 5) would increase learning and engagement. While the cost and time constraints would not have allowed for this in this instance, we fully agree with the suggestion and recommend pursuit of more, smaller group sizes in the future.

Conclusion

In conclusion, we have developed a wet chemistry laboratory experiment that introduces a class of undergraduate students (5× groups of 2-5) to the concepts of flow chemistry and programming hardware as well as realizing a visible light photoredox catalyzed oxidation reaction of a pharmaceutically valuable target reaction (α-C−H functionalization of a tetrahydroisoquinoline). The reactor can be assembled in minutes and is cost-effective, at ~250-500 € per reactor station depending on the LED employed. The exercise follows a basic introduction to C language together with explanation of the logic of the provided code. The laboratory session requires the presence of a tutor familiar with ARDUINO and C language for potential troubleshooting during the exercise.

All test groups (5/5) successfully constructed the photochemical flow reactor, successfully programmed the ARDUINO microcontroller to control the peristaltic pump unit and were able to process the reaction mixture through the reactor flow path without any safety incidents. Most (3/5) groups achieved full conversion to the target iminium salt intermediate as judged by TLC analysis. An efficient and transition metal-free thermal batch synthesis procedure of the requisite starting material was also achieved, which can itself be realized in the context of an afternoon laboratory exercise and is >5× cheaper than the typical conditions of the alternative Pd-catalyzed coupling reaction. The time given for the session (2.5 h) required compromises and well-organized execution of the exercise, an additional hour (3.5 h total laboratory time) would allow for more relaxed operation and subsequent product workup and derivatization.

Overall, this didactic exchange project provides undergraduate students with experience handling flow photochemical reactions. It also provides ‘hands-on’ hard skills in building reactors and configuring microcontroller, as well as soft skills in programming ARDUINO. We feel these efforts could contribute productively to undergraduate education in Chemistry, preparing the next generation of chemists with the skills needed for academia or the chemical industry. Future goals would be (i) to design a reactor that can telescope together both batch thermal (synthesis of starting material) and flow photochemical steps in a single afternoon laboratory class, (ii) to develop electronic display and flow rate control features of the programmable peristaltic pump and (iii) to incorporate the nitro-Mannich reaction step for trapping the photocatalytically-generated iminium salt.