Question: Is the webcam from spectrometer v2.0 suitable for the upgrade to 3.0?

pablo is asking a question about spectrometry
Follow this topic

by pablo | November 14, 2016 14:35 | #13704


What I want to do or know

I want to know if the webcam from v2.0 is suitable for spectrometer 3.0. Is there something else to have in account?

I'll remove the DVD piece and install it as described in v3.0.

Background story

I am upgrading from spectrometer 2.0 to 3.0 version.



16 Comments

Hi, Pablo - I think you can leave the DVD as it is, and the challenge will be to get it to remain in the same orientation with regard to the slit, very solidly, even though the cable comes out the back. The cable may be a problem because you won't be able to lay it against the angled wood block in the 3.0 design -- you may have to find a different way to support the camera, and that solid, unbending connection is very important to the calibration holding.

Reply to this comment...


Thaks, Jeff. I'll try to use a wooden block with a hole in it, or made with pieces to allow the cable to pass. I'll keep distance and height from the lens to the slit.

What about the 45º and 60º degrees for the camera and the DVD of v3.0? Why do you suggest to leave it as it is already mounted? Not as important?

Is this a question? Click here to post it to the Questions page.

@stoft or @cfastie may be able to provide more info, but I believe it's been shown that the exact angle is not as important within the likely resolution of the device? I could be wrong but either way, we should link to supporting evidence from here. Thanks!

Is this a question? Click here to post it to the Questions page.


The angle is a function of (mathematical) of the detectable wavelength range and the diffraction grating (DVD) line spacing. My calculations and my published Matlab plots show that 45-deg is a good match to the 400-700nm range of sensitivity of a webcam. This makes the mounting alignment easy -- the DVD is mounted close and parallel to the camera lens and that 'sub-asssembly' is then aligned at 45-deg to the light from the slit. The alignment angle tolerance is also a function of the camera optics.

The cheapy webcams (with the tiny, low-f lenses) result in the spectral band occupying only about 'half' of the camera's "pixel-span" so alignment "feels" very insensitive. However, that is partially an illusion because as the spectral band (say 400-650nm) is 'adjusted' in "left-right position" within the camera frame, the wavelength span will no longer be 'centered' which will add some non-linearity to the otherwise linear approximation for CFL wavelength calibration.

So, I built my spectrometers using 45-degs so as to 'center' the 400-650nm band where the mid-point 525nm "ray" will be orthogonal to the plane of the image sensor thus making the image symmetrical.

So, from a practical aspect, and with tiny webcam lenses, there is plenty of image area so you'll easily get a full spectrum even if the angle is off a little bit -- but it's still good to understand where the numbers come from when making trade-offs.

[ I'm guessing that the '60-deg / 45-deg' combination came purely from fiddling with the parts or perhaps from an effort to view more of one end of the spectrum. While a webcam (sans IR filter) does detect some infrared, relative to the center 550nm green spectral sensitivity, the IR sensitivity out past 700nm is quickly in the noise. (Yes, if the signal has very little visible wavelengths, then you can 'push' the IR detection but amplitude accuracy past 700nm is very poor and noisy.) ]


Thanks @stoft and @warren. I've left the DVD as it was in spectrometer v2.0 (test: https://spectralworkbench.org/spectrums/91439) and it works.

Now I wonder to which distance should I adjust the focus of the old camera in the v3.0 kit (I saw your comments https://publiclab.org/notes/stoft/05-03-2013/spectrometer-focus#c4612).


I think you can use this old focus tutorial and do it empirically: https://publiclab.org/wiki/dsk#Unscrew+the+lens+and+remove+the+infrared+filter

That should perhaps be reposted as a "focus your spectrometer" activity at some point...


I note that 1) your spectrum does "fit" though it is 2) "offset" a bit from center which is likely related to the angle. (Just to identify what is seen; not that the effect is huge.) The broad "hump" in the 'blue' background level suggests possible light leakage, optical path skew, or some distortion -- the background (between the spikes) ideally is close to zero.

