top | item 30027804

DIY Raspberry Pi Spectrometer Guide

208 points| robertelder | 4 years ago |github.com

28 comments

order

mncharity|4 years ago

OT question: Is it possible to use a wedge-shaped slit (uneven width) to increase the dynamic range of a slit-grating-camera phone spectrograph?

Backstory: I've repeatedly encountered deep confusion about color, even among first-tier physical-sciences graduate students. Yet color is widely taught K-2. Apparently without great success. So what might a rewrite, a modern learning progression for color, look like? Perhaps one based on spectra, a modern colorspace, and building on current understanding of color perception? Tablets are used in K - "find and take a picture of a circle". So how about using them for color? There's middle-school work with color "arithmetic" (an <R, G, B> binary triple with addition(light) and subtraction(filter)). And phone spectrographs are a thing. Thermal IR inspection cameras suggest having a context image aids understandability, and phones now have multiple cameras, so might one do a more accessible sample-with-context spectroscope app? With the light path folded flat, not sticking out? And a high dynamic range to permit sampling objects under ambient illumination? Might one craft a spectra-based introduction to color? For K?

jiggunjer|4 years ago

Why. All models are flawed, some are useful. Kids learn mixing paints, that's useful for arts and crafts. Students learn more advanced models depending on their needs.

bradrn|4 years ago

No need for a Raspberry Pi! I once made a spectrometer at home out of just a camera, a white LED and a diffraction grating (and some tape and a wood base to hold it together). If you don’t have a diffraction grating, it can be replaced by a CD — only difference is that the CD operates using reflection vs transmission. The idea is that you shine the light from the LED through your sample (which I bought some cuvettes to hold); the light then transmits through the grating / off the CD, which splits it into wavelengths. One can then take a photo of the spectrum and analyse it using a program such as [0]. Of course, an LED is a pretty terrible light source, but with some sort of baseline correction I suspect it could actually become pretty reasonable as a spectrophotometer.

[0] http://scheeline.scs.illinois.edu/~asweb/CPS/

KennyBlanken|4 years ago

You can use a peeled-apart DVD and a USB web camera for a fraction of the cost. It's a design Public Labs came up with around 2012: https://hackaday.com/2012/08/27/turning-a-webcam-into-a-spec...

Public Labs even developed a modified design that works with most smart phone cameras, among their follow-up work (such as testing high-end cameras: https://publiclab.org/notes/stoft/10-23-2016/high-rez-webcam... )

The spectral response of the sensor is not linear, as it is designed to imitate human vision - and as anyone who read early 2000's digital camera reviews can tell you, even fancy cameras from well known manufacturers can have noticeably different color response.

One benefit of Rasp Pi cameras is that genuine cameras could be evaluated and characterized, but counterfeits and such will be a problem. Same is true of USB web cams, I suppose.

anfractuosity|4 years ago

Does anyone know what you call the mount with a screw that's holding the spectrometer for either the mini/larger version? I couldn't seem to see it mentioned in the readme.

I tried something similar using just blu tack to hold the spectrometer to camera, from looking at the graph from it I think I possibly used the pi noir camera, as it can seem to see up to 900+nm or so.

dljsjr|4 years ago

I worked in a laser lab w/ an optical table in college and I believe it's called a beam probe mount. If you're referring to the black powder coated aluminum block w/ the through-hole and the tightening screw.

csdvrx|4 years ago

Unfortunately, light spectrometer, not mass spectrometer.

I'd love a DIY mass spectrometer or liquid chromatograph for biohacking!

shpongled|4 years ago

I think you're going to have a very hard time doing any kind of actual (interesting) analysis on a DIY MS.

showerst|4 years ago

If you’re into lasers, Les’ YouTube channel is a goldmine.

rburhum|4 years ago

This is awesome! Is there a way to try different hardware to have a spectral range to [440nm - 2200nm]? Or am I too ambitious?

analog31|4 years ago

Color visible sensors tend to have a spectral range of 400 to around 1000 nm. (There is often an additional glass filter to block ~ 800+, which is removable).

Beyond 1000 nm, silicon becomes transparent and ceases to work as a detector, so those longer wavelengths need a detector made from another material, notably indium gallium arsenide (InGaAs) which in one form can get all the way out to around 2700 nm. Anything that gets you away from silicon chip fab also gets you away from the fab-ulous economics of silicon. InGaAs sensors are super damn expensive.

Beyond 2700, thermal imaging cameras and the like use even more exotic sensor materials.

An alternative for those longer wavelengths is a monochromator (e.g., rotating diffraction grating detecting one wavelength at a time) and a single element detector which is cheaper than an array. If course your subject has to be sitting still for the duration of your measurement.

andai|4 years ago

What would happen to the quality if the diffraction grating spectroscope were replaced with a prism?

analog31|4 years ago

That can work too. You have to work out the range of angles that a given prism produces, not an unsolvable math problem.

forgotmyoldacc|4 years ago

$70 seems expensive for a diffraction grating, what am I missing?

analog31|4 years ago

There's very little use for a general purpose grating, since all commercial uses end up with custom gratings directly from manufacturers. So the ones that are sold in catalogs tend to be more expensive owing due to economies of scale, maintaining an inventory, and probably passing through one or more middlemen. And people willing to pay R&D prices to have something quickly drive up the price as well.