Today (Hackaday, April 23), I've invested the bigger part of the day into a quick hack, to demonstrate the potential use of my optical spectroscopy software SPEKWIN32 together with webcam-based DIY spectrometers. It is not perfect, but it works:-)
What it does:
- Connect to any webcam, that is recognized by Windows system
- show a webcam live view
- show a live horizontal cross section as a spectrum within a Spekwin32 plot window
- identify each measured spectrum with live time stamp
- for emission spectra: save a dark spectrum + automated live subtraction of dark
- for transmittance/absorbance: save a reference spectrum + automated live calculation of absorbance/ transmitttance
- use automated peak labeling during live view
- optionally flip the spectrum, to adjust to the original image orientation
- clipping warning for blue, green red channel
- visually define the spectrum ROI, that is used for cross-section calculation
- assign the spectrum's linear wavelength range
- access webcam settings via Windows webcam interface. Depending on webcam type: also control exposure time, white balance & the like
- Disconnect the webcam
- Keep last measured spectrum. Process with all available functions. Save data and export into different file formats (spc, dx, csv, ...). Direct copy&paste via clipboard into Excel and the like. Create plot image files. Print. ...
- Analyze spectrum images without being connected to a webcam spectrometer. Use "Load spectrum Image" from the "File" menu.
Optical setup of spectrometer:
For diffraction of light + focusing I used a concave reflective grating. The slit image is much bigger than the little CMOS chip inside the USB camera. Therefore I used the grating for spectrum projection onto a white piece of paper within the slit plane beneath the entry slit. Used the USB camera with lens to image the projected spectrum image. Works astonishingly well:-)
Application example: measuring absorbance of coloured decals:
- yellow coloured:
- red coloured:
- green coloured:
- blue coloured:
Limitations of the current version => to be improved:
- linear attribution of wavelength information is possible, but w/o calibration.
- => Implement wavelength calibration procedure
- For emission type spectra: wavelength-dependent sensitivity of detector not corrected.
- => Implement sensitivity correction procedure (function already there, not connected to live spectra)
- Not working for Raman measurement type
- => Implement live view for "Raman shift" as x axis + live baseline correction (this function is also already there, but not yet connected to live view)
- Using dark spectrum + reference spectrum at once does not work reliably (actually also not neccessary). "Save reference spectrum" only work reliable in "Intensity" mode.
- => Bug fixing. Make it more stable.
- Needed: Turn off white balance. Control gain + exposure time. Since p4: access to webcam settings, should be possible to control these parameters (depending on webcam type). Could not try with my webcam, these options were not accessible:-((
What annoyed me most:
The webcam had a habit, which is normally useful, but very annoying for spectroscopy: the automated auto-exposure always makes sure to get images with medium intensity. Which means that spectral measurements are severly hampered. It tends to produce partly overexposed data, at least for some of the three color channels. For measuring transmittance or absorbance spectra, it is crucial that the reference spectrum is still applicable when measuring the sample. Which is only the case, if a) the light intensity is still the same and b) the exposure time didn't change. However, as soon as you put the (light-absorbing) sample into the light path, the cam does increase the exposure time, in order to compensate the decreased light level. Which basically means, that only the first one or two frames after putting the sample into the light path give something near to the real sample absorbance. Due to this behaviour, I had to do the above screenshots for presenting results.
I am curious to learn about...
Dr. Menges,
it is great to see a committed researcher, who aspires and aspiring to continuously work independenly these days... however, i came to know about you so late... me unfortunate.
since i have started working in NIR-AOTF spectrometers with little pre-knowledge in statistical mechanics, and chemistry (yeah i am much of an instrumentation/communication engineer)... it kind of grasped my very passion for the subject.
at the same time, i have contributed to something for spectroscopy in a DIY way, but such contributions even licensed openly, were specific to the specific spectrometer me and my colleague were developing in the laboratory.
then in find fl@c@t, who does diy raman spectrometer, with whom i got in touch, but have never contributed to the project..... :).... and other spectroscopy based projects at smaller scale... it became kind of interesting to see a raise in momentum for DIY/open spectrometers.
me had stressful deliberations with my seniors, to access spectral DB, calibration etc.. stuff... with too much centralization and control in the industry, for such a wonderful subject of science. I believe that william herschel or other pioneers like you would not hold control over the tools and instruments that were created.
in that sense, i see your contribution and continuing it for 15+ years actively... as a great one.
i would like to add some more suggestions.... i honestly do not know, being a novice relatively, whether i am eligible to do so... but endure me... pls... :D..
Ii wonder, why you have not intended the project to be a free(as in speech) software / open source software model. afa i see, the great tool, so far is restricted to only one particular platform, losing the incredible power of portability. Furthermore, people working in diy-raman spectrometer, and at public lab could contribute collaboratively.