Democratising “Microscopi”: a 3D printed automated XYZT fluorescence imaging system for teaching, outreach and fieldwork

Commercial fluorescence microscope stands and fully automated XYZt fluorescence imaging systems are generally beyond the limited budgets available for teaching and outreach. We have addressed this problem by developing “Microscopi”, an accessible, affordable, DIY automated imaging system that is built from 3D printed and commodity off-the-shelf hardware, including electro-mechanical, computer and optical components. Our design features automated sample navigation and image capture with a simple web-based graphical user interface, accessible with a tablet or other mobile device. The light path can easily be switched between different imaging modalities. The open source Python-based control software allows the hardware to be driven as an integrated imaging system. Furthermore, the microscope is fully customisable, which also enhances its value as a learning tool. Here, we describe the basic design and demonstrate imaging performance for a range of easily sourced specimens.


Introduction
Microscopes are essential tools in many fields of science. However, in recent times the basic microscope stand has evolved into an automated imaging system, with a corresponding escalation in complexity and cost. In order to inspire and educate the next generation of budding scientists and to make modern microscopy widely available, wherever it is needed, it is essential to facilitate access to these advances. Particularly important is to address the need for software controlled integrated hardware and high-quality fluorescence digital image capture, not typically found in portable or classroom microscopes. Recently there has been a great drive towards democratised technology, whereby advanced technology becomes increasingly available for low-budget projects. This movement has provided an impetus for the design of low-cost microscopes and the release of designs in open-source formats. The rise of 3D printing epitomises this trend and opens possibilities for the democratisation of the production process. Moreover, the falling cost of digital cameras as used in smartphones and the recent availability of compact, cheap computing power, exemplified by the Raspberry Pi (https://www.raspberrypi.org/about/) and Arduino (https://www.arduino.cc) eco-systems, has changed the landscape for delivering low-cost microscopes.
To date, a number of low-cost functional microscopes have been introduced that fulfil different purposes. The implementations of such systems vary significantly in size, cost, robustness, optical quality, imaging modalities, and degree of automation. Many of these low-cost microscopes are designed to connect to smartphones, which are now almost ubiquitous. Such microscopes are frequently intended for use in global health and therefore tailored towards their applicability for field diagnostics. Early implementations employed standard objectives at the expense of an increase in bulk (Breslauer et al., 2009). Ultra-low cost and portable designs are typically based on a simple Leeuwenhoek design and incorporate ball lenses as the principal optical element (Bogoch et al., 2013;Orth et al., 2018). Other designs incorporating two lenses have been introduced to better match a conventional microscope (Hergemoller & Laumann, 2017). Furthermore, alternative imaging modalities have been demonstrated in these smartphonebased systems, including fluorescence (Cybulski et al., 2014;Switz et al., 2014;Wei et al., 2013;Zhua et al., 2013) and polarised light microscopy (Pirnstill & Coté, 2015). Alternative approaches include that of the Foldscope (Cybulski et al., 2014), which is formed from folded paper, costs a few dollars, and again incorporates a ball lens. These solutions offer excellent portability and ultra-low cost but suffer due to aberrations inherent at the edge of the field of view due to the ball lenses employed. Although elegantly simple, the above solutions offer limited functionality and are far removed from the modern automated imaging system found in a typical research lab.
A second class of low-cost microscopes aims to replace commercial systems. These low-cost systems often make use of 3D printing in the design and can include varying degrees of functionality and mechanical or electronic control. An excellent robust 3D printed design, which could replace more expensive basic teaching microscopes, is that of Tristan-Landin et al. (2019), offering both bright field and fluorescence imaging on a CCD camera. However, this system lacks automation and image quality is limited by the choice of objective lens. A major challenge in recreating an automated imaging system at a low cost is in the implementation of an XYZ translation of the sample relative to the optical path which is both robust and able to cope with a variety of specimens. An example of a robust, low-cost automated microscope incorporating XYZ translation is the "Open Flexure Microscope" developed by Collins et al. (2020). The highly compact configuration of this system, whilst excellent for portability, rapid manufacture, and use in the field, restricts convenient exploration and manipulation of the component parts. Diederich et al. (2020) have developed an adaptable imaging system (UC2) based on 3D printed cubes with embedded magnets. This provides a cheap, robust framework to fulfil simple fluorescence imaging requirements in the research lab, for example in tissue culture rooms, and great potential for flexibility and development. With its appealing "click together" assembly, the UC2 imaging system has the potential to provide a real alternative to expensive research microscopes in a range of situations.
Here we present, an alternative, integrated package, of hardware and software dedicated to teaching and outreach, tested with wide range of specimens. Microscopi is an affordable, portable, automated DIY imaging system developed specifically for use in interdisciplinary teaching and outreach purposes at universities and schools. The instrument is tailored to this role with easily assembled hardware, a clear layout, and a straightforward graphical user interface underpinned by well documented customisable Python-based code. Here, we document the build process and demonstrate the utility of Microscopi on a range of samples and imaging modalities. Our overarching goal is to cultivate a community of users by freely distributing detailed assembly instructions, control software and practical guides. Microscopi has further potential applications where lab facilities are unavailable due to location or limited resources.

Amendments from Version 1
In line with referees' comments we have revised our manuscript including updating figures and figure legends to include full details of the objectives used to collect image data. This includes an additional table listing all objectives used. We have also revised wording of the text in the "Introduction", "Design philosophy and specifications", "Sample Preparation" and "Summary" sections including clarifications and more details where requested. Specifically, we have amended comments relating to the UC2 microscope (Diederich et at., (2020)) added more details on the samples we have used, including fluorescent test samples and how they were prepared as well as clearer detailing of future developments. Finally we have added additional supporting material documenting outreach examples and updated our links to supporting materials accordingly. Minor errors have been corrected in Figure 3 and Figure S4 and in links to some of the supporting material and how they are referred to in the text.

Design philosophy and specifications
Designing and building a simple 3D printed motorised XYZ digital imaging system Our main goal in developing Microscopi was to design a widely accessible, customisable, automated imaging system ( Figure 1; Extended data: Supplemental Figure S1 [Wincott & Parton, 2021a]) to inspire the next generation of scientists. The use of DIN, non-infinity corrected objective lenses, low-cost electronics and predominantly 3D printed parts reduce the construction cost to less than £300 per basic unit, or £400 with fluorescence capability. This cost represents good value for money, given that Microscopi incorporates automated sample navigation, digital image acquisition and processing, all controlled through a simple customisable software-interface. Sample navigation comprises a motorised Z-objective lifter (focus) and a motorised XY flexure stage delivering automated image tiling. Furthermore, we have incorporated optics supporting contrast enhancing bright field modes and fluorescence imaging of various samples. Our open design facilitates building and supports customisation of both hardware and software. The small footprint and robust design, incorporating an optional battery powerpack, allows the unit to be fully portable for use in outreach events and fieldwork. Different objective lenses may be used to adjust magnification and resolution and multiple imaging modalities allow Microscopi to cope with a variety of specimens.

Design specifications
• Dimensions (235 mm x 235 mm base; 250 mm height) • Weight 1.5 kg • 3D printed components made from PLA (Polylactic Acid) • XY flexure stage travel 3 mm in X and Y • Z-objective lifter range 4 mm • Onboard processor running Python 3 (Raspberry Pi 4 Model B) • CMOS camera, Sony IMX219 8-megapixel sensor (Pi-camera V2) • Power: 5 V, < 4.0 A • Portable battery run time approximately 10 h • Optical path 160-DIN lens compatible, 45 mm parfocal distance Assembly and operating instructions for Micoscopi, including a full listing of the commercially obtained and 3D printed parts and details of the the operating software may be found online at http://doi.org/10.5281/zenodo.3701602 (Parton & Wincott, 2020). The software code can be found at: http://doi. org/10.5281/zenodo.4549567 (Wincott & Parton, 2021b). A brief summary of materials is provided in Table 1. Components of Microscopi to be 3D printed were designed in a freely available CAD software package (https://www.openscad.org). Designs were exported as STL format files ("stereolithography" or "Standard Triangle Language"). Components were printed  Multiple optical paths for contrast enhancement of diverse samples A key requirement in microscopy is to generate contrast from transparent material by translating features of the sample into intensity or colour differences that can be more easily visualised. To achieve this, Microscopi incorporates multiple possible optical paths for contrast generation with a variety of different samples.
Microscopi is an inverted microscope, i.e. the objective lens is situated below the sample. An inverted configuration facilitates the loading of sample material, particularly with life-science applications such as organisms in pond water. The objective lenses used are finite conjugate DIN lenses (Simon & Comastri, 2005), which focus directly onto an image sensor, providing a conceptually simple low-cost design. To assist in first setting up a sample for imaging, basic bright field illumination is provided by the auxiliary flexi-lamp which may be tilted to give oblique illumination contrast to specimens (Figure 2A-A′′). The auxiliary flexi-lamp is also useful when assembling and aligning the instrument. For imaging proper, multiple transmission illumination modes are achieved using an 8×8 white LED array placed in the pupil plane (Liu et al., 2014). Using this condenser-free approach, it is possible to achieve modes analogous to traditional, condenser-based illumination (Webb, 2015;Zheng et al., 2011). Illuminating all the LEDs provides basic bright field illumination ( Figure 2B). Oblique illumination can be achieved by selectively illuminating strips of pixels from the different sides of the array ( Figure 2B′). More advanced techniques are also possible, such as pseudo-phase contrast which is achieved by taking two oblique images and calculating the normalised difference between them ( Figure 2B′′). Such post-acquisition contrast enhancement can be achieved automatically by the on-board processing of the microscope software. Another advanced technique, dark field illumination, is achieved by illuminating LEDs which fall outside of the numerical aperture (NA) of the chosen objective ( Figure 2B′′′).
Microscopi, therefore, although superficially very different to a conventional teaching microscope, is still highly suitable for teaching the basics of optics, such as resolution, contrast and the concept of conjugate planes. The optical path can be customised to allow additional imaging modes such as polarised light imaging, by introducing polarising filters before and after the specimen, and reflected light imaging, using a ring of RGB LEDs beneath the objective (comparison in Figure 2C-C′′′ and C′′′′). The LED ring additionally allows the possibility of multiple Rheinberg illumination patterns (Rheinberg, 1896), which may be implemented by illuminating sectors of the LED ring with different colours.
Bright field imaging modes can reveal a wealth of information about a sample, although identification of specific features may be limited. The use of selective stains and colour imaging can provide far more specific information. Figure 3A shows an image of a typical histology slide of fixed tissue, in this case mouse aorta stained with Oil-Red-O which labels lipids, while Figure 3B and B′ shows a stained section of plant root. More recently, specific labelling of specimens has been revolutionised by fluorescence imaging of fluorescent-dye tagged probes. In fluorescence, molecules emit light at a specific visible wavelength (colour) upon illumination with light of a shorter wavelength. Using these fluorescent probes, specific features of the sample are highlighted by the bright fluorescence emission against a dark background. Figure 3B and B′ are images of dried-down spots of bright fluorescent green and red dyes respectively, both imaged with the same blue LED excitation and a long pass emission filter. Figure 3C shows the native autofluorescence of pollen grains. The sensitivity of fluorescence detection is highly dependent upon the lens used (higher NA is generally better) and how well aligned and focused the fluorescence illumination (excitation) is. We were routinely able to image bright samples such as puddles of fluorescent beads and pollen grain autofluorescence as well as fluorescence of some fixed samples such as fixed slides of plant material. Detecting red autofluorescence of Chlorophyll from live plants was more challenging but just possible, as was green fluorescent protein expressing tissues. We aim to improve fluorescence detection in the future with improved efficiency of excitation illumination. To set up and align the fluorescence illumination, a test slide of fluorescent highlighter stained lens tissue was used (see Build & Implementation and Extended data: Supplemental Figure S2 [Wincott & Parton, 2021a]).

Easy navigation of samples with motorised focus and XY flexure stage
One of the big challenges in using a microscope is finding and navigating the sample. For a teaching and outreach instrument it is critical that this initial step is made quick and easy. A major departure of Microscopi from traditional microscopes is the lack of eyepieces to assist in locating and orienting the sample. This allows for a simpler more compact overall design. To overcome the potential difficulty for users due to the lack of eyepieces, samples are navigated through the responsive motor-driven focus and XY stage monitored via a live feed from the system's digital camera.
The motorised focus (Z-drive) of Microscopi is based on an M4 screw directly driving a 3D printed rail/slider to raise and lower the imaging lens. This approach provides a relatively large focusing range with well-defined increments provided by a stepper motor and little XY drift during focus. We were easily able to record a relatively large 3D sample such as a fly head (Drosophila melanogaster) as shown in Figure 4 and Supplemental Movies 1A and B (Extended data [Wincott & Parton, 2021a]). Automated focus control offers further options including reconstructing an extended focus or 3D image view of a specimen and automated autofocus functionality.
Navigation of the sample in the horizontal plane (XY directions) is achieved by a simple, elegant, 3D printed flexure-stage which mimics real-world precision stages. The sample platform is held by four flexures, each incorporating a push plate. The stage movement is driven from motors with an integrated captive nut. A drive-rod protrudes from the motor and pushes directly against the push plate to displace the flexure. The flexure design provides backlash-free motion with little Z-drift, although the actual trajectory of travel is over a slight arc due to the constraint of the bent flexures. Symmetric flexures and parallelogram shape help to alleviate this (Bankar, 2017).
With the motorised flexure-stage it is possible to both easily navigate across larger samples and generate a single composite image as shown in the tiled 5×5 panel view of the sectioned stained animal tissue histology slide in Figure 5. Fine control of XY and Z also make it possible to use higher powered objectives facilitating imaging at different scales (Extended data: Supplemental Figure S3 [Wincott & Parton, 2021a]).

An exercise in control -the GUI and underlying code
Microscopi is a motorised microscope with a digital camera. These features lend themselves to automation, computer control and image processing. We have taken advantage of this to make Microscopi an integrated imaging system such that a user can navigate or scan a sample to produce extended focus images, tiled composite views ( Figure 5C) and time-lapse movies (Extended data: Supplemental Movies 2A and B [Wincott & Parton, 2021a]) remotely without having to open up the microscope and adjust hardware directly.
Microscopi is controlled by dedicated Python-based control software operating on an on-board Raspberry Pi computer (see Build & Implementation). We take advantage of the prevalence of electronic devices such as smartphones, desktop computers and laptops to run the Graphical User Interface (GUI) to allow a user to interact with the microscope (Figure 6). The onboard Raspberry Pi acts as a Wi-Fi hotspot to which devices connect. Once a device, such as a smartphone, has connected to the local Wi-Fi any web page address of the form "http://anything" redirects to the Microscopi GUI web interface. This enables full control of the microscope automation, such as sample navigation, focus, and illumination. In addition, images can be captured, viewed, and downloaded.
It is possible to achieve a higher level of automation with relatively simple Python coding to provide additional functions which can be configured and launched from the GUI. The "automated Z-series" collects images though a sample with a user defined step size and range. We have also implemented a simple autofocus mechanism. The most basic autofocus uses a microswitch to define a fixed home position. From the home position an expected sample focus is reached by a fixed offset for each lens. Fine-tuning of this focus may be achieved by subsequently imaging through the sample in small Z steps, assessing the image series against a sharpness or focus metric and navigating to the Z-position with the highest score. Automation can also be applied to increase the effective field of view across XY by incrementing the XY stage movement in a "snake by rows" pattern (Preibisch et al., 2009) collecting a 3×3 or a 5×5 image tile array, followed by image-content based stitching. GUI based control of the LED array illumination pattern allows a user to explore different contrast modes to view a sample and combining any of these protocols further increases the scope for automation.
While operating the microscope from a smartphone is preferable in many usage scenarios, it is less ideal for customising the code to add additional features. Microscopi can be controlled by a keyboard/mouse/monitor plugged into the accessible ports of the Raspberry Pi allowing access to the code running directly on the instrument. The simple Python modules that permit extensive microscope control and experimentation from the GUI can be called or customised and added to. These new features can be subsequently incorporated into the GUI. The ease with which both the hardware and software of Microscopi can be modified and customised further adds to its value in teaching at various education levels and in customisation to niche applications decided by the user.

Build and implementation
Design procedures and 3D printing The layout of Microscopi and 3D components were designed in the freely available CAD package OpenSCAD and exported as STL files. Components were printed on a Lulzbot Taz 5 or Ultimaker S5 printer. Printing parameters were varied according to the requirements of the component, for example, the moving parts of the focus mechanism were printed on finer settings. All printed components were made from PLA filament which offered the best compromise of strength, reproducibility and ease of use. Used PLA is unfortunately not currently widely recycled or widely compostable so disposing of misprints or test prints and the disposal of the microscope when it reaches end-of-life should be carefully considered, or alternative materials tested for suitability. All design files and exported STL files may be found in the Components and assembly guide (http://doi.org/10.5281/zenodo.3701602 [Parton & Wincott, 2020]) as well as part numbers, detailed build instructions and updates. Design drawings for incorporation into figures were produced in the free Blender 2.82 drawing and design software.

Assembly of components and acceptance testing
The Components and Assembly Guide also includes operating instructions and a series of acceptance tests to assist in commissioning the build, as well as a brief trouble-shooting guide and safety documentation. We strongly advise adult supervision of anyone under the age of 18 during the build process and for operation in fluorescence imaging mode. Following the instructions, Microscopi is relatively simple to build from its component parts, most of which require only nuts and bolts to assemble. Hot glue is recommended for adhering parts together as it is non-toxic and easily reversible. Assembling the electronics and wiring is more technically challenging than the other tasks and requires access to more specialised tools (for example: wire snips, wire stripper and soldering iron). As far as possible soldering has been replaced with "solder free' options. General instructions on how to assemble cables and use the various tools referred to may be readily found online.

Safety considerations
Microscopi is intended to be an easy-to-use, accessible instrument for use outside the science lab environment and by the public. However, the optional LED used for fluorescence illumination is bright, so staring into the beam should be avoided.
To prevent accidental exposure, the lid should be fitted with an interlock microswitch which disables the fluorescence LED when opened. We also recommend that the outside casing of the instrument is clearly marked with the warning stickers supplied with the fluorescence LED. A warning label also features in the Components and Assembly Guide (Parton & Wincott, 2020). Microscopi is modular, therefore, for younger user groups, we recommend only installing the bright field 8x8 white LED, LED ring-light and the flexi-lamp.

Software Development and Implementation
Microscopi is driven by several interacting software components running under Raspbian, a Debian-based Linux operating system. In particular, the majority of the microscope control code and GUI are implemented in a custom Python package. The Python package broadly serves two functions. The first is control of the hardware components of the microscope, such as the motors, illumination and camera. In this capacity, the python package can also be used independently from the GUI to write simple automated procedures for the microscope, such as Z-stacks. The second function is to implement the GUI. GUI implementation is achieved by running a webserver (based on Flask) which serves a webpage, containing the GUI, to clients. Running both the control and web server using Python allows simple interaction between the two. The basic Raspbian operating system is configured with additional software and service files to set up the wireless hotspot and to redirect connected clients to the Microscopi GUI served by the Python package. Detailed instructions on how to download, install and implement the Microscopi software are provided in the documentation Extended data (Wincott & Parton, 2021a) and the code is available at http://doi.org/10.5281/zenodo.4549567 (Wincott & Parton, 2021b).

Sample preparation
A variety of samples were sourced for testing, including commonly found materials and pre-prepared commercially available slide sets (see Table 1 A standard fluorescent test slide was produced by colouring an approximately 10 mm square section torn from a sheet of lens cleaning tissue, (alternatively a single ply of toilet paper could be used), mounting dry on a slide beneath a 22 mm square coverslip and sealing with nail varnish, as described in the Extended data Supplemental Figure S2 (Wincott & Parton, 2021a) and the Components and Assembly Guide [Parton & Wincott, 2020]. In addition to the examples featured in this article, a more detailed description of practical examples for teaching and outreach is available at http://doi.org/10.5281/ zenodo.5897427 (Parton, 2022).

Summary
A versatile imaging system for teaching, outreach and fieldwork Our goal in developing Microscopi has been to provide a widely accessible, fully functional automated imaging system, supporting a wide range of interdisciplinary science teaching activities in schools and colleges. A key future objective is to develop a community of users by freely distributing detailed assembly instructions, control software and worked examples of practical exercises. There is also a need for accessible, easy-to-use and inexpensive fluorescence imaging technology, not only for teaching but in real-world applications for medical or veterinary diagnosis or assessment of water quality. To address these applications, our future goals include adapting the Microscopi design to improve the stability and sensitivity of the fluorescence light path; to include further automated controls such as "image based" automated focus; and to revise the software to make better use of icons to reduce language barriers. Furthermore, we hope to establish funding to support the generation and distribution of hardware in kit form.

Data availability
Underlying data All data underlying the results are available as part of the article and no additional source data are required.
This project contains the following: • Microscopi: outreach exemplars (updates will be made through Zenodo site) Data are available under a Creative Commons Attribution-NonCommercial 4.0 International license (CC BY-NC 4.0).
Software is available under a GNU General Public License v3.