An Improved Spectrometer, No Lasers Required

Here at Hackaday, we love it when someone picks up the ball from a previous project and runs with it. That’s what we’re all about, really — putting out cool projects that just might stimulate someone else to extend and enhance it, or even head off in an entirely new direction. That’s how the state of the art keeps moving.

This DIY spectrometer project is a fantastic example of that ethos. It comes to us from [Michael Prasthofer], who was inspired by [Les Wright]’s PySpectrometer, a simple device cobbled together from a pocket spectroscope and a PiCam. As we noted at the time, [Les] put a lot of the complexity of his instrument in the software, but that doesn’t mean there wasn’t room for improvement.

[Michael]’s goals were to make his spectrometer a little easier to build, and to improve the calibration process and overall accuracy. To help with the former, he went with software correction of the color filter array on his Fuji X-T2. This has the advantage of not requiring a high-power laser and precision micropositioner to ablate the CFA, and avoids potentially destroying an expensive camera. For the latter, [Michael] delved deep into the theory behind spectroscopy and camera optics to develop a process for correlating the intensity of light along the spectrum with the specific wavelength at that location. He also worked a little machine learning into the process, training a network to optimize the response functions.

The result is pretty accurate spectra with no lasers required for calibration. The video below goes into a lot of detail and ends up being a good introduction to some of the basics of spectroscopy, along with the not-so-basics.

Continue reading “An Improved Spectrometer, No Lasers Required”

New Drivers For Ancient Webcam

For those of us who are a little older, the 90s seem like they were just a few years ago. The younger folks might think that the 90s were ancient history though, and they might be right as we’ve been hearing more bands like Pearl Jam and The Offspring playing on the classic rock stations lately. Another example of how long ago the 90s were is taking a look at the technological progress that has happened since then through the lens of things like this webcam from 1999, presuming you load up this custom user space driver from [benjojo].

Thankfully the driver for this infamous webcam didn’t need to be built completely from scratch. There’s a legacy driver available for Windows XP which showed that the camera still physically worked, and there’s also a driver for Linux which was used as a foundation to start working from. From there a USB interface was set up which allowed communication to the device. Not a simple task, but apparently much easier than the next steps which involve actually interpreting the information coming from the webcam. This is where a background in digital signal processing is handy to have. First, the resolution and packet size were sorted out which led to a somewhat recognizable image. From there a single monochrome image was pieced together, and then after deconstructing a Bayer filter and adding color, the webcam is back to its former 90s glory.

[benjojo] has hosted all of the code for this project on a GitHub page for anyone who still has one of these webcams sitting around in the junk drawer. The resolution and color fidelity are about what we’d expect for a 25-year-old device that predates Skype, Facebook, Wikipedia, and Firefox. And, while there are still some things that need to be tweaked such as the colors, white balance, and exposure, once that is sorted out the 90s and early 00s nostalgia is free to flood in.