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

by warren |

### 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.

### Why?

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?

### Software

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 SpectralWorkbench.org, 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 https://spectralworkbench.org/capture ?

The BIG advantage of the Raspberry Pi is the use of the Sony IMX298 sensor whose spectral bandwidth is known and is 16 megapixel sensor. Much like the bandwidth of the solux 35003 light source bandwidth. I am awaiting the arrival of a webcam which uses the Sony IMC179 sensor 8 megapixel camera. The current camera is capable of 8 megapixel resolution but only 640 are used.. The solution may be to upgrade SW to selectively switch camera resolution as needed. I look forward to your success with the rasp Pi. stef

That's a great thing to point out -- do you per chance have a link to the spectral bandwidth of the sensors? Thanks!

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

@warren

Here is a link http://www.khufkens.com/projects/ov5647-spectral-response/ and here is a zip file khufkens-pi-camera-response-curves-3342e29_-2-.zip 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

@warren

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.

stef

I was wondering the same thing, just with the PiNoIR camera since I am more interested in remote sensing of vegetation.

I found that V4L2 driver apparently makes it possible to use the raspberry pi camera in Firefox with webrtc, the API Spectral Workbench uses: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=154437, which should be as easy as sudo apt-get install v4l-utils -- anyone able to try this?

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