One day left for Public Lab's 🎈 Mini Balloon & Kite Kit as part of Kickstarter Gold -- take a look!

  • 1

Question:Can I upgrade a DIY spectrometer with a Raspberry Pi camera?

warren is asking a question about spectrometry: Subscribe to answer questions on this topic

warren asked on September 28, 2016 19:13
800 | 3 answers | shortlink

What I want to do or know

I've seen some of the really great work by @cristoforetti and the #webvalley group -- which I was lucky enough to help a bit on -- to build a version of our spectrometry kits around the camera from a Raspberry Pi mini computer board.

I'd like to think about how this could be done in a standard Desktop Spectrometry Starter Kit, as an upgrade -- or with a foldable mini-spectrometry kit.


On a hardware basis, this'd hopefully be as simple as gluing the Raspberry Pi camera ($40 with the Pi Zero version board on Adafruit) in place of the webcam that comes with the kit, shown above.


Raspberry Pi cameras can have auto exposure/gain compensation shut off, and a specific shutter speed manually set. This could do a lot to improve #exposure-calibration, perhaps adding to work by @stoft on #gain-correction.

Has anyone tried that?

(photo via Adafruit)image description


Getting the software running could be harder -- the Raspberry Pi isn't like a USB webcam, and if you're using it with a monitor & mouse, I'm not sure the camera would show up like a USB camera in a browser.

Note: see possible solution with V4L2 library, below in comments!

While the spectral-workbench.js library is capable of uploading data to, meaning you can run it on the commandline of a Raspberry Pi,

Aside from uploading it as a still image, what more easier, simpler ways are there to use a Raspberry Pi-based camera using the live web interface at ?

spectrometer calibration spectrometry webcam raspberry-pi exposure rpi gain-correction gain-control webvalley exposure-calibration



Log in to comment

3 Answers


Here is a link and here is a zip file Here are data sheets ProductBrief_IMX298_20160210.pdf and ProductBrief_IMX179_20140910.pdf

Unfortunately the curves end at 700nm. There is much more info in the first link. Regards stef


After sleeping it over, realized that due to the no IR filter of the raspberry the bandwidth response will be different from the published. BTW good luck finding one, seems everybody is out.


Just wanted also to link to @stoft's input on this question in this comment:

As to the RPi camera, it seems to have two "difficulties" which need solutions: 1) a "convenient" solution for interfacing the camera, controlling parameters and extracting image data from it (i.e. USB or other? ... I've just not seen a clean option) and 2) the lens. The mount and lens are very small and I've discovered (as noted in the above note) that a better lens (~8mm) is really necessary. All the added pixel data is useless if the lens is junk. There has been some hacks to the RPi for other mounts, but the RPi board is very small so the hacks are not easy or a clean drop-in -- from what I've found so far. I also have not found specs on the chip sensitivity and dynamic range -- which is necessary for comparing cameras. If the sensitivity is low, then the background noise can also "seem better" -- but that is not a measure of image "quality" -- it is sensitivity and dynamic range that count. Also, it would be good to compare cost of RPi + uC vs USB module types. The added pixel resolution of the monochrome I used did not appear to provide "clearly better" results than the more moderate cost ELP. No, that is not definitive numbers, but it just indicates additional details worth observing so as to compare specs that are of importance to the resulting spectra. So, I'm not rejecting the RPi, it just does not yet appear to be a drop-in option.

Sign up or Login to post an answer to this question.