We report on the development of a low-cost spectrometer, based on off-the-shelf optical components, a 3D printed housing, and a modified Raspberry Pi camera module. With a bandwidth and spectral resolution of and 1 nm, respectively, this device was designed for ultraviolet (UV) remote sensing of atmospheric sulphur dioxide (), . To the best of our knowledge, this is the first report of both a UV spectrometer and a nanometer resolution spectrometer based on smartphone sensor technology. The device performance was assessed and validated by measuring column amounts of within quartz cells with a differential optical absorption spectroscopy processing routine. This system could easily be reconfigured to cover other UV-visible-near-infrared spectral regions, as well as alternate spectral ranges and/or linewidths. Hence, our intention is also to highlight how this framework could be applied to build bespoke, low-cost, spectrometers for a range of scientific applications.
Published by The Optical Society under the terms of the Creative Commons Attribution 4.0 License. Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI.
Spectroscopy is an important analytical technique utilized in numerous fields, including biomedical science [1,2], atmospheric chemistry [3,4], volcanology [5,6], and food quality inspection . Ultraviolet (UV) spectroscopy, in particular, is often used to measure the concentrations of trace atmospheric species, given their absorption bands in this region [8,9]. With the advent of widely available 3D printing services  and low-cost smartphone cameras, there has been an increasing interest by researchers in designing and manufacturing their own spectroscopic instruments [1,2,7,11–13], rather than purchasing off-the-shelf units, with the potential for reduced system costs and user-tailored solutions to measurement problems.
The approaches taken to date have involved light being coupled to the smartphone sensor via the smartphone camera lens, with the processing power of the phone applied in a “lab-in-a-phone” capacity. Hence, these instruments have been focused on visible applications, due to the absorption of light outside this region by the camera lenses and the Bayer filters typically applied to the fore of the sensors to generate red-green-blue mosaics. However, we have recently demonstrated that low-cost CMOS sensors, developed for the consumer electronics (in particular smartphone) market, can be adapted, by removal of the Bayer arrays and sensor microlenses, to produce monochrome imaging systems with usable UV sensitivity [14,15]. This was achieved using a Raspberry Pi (R-Pi) camera module based on an Omnivision OV5647 sensor. Furthermore, this process will likely also increase the sensor’s response to near-infrared (IR) radiation. Hence, such sensors now open the way for extending “smartphone” sensor spectroscopy beyond the visible region.
In this Letter, we report for the first time, to the best of our knowledge, the development of a low-cost UV spectrometer based on a 3D printed architecture and a low-cost camera sensor from the consumer electronics, e.g., smartphone, market. This unit, which is based on an R-Pi camera module and R-Pi computer board, also offers the advantage of greater user control than typically available from smartphone interfaces, e.g., access to raw data, fixing of analog gains, and avoidance of automatic adjustments of white balance, which can adversely impact the integrity of the results . Furthermore, by adopting this novel architecture, whereby the spectrometer sensor is located outside a smartphone, the Bayer filter can be removed in a far more straightforward manner, to enable heightened optical throughput at non-visible wavelengths.
Here, we discuss the design of this spectrometer (referred to as the PiSpec), in addition to the results of a study aimed at demonstrating its utility in relatively narrowband UV spectroscopy, e.g., measurements of atmospheric trace gases. We focus this Letter on the absorption of sulphur dioxide (), which requires a resolution of , and where UV remote sensing has been commonly applied to monitor pollution from power station smokestacks  and gas release from volcanoes [5,6]. In particular, we demonstrate the ability of the PiSpec to measure via an experiment involving quartz cells containing independently determined column amounts of this gas.
The optical system was modeled using OpticStudio (Zemax, LLC) ray tracing software, based on a crossed Czerny–Turner spectrometer format, to provide a spectrometer footprint of (Fig. 1), with excellent system portability. This generic design could readily be reformatted to suit a variety of other application areas, e.g., by varying the entrance slit, grating line density, or grating angle, to alter the linewidth, range, and bandwidth.
In this case, we implemented UV-enhanced aluminum-coated mirrors of 12.7 mm diameter and 50 mm focal lengths (CM127-050-F01, Thorlabs, Inc.) and a UV-reflective holographic diffraction grating with 1200 lines/mm (GH13-12U; Thorlabs, Inc.). In terms of the light entrance into the instrument, we used a slit of dimensions (S30R, Thorlabs, Inc.). Behind this, a short-pass filter reduced stray visible light within the spectrometer (464FCS2500, Knight Optical, Ltd.). The sensor was a modified R-Pi camera module v1.3, with a removed Bayer filter, following the process detailed in Ref. , in order to vastly improve the UV sensitivity of the detector. The camera module focusing lens and IR blocking filter were also removed during this process, so that light within the spectrometer was directly incident onto the sensor itself. The f-number of the spectrometer, defined as the focal length of the spherical mirror divided by its diameter, is . The overall part cost was , although any production at scale would lead to a significant further reduction in this figure. The cost could also be reduced with lower quality optical components, e.g., using a DVD section as the diffraction grating , although this would provide less dispersion than the grating employed here.
The spectrometer design from OpticStudio was saved as a STEP (.stp) file and imported into SolidWorks, the 3D computer-aided design software. This was used to develop a 3D model of the optical system housing, in particular, by using the SolidWorks models of the optical components (available on the Thorlabs website) as templates around which the housing was drawn. A slight tolerance (0.2 mm) was incorporated around the optical components to account for inaccuracies in the 3D printing procedure, ensuring that all components would fit into their mounts. The 3D model was printed via https://3dprintdirect.co.uk, a third-party service available to the public, which employs selective laser sintering in graphite reinforced nylon. This process was chosen since the quoted precision of far exceeds that of the ubiquitous fused filament fabrication. Once printed, the optical components were placed into the housing and held in place with further 3D printed parts and small amounts of glue.
The sensor was connected to an R-Pi 3 Model B, low-cost, credit card-sized computer, which controls image acquisition from outside the spectrometer housing. The R-Pi itself was controlled by a laptop-run graphical user interface written in Python, enabling user control of acquisition settings, before more detailed post-acquisition analysis in MATLAB. Future development of the Python code will incorporate real-time spectral processing. Prior to analysis, the images were binned from the full-resolution files to arrays, to increase the signal-to-noise ratio (SNR) , given that on-chip binning is not possible with this sensor. The collected images were then converted to spectra by co-adding the 11 adjacent rows of the image where illumination is the greatest. This further increases the SNR, the benefits of which are detailed below, in terms of the application. Therefore, each spectrum contains 648 data points. A dark image, with light blocked from entering the spectrometer, is also acquired at the same acquisitions settings as, and subtracted from, all acquired “spectral” images. For example, Fig. 2(A) shows a dark image subtracted spectral image, with light input from a Hg–Ar source (HG-1, Ocean Optics, Inc.), demonstrating dispersion across the columns of the sensor array.
The Hg–Ar source was used to perform wavelength calibration of the instrument by matching pixel positions to the known wavelengths of the Hg line peaks, then interpolating to assign wavelengths to each of the sensor pixels. A sample line spectrum is shown in Fig. 2(B). The drift in this calibration was determined as only by observing how the observed absorbance features were shifted relative to the positions expected from the Hg lamp calibration, representing promising wavelength stability. The PiSpec spectral resolution was also established by measuring the full-width at half-maximum (FWHM) of the source line peaks. This was which, to the best of our knowledge, is the narrowest quoted yet from a smartphone sensor-based spectrometer.
To couple light into the spectrometer slit, we mounted an exterior lens (; LXS5025-AU1, Knight Optical) using further 3D prints outside the box. To demonstrate the utility of this device for atmospheric trace gas detection, we acquired spectra when pointing the unit at the sky and placing quartz calibration cells containing gas in front of the lens. This work was performed on July 25, 2017, in Sheffield, UK, mimicking the measurement configuration in the field, for example, at power stations or volcanoes, where column amounts are quantified using differential optical absorption spectroscopy (DOAS, ); fluxes are determined by traversing beneath or scanning the gas plume, integrating the acquired column amounts, then multiplying by plume speed [5,6]. Although light dilution and in-plume scattering issues are avoided in the cells, the retrieval procedure for determining column amounts is identical, providing a robust test of the spectrometer’s utility in this application.
The DOAS technique is extensively detailed elsewhere [5,8,17,18]; therefore, we give only a brief overview. By first taking a clear-sky spectrum and then placing the cell over the spectrometer field of view, we can calculate the absorbance, , at wavelength, , of the cell using the Beer–Lambert law:14]. Before this calculation, the dark image subtracted spectra must also be corrected for stray light, which was achieved by subtracting the average DN in the 280–285 nm range from each spectrum, since there is no skylight there due to Ozone absorption (e.g., ), e.g., any such signal must be stray light. We furthermore characterized stray light intensity following the method of , taking the ratio of stray light to that of clear sky at 320 nm. Our ratio of 0.13 is slightly larger than that reported for commercially available spectrometers detailed in Ref. . However, with further baffling, or matt-black coating of the interior, this could be reduced.
The derived absorbance spectra, , contains not only the desired absorption features, but also other unwanted signals, e.g., absorbance from the cell windows, which is broadband in nature. The absorbance features, which vary rapidly in the wavelength domain, therefore can be isolated by applying a high-pass filter to , involving a polynomial of order dependent on the profile of the absorption features. A reference spectrum (1 ppm·m column amount) of , was then developed by convolving the high spectral resolution absorption spectrum from , with a normalized PiSpec lineshape from the Hg–Ar lamp, then also high-pass filtering. The filtered were then fitted with this reference spectrum using a least squares routine, such that the scalar fit coefficient represents the column density of in the optical path. Figure 3 shows absorbance spectra generated for two different quartz cells (referred to as A and B), and the fitted reference spectra. This test shows that the PiSpec has a sufficient spectral resolution and SNR to resolve atmospheric absorption, demonstrating proof of concept in terms of the potential applicability of this device in trace gas monitoring.
To provide a more quantitative analysis, the column amounts of two gas cells were contemporaneously measured using a commercial Ocean Optics, Inc., USB2000 spectrometer and the volcanoSO2.exe software , a hardware-software combination that has been used extensively to perform field retrievals. Here, 10 retrievals per cell were performed per spectrometer, with average column densities determined as and for A and B, respectively, for the USB2000; the PiSpec yielded and , respectively. Therefore, these results overlap within the range of the device’s standard deviations, providing vindication for the PiSpec’s quantitative performance in this arena, although, as would be expected, with a somewhat larger range for the lower cost PiSpec. The agreement here is also as close as could be expected, given uncertainties in DOAS (e.g., [21,22]), e.g., our results are within the 15% error quoted for volcanoSO2.exe retrievals . One drawback of the PiSpec is the need to use relatively long exposure times, partly due to the non-UV specific sensor design; e.g., UV specific sensors tend to have the P-N junction located close to the surface (e.g., ); furthermore, the USB2000’s linear CCD has a coating which downconverts UV to visible radiation, to which the detector is more sensitive, as well as a cylindrical lens, which focuses light from the entire slight height onto the detector. Hence, PiSpec integration times of 6 s were applied (the maximum possible on the R-Pi cameras), in comparison to for the USB2000. Note that, due to overcast conditions during the acquisitions, the UV signal was somewhat depleted. While the use of a wider aperture slit will increase the signal, reducing integration time requirements, there will be a trade-off in spectral resolution.
The co-adding of rows leads to a clear improvement in SNR and better matching to the reference spectrum, relative to single row spectra (Fig. 3). Furthermore, column amounts generated from just one row, , show significant deviations from the USB2000 and co-added PiSpec retrievals. Although co-adding of more rows would be possible, it could create issues associated with non-orthogonal alignment of the components in the spectrometer, i.e., whether or not the wavelength calibration of the instrument is consistent across the entire sensor height. By mounting components on high-precision adjustable mounts, it may be possible to more accurately align each part; however, this incorporates added complexity to a system which is partly designed for simplicity. Alternatively, it could be possible to generate a wavelength calibration for each row of the sensor, such that this issue can be eliminated in software.
In summary, we have presented a methodology for the design and manufacture of a custom spectrometer, based on a low-cost CMOS sensor, off-the-shelf optical components, and a 3D printed housing. The developed unit is, to the best of our knowledge, both the first resolution spectrometer and the first UV spectrometer based on a smartphone sensor and 3D printed housing design, delivering moderate resolution UV spectroscopic performance at a considerably lower price point than achieved previously. The suitability of this unit in quantitative scientific applications was illustrated via tests with quartz cells containing . In a comparison with a rather more expensive commercial instrument, the PiSpec system displays broadly similar performance, e.g., somewhat larger standard deviations in retrieved (21 and versus 12 and , for the PiSpec and USB2000, respectively), yet comparable average column amounts, which overlap within a standard deviation. An ancillary investigation into gas detection limits, looking at the standard deviations in the retrieved clear-sky spectral time series, yielded near identical values to those found in the cell experiment.
The PiSpec is based on a modified visible imaging camera sensor which has good sensitivity in the UV due to its back-illuminated CMOS architecture and the removal of the Bayer filter and microlenses which attenuate UV radiation. Hence, we suggest that this protocol could be applied in the future to produce a range of inexpensive spectrometers for a variety of application areas where moderate spectral resolution is required, within the response of silicon photodiodes (e.g., up to and possibly deeper into the UV than covered here ). Future work could also include more extensive research into the performance of different 3D printing materials, e.g., less expensive PLA or ABS, in terms of print precision and thermal stability. While the highly inexpensive detector () is a very attractive feature of the developed units, its compact form does restrict the instrumental bandwidth, per given optical bench design. One solution could be to incorporate multiple detectors within spectrometers, to enable simultaneous investigation of a number of spectral regions of interest.
Engineering and Physical Sciences Research Council (EPSRC) (EP/M009106/1); Natural Environment Research Council (NERC) (NE/K500914/1, NE/M021084/1); Leverhulme Trust (RF-2016-580); University of Sheffield (Postgraduate Scholarship); Rolex (The Rolex Awards for Enterprise).
1. Z. J. Smith, K. Chu, A. R. Espenson, M. Rahimzadeh, A. Gryshuk, M. Molinaro, D. M. Dwyre, S. Lane, D. Matthews, and S. Wachsmann-Hogiu, PLoS ONE 6, e17150 (2011). [CrossRef]
2. C. Zhang, G. Cheng, P. Edwards, M.-D. Zhou, S. Zheng, and Z. Liu, Lab Chip 16, 246 (2016). [CrossRef]
3. J. P. Pommereau and F. Goutail, Geophys. Res. Lett. 15, 891 (1988). [CrossRef]
4. J. Stutz, B. Werner, M. Spolaor, L. Scalone, J. Festa, C. Tsai, R. Cheung, S. F. Colosimo, U. Tricoli, R. Raecke, R. Hossaini, M. P. Chipperfield, W. Feng, R.-S. Gao, E. J. Hintsa, J. W. Elkins, F. L. Moore, B. Daube, J. Pittman, S. Wofsy, and K. Pfeilsticker, Atmos. Meas. Tech. 10, 1 (2016).
5. B. Galle, C. Oppenheimer, A. Geyer, A. J. S. McGonigle, M. Edmonds, and L. A. Horrocks, J. Volcanol. Geotherm. Res. 119, 241 (2003). [CrossRef]
6. A. J. S. McGonigle, C. Oppenheimer, B. Galle, T. A. Mather, and D. M. Pyle, Geophys. Res. Lett. 29, 46 (2002). [CrossRef]
7. M. A. Hossain, J. Canning, K. Cook, and A. Jamalipour, Opt. Lett. 41, 2237 (2016). [CrossRef]
8. U. Platt, Air Monitoring by Spectroscopic Techniques, M. W. Sigrist, ed. (Wiley, 1994), pp. 27–84.
9. M. Morys, F. M. Mims III, S. Hagerup, S. E. Anderson, A. Baker, J. Kia, and T. Walkup, J. Geophys. Res. 106, 14573 (2001). [CrossRef]
10. C. Zhang, N. C. Anzalone, R. P. Faria, and J. M. Pearce, PLoS ONE 8, e59840 (2013). [CrossRef]
11. S. Dutta, A. Choudhury, and P. Nath, IEEE Photonics Technol. Lett. 26, 568 (2014). [CrossRef]
12. H. Yu, Y. Tan, and B. T. Cunningham, Anal. Chem. 86, 8805 (2014). [CrossRef]
13. M. A. Hossain, J. Canning, S. Ast, K. Cook, P. J. Rutledge, and A. Jamalipour, Opt. Lett. 40, 1737 (2015). [CrossRef]
14. T. C. Wilkes, A. J. S. McGonigle, T. D. Pering, A. Taggart, B. White, R. Bryant, and J. Willmott, Sensors 16, 1649 (2016). [CrossRef]
15. T. C. Wilkes, T. D. Pering, A. J. S. McGonigle, G. Tamburello, and J. R. Willmott, Remote Sens. 9, 27 (2017).
16. M. M. Millan, Atmos. Environ. 14, 1241 (1980). [CrossRef]
17. A. J. S. McGonigle, J. Volcanol. Geotherm. Res. 162, 111 (2007). [CrossRef]
18. E. P. Kantzas, A. J. S. McGonigle, G. Tamburello, and R. G. Bryant, Comput. Geosci. 40, 194 (2012). [CrossRef]
19. E. P. Kantzas, A. J. S. McGonigle, and R. G. Bryant, Sensors 9, 3256 (2009). [CrossRef]
20. A. C. Vandaele, P. C. Simon, J. M. Guilmot, and R. Colin, J. Geophys. Res. 99, 25599 (1994). [CrossRef]
21. L. Vogel, H. Sihler, J. Lampel, T. Wagner, and U. Platt, Atmos. Meas. Tech. 6, 275 (2013). [CrossRef]
22. M. Fickel and H. Delgado Granados, Chem. Geol. 462, 67 (2017). [CrossRef]
23. H. Ouchi, T. Mukai, T. Kamei, and M. Okamura, IEEE Trans. Electron Devices 26, 1965 (1979). [CrossRef]
24. A. Darmont, Aphesa White Paper, 1–13 (2009). http://www.aphesa.com/documents.php.