As for camera focus, the practical answer is: where the resolution of the green double-peak is the sharpest. When the distance from the slit to the grating is "longer", the slit behaves more like a 'point source' so the camera focus is closer to infinity. But these tiny, polycarbonate lenses are poor, have significant aberration and large DOF so the focus point will be just a guess at best (the effect of focus adjust on the clarity of the spectral won't be dramatic) and so final performance will be limited.


I think the blue hump was something we saw a lot on those SYBA webcams, and believe it was related to a blue LED in the webcam itself, which you can snip off without trouble (snap open the grey webcam enclosure; you can glue/tape it shut again). That was one of the (several) reasons we abandoned that camera, but it's an easy fix. I think that's right... it's been a while!!


I've focuses to 22cm, removed blue LED: https://spectralworkbench.org/spectrums/91509 The blue hump is still there. I'll try to change the DVD to see if it changes something. I'll look for light leakages, but it doesn't look like light is entering. Maybe the slit is to bright?

How to control "optical path skew" or "some distortion".

Is this a question? Click here to post it to the Questions page.


OK - i guess the blue bulge is just a limitation of the camera... i had forgotten exactly. But if you subtract a baseline reading from any readings you do, it shouldn't have a big effect -- just somewhat of a decrease in your dynamic range for that region. Is that right, Dave?

Is this a question? Click here to post it to the Questions page.


No I don't think it is just inherent in the camera. The blue led has a fairly narrow spectrum (say 25nm at most) so producing a 150nm 'spread' would mean a broad angle of light impinging on the DVD -- which doesn't appear to be right.

As I recall, some user-posted CFL spectra show this effect and some do not. My early experiments with the old camera did have some noise but not this much in the blue. I think a common problem is having the CFL source much too close to the spectrometer (so having the inverse of a 'point source') which easily causes additional internal reflections along with other issues.

Having a large, broadband 'false signal' included does a lot of damage to the data from the true signal. When the true signal is 20dB below the noise, even complex correlation techniques cannot extract the signal data so it is not just a simple subtraction to look for the difference. Noise is always a killer of signal data and, generally, signals need to be at least 6dB above the noise to be 'usable'.

To get a visual sense of the error, just compare the original CFL spectra I collected using the original PLab 'box' camera with my latest Hi-Rez configuration. The difference is dramatic -- and the plots were extracted from the same CFL (and none of them have 'broadband blue noise'.

It would be good to track-down the root-cause of the blue error. Try this: 1) a darkened room, 2) CFL at a distance of 3-5 feet, 3) could also block all light from CFL except for a 1-inch hole in a cardboard mask to further restrict the source angle, 4) DVD parallel to camera sensor, mounted very close to the lens, 5) DVD at 45-deg to direction of slit, 6) slit at least 8-10 inches from camera, 7) mechanically stable (sitting on the desk) then 8) focus for best resolution of mid-green double-peak. Under these conditions, I often just use a black cloth to cover the spectrometer parts which usually eliminates nearly all stray light.


Great idea to constrain and track this down -- it might make a good new question in its own right, esp. if it's a common issue (which seems likely). Then it'll be featured on the spectrometry page.


Hi! I've followed all the recommendations (except refocus) but the blue hump is still there: https://publiclab.org/notes/pablo/11-09-2016/how-to-do-upgrade-desktop-spectrometer-kit-2-0-to-the-version-3-0?_=1479464146#4.+Enhacements uhmm!

A year ago with the same DVD-webcam in the v2.0 spectrometer I got this spectrum: https://spectralworkbench.org/spectrums/61001 No blue noise.

I'm going to try to put the camera back in spectrometer v2.0 to see what happens.

Is this a question? Click here to post it to the Questions page.


I've changed the bulb and used a less powerful one and I got good results: https://spectralworkbench.org/spectrums/91741 without the blue noise.

Was it just related to the bulb?

Is this a question? Click here to post it to the Questions page.


Oh, interesting -- what types of bulbs were they?

Is this a question? Click here to post it to the Questions page.


There's still some clipping (source light intensity too high) so a comparison, using a cardboard mask (with a small hole in it), between the two bulb types might be helpful in diagnosing if there is an association between bulb intensities or if the difference is related to having a wide-angle light source -- or, perhaps, related to spectral differences between various physical regions of the CFL.. If the Mfg of the bulb were the same that would eliminate another variable.


Reply to this comment...


Log in to comment