A spectrometer is a pretty common lab instrument, useful for determining the absorbance of a sample across a spectrum of light. The standard design is simple; a prism or diffraction grating to break up a light source into a spectrum and a detector to measure light intensity. Shine the light through your sample, scan through the spectrum, and graph the results. Pretty easy.
That’s not the only way to do it, though, as [Markus Bindhammer] shows with this proof-of-concept UV/visible spectrometer. Rather than a single light source, [Marb] uses six discrete LEDs, each with a different wavelength. The almost-a-rainbow’s-worth of LEDs are mounted on circular PCB, which is mounted to a stepper motor through a gear train. This allows the instrument to scan through all six colors, shining each on the sample one at a time. On the other side of the flow-through sample cuvette is an AS7341 10-channel color sensor, which can measure almost the entire spectrum from UV to IR.
The one place where this design seems iffy is that the light source spectrum isn’t continuous, as it would be in a more traditional design. But [Marb] has an answer for that; after gathering data at each wavelength, he applies a cubic spline interpolation to derive the spectrum. It’s demonstrated in the video below using chlorophyll extracted from spinach leaves, and it seems to generate a reasonable spectrum. We suppose this might miss a narrow absorbance spike, but perhaps this could be mitigated by adding a few more LEDs to the color wheel.
Very cool project
I’m curious if it can be used with non liquid samples, like say rocks? Will the setup need higher power LEDs to reflect a lot of light off the surface of the rock or what?
With a few modifications, it could be used to determine the authenticity of gemstones (if they are transparent). It is not a reflective type spectrometer.
Authenticity of gem stones is not done by color alone. Color and hardness and something else maybe. Here I think refractive index is more important than absorption/transmittance at 10 wavelengths. Even then, i would prefer vibrational spectroscopies. Could be a piece of evidence though, not trying to poo poo someone exploring the world.
There are special spectrometers for gemstones: https://www.cigem.ca/research-technology/gl-gem-spectrometer
It is not the color that is determined, but the asorbation behavior at different wavelengths, which provides information about the chemical composition.
Sorry, to me the word “color” implied visible light absorption/transmission. I understand that is improper, but this is hackaday afterall. I’m mostly aware of mineral identification, even things like crystal polymorph quantitation.
What I’m less aware of is whether or not visible light spectra can be cheated with this kind of resolution. IE does a blue topaz mostly resemble a blue sapphire? Wouldn’t things like diamond appear identical to glass (quartz, flint, and so on)? That is the point I am raising for this application.
This is pretty cute. There have been a number of designs like this over the years but the as7341 has really changed the game for these super low resolution limitted spectral range devices. What I don’t get is, why not use a single white led, isn’t that the point of the ic? Maybe I need to watch the video.
Also, the first paragraph in the article is reductionist in a way that makes this persons project seem like a rube goldberg device. There are a few more essential components to a functional spectrometer. A grating/prism and a detector is simply not enough. Layout matters, alignment matters, part quality matters, etc. Most diy spectrometers are of low quality and border on useless because they are built with a fundamental lack of optical/engineering knowledge. I hope we see that change through better education and availability of components.
The AS7341 does not have the ability to split white light into a spectrum. There are 9 photodiodes in the sensor, which are more or less sensitive to different wavelengths. Each photodiode can be read individually. On the other hand, this makes it possible to combine the spectral emission of the LEDs with the spectral sensitivity of the sensor’s photodiodes. Theoretically, with 6 LEDs and 9 photodiodes you could recostruct a possible shape of the actual spectrum with up to 54 degrees of freedom. In addition to cubic spline interpolation, I also implemented Lagrange and linear interpolation. You can plot them individually.
That is exactly my thought. The simplicity and solid-stateness is nice to have for specific tasks, but does not balance out the disadvantages of discrete characteristics of measure points throughout spectrum.
A linear CCD sensor, slot, grid and a tiny halogen lamp would be much more exact method, while reading the CCD with modern MCU full of opamps and PGA equipped ADCs is easy enough.
That is exactly my thought. The simplicity and solid-stateness is nice to have for specific tasks, but does not balance out the disadvantages of discrete characteristics of measure points throughout spectrum.
A linear CCD sensor, slot, grid and a tiny halogen lamp would be much more exact method, while reading the CCD with modern MCU full of opamps and PGA equipped ADCs is easy enough.
54 degrees of freedom sounds super cool, but if most of my DoF’s are always zero unless fluorescence is occurring, then is it really 54 DoFs? IE if I have a 550nm sensor that detects within a 20-50nm bandwidth and I illuminate with a 900nm LED, are we doing something we should be sharing with anyone else? How about the 400nm sensor pad? See what I’m saying?
I figured the point of this IC, and maybe I am wrong, was that you could illuminate with a broadband-ish spectral source and read off intensity measures of light at roughly various wavelengths. Meaning there wouldn’t be much, or possibly any, need to have different illumination sources.
Not sure that a single white LED would be much good considering they generally aren’t full, continuous spectrum. Multiple color LEDs is probably a better if not perfect approach
Yes. For a full spectrum you need a deuterium lamp for the UV spectrum and a tungsten/halogen lamp for the visible spectrum.
It’s true that the emission profile of most LED’s is not a unimodal band structure. A bimodal structure is a pretty reasonable approximation. One band near 400nm and the rest centered in the 550nms-ish as I recall. In practice though, you’d be surprised how much that really matters unless someone wishes to quantify to a high level of accuracy certain absorption modes in the valley. I don’t think for a device like this, this is a real concern though.
Although I like the authors design, and think it’s cute. I also don’t think in practice it would matter much except at two of the sensor pads (680nm and 480nm) and even then I’m skeptical it matters all that much if the device truly has 16bit readings.
“White” leds only appear to be white.
They are really a very few (3) bands of light. They fool our eyes into thinking white.
No, white LEDs are blue with broadband yellow phosphor. The spectrum is fairly wide with a dip between blue and green, peaking in blue. They are not just RGB leds
I assume you’re referring to RGB LEDs set to display “white” light, but dedicated white LEDs haven’t worked that way for a long time. The modern versions are UV LEDs with a phosphorescent chip that emits across the whole visible spectrum (when you see a little yellow square inside, that’s the phosphorescent material).
Although they’re better than old-school fluorescent tubes, and still improving, they will never quite match the black-body spectrum of a hot filament. But this is a delicate subject. For a HANDFUL of color-related technical tasks, LEDs can’t replace halogens. But there are millions of shop owners and interior design snobs and graphic designers who think they still need halogen, and they’re just plain old wrong (in a way that emits thousands of excess kg of CO2 every second).
I’m talking about non-crappy LED lamps, of course, but that’s a whole other concern.
I’m curious if it can be used with non liquid samples, like say rocks? Will the setup need higher power LEDs to reflect a lot of light off the surface of the rock or what?
What a complete mechanical overkill. Never use mechanical systems when you don’t have to. Align the LEDs close together at a distance to the hole and use a collimator lens. Way cheaper, easier, no maintenance and no risk of failure…
What happens to light rays that do not strike at a 90° angle to the vertical axis of the lens?
Hopefully, you will not find out that the rays emitted by the LEDs are not striking at a 90° angle to the internal lens of the LEDs anyway. And that the LEDs will not emit a single wavelength. But you already found out that the sensor’s photodiodes have multispectral sensitivity. So why should this consistent error (which is addressed by calibration) matter more than sporadic random errors that arrive from inaccurate positioning, beside all those other risks of failure and wear.
Of course, the LED itself shines in all directions, but the best result, which is the same for all LEDs, is achieved when the LED, which itself has a converging lens, is aimed directly at the sample. With a general converging lens you have a lot of deviations and it is a nightmare to adjust it so that the beam intensity is more or less the same for all LEDs. Furthermore, the lens would have to be anti-reflective. Yes, LEDs do not emit a single wavelength. No light-emitting body does this. As for failure and ware, that’s another apparent argument that makes a mountain out of a molehill. All components can simply be replaced if a failure occurs in 100 years.
That’s a good idea. I think if I were designing this I would put a 400nm LED and a white LED behind a 1 dollar plastic PMMA lens to focus it to to the aperture onto the IC. Might not even need a lens if you couple them close enough. Drop the motor rig, even though I think its super cute. This would reduce the profile of the instrument tremendously, probably have to add lead weights or US 5 cent pieces too it so it doesn’t fly off the counter when you plug a wire in. Would reduce cost by probably a factor of 2-3 and improve ergonomics, points of failure, and maintenance drastically. Simple is good, but at the same time, I think this is very fun and worth celebrating.
If a white LED is used, it could also be used as a colorimeter https://en.wikipedia.org/wiki/Colorimeter_(chemistry)
So you have a photometer, (kind of) spectrometer and possibly a colorimeter.
The converging lens sounds good in theory and I initially considered it, but abandoned it after a few experiments. The LEDs can be mounted very easily and in large numbers on a PCB. If you need to position them differently, you need a complex device to align each LED:)
With this IC can you not read off each wavelength in the 10 channel sensor through the MUX? I thought that was the point of this IC was that you did not have to use different illumination sources to get information about multiple wavelengths at once.
This device to me appears to be a colorimeter using a multispectral sensor which is my main point of confusion.
The datasheet says it’s a spectral sensor, but it’s not. The 9 photodiodes have different filters so they have different sensitivities to different wavelenghts. It’s just a very precise color sensor. In photometer and spectrometer mode I just use one photodiode (labeled “clear”) in the moment. When using it as a colorimeter, you can just use a white LED and read out all 9 photodiodes. Objective color measurement with a colorimeter can also be carried out with a multi-channel color sensor. The colorimeter often uses chemical color reactions through a reagent that is specific to the substance to be detected (only qualitative, not quantitative). During my research at the beginning of the project, I got the impression that the differences between photometers, spectrometers and colorimeters are often not well defined.
Replying to your reply not myself because we’ve hit the discussion limit apparently.
Interesting. I guess I’d have to know their responses and line shapes to say anything else. It’s possible the intensity of the light would need to be tuned or that the sensor would need calibration to get good use of the multispectral aspect of the sensor.
It’s true you’ll see people use colorimeter and photometer almost interchangeably at times. Spectrometers typically refer to something different, but devices like these and similar ones to them (wavelength resolution >= 20nm) tend to push that definition around. I wouldn’t worry much about terminology personally. Some people would be offended by calling this a spectrometer, other’s would love to have one on their bench. People are weird and their language preferences weirder.
Interesting project, thanks for sharing your experiences with this IC. Your project makes me want to buy one to play with. Unfortunately I already have several home brew full spectrometers, colorimeters, etc. My spouse might not like me buying more things like this. I am excited for future iterations
You could animate offset on a sine in the x axis – like a couple times on startup to viz any spikes.
If you have to go mechanical why not use a motorized defraction grating or prism to split a continuous source and measure that old bench spectrometers do.
Why not use… If we just keep repeating the same things over and over again, we will never gain new insights. It’s an experimental design, not more, not less.
That would require significantly more optics, care, and cost.
This is the mathematical equivalent of “I’ll just pretend it’s smooth in between my measurements”. Instead of having a few data points which provide some information within an error that can be reasoned about, you get a nice smooth curve that lies to you.
Exuse me, but that is nonsense. Spline interpolations provide useful curves and approximation properties (Runge phenomenon).
If you have some knowledge and expectation of the curve, yes. Like a trajectory in a gravitational field. Between measurements in absorption spectra? This is a quantum mechanical phenomena. The dispersion causes large variations near absorption lines. Isn’t it best to avoid the temptation to connect the dots and just show the data points? Or maybe a bar graph? Doesn’t he spline fit ignore and obscure the physics?
I can see some value in using correlation with a library of spectra but I think this would only use the discrete data points.
What do you understand mathematically by the terms “knowledge” and “expectation”? For example, does linear regression require other “knowledge” besides the measured data points? (Answer: It does not.)
Interpolation can be misleading with spectrometry in particular. This is what’s really seen in the Runge phenomenon. In a blind measurement, you do not know which interpolant best overlaps the actual signal, only that it probably overlaps in some places. It only gets more precise with more points and orders (at which point you have better resolution).
You may be able to constrain the possible spectrum based on known properties of the illumination source. There’s some description of this in the documentation for this sensor. But real spectra are only as precise as the detection bandwidth.
A sharp emission line is a good example though, and occurs often in spectrometry of certain systems. A wideband detector can tell you a line exists within the bandwidth but not much else. A well characterized, overlapping set might give a better idea where it is in between, if you know it’s narrow. Neither faithfully reproduces the wavelength or linewidth in the presence of fine structure.
The use of trend lines only makes sense when based on some other information/model of the system to analytically justify them. An interpolant doesn’t add information besides a potentially misleading guide to the eye over observing the raw sensor response, adjusted for the spectral response measured with more precise devices.
I wonder why there is always talk of a “misleading guide to the eye”. Does this come from the description that cubic spline interpolation produces a smooth curve, similar to drawing a curve by hand through a few points? Cubic spline interpolation is a part of approximation theory and of course provides approximations beyond the support points. What cubic spline interpolation cannot do is to predict a local maximum or minimum between two interpolation points. To say in general that trend lines only makes sense when based on some other information/model of the system would have to be explained by you in more detail. Btw, as a mathematician, I only know the term “trend line” from Excel. Linear regression is the also a trend line and make no sense too withou additional information beside the measured data points?
I don’t have much to add beyond what’s said. Interpolants in a scientific setting without a model-based reason have a mathematical basis and meaning, but not an observational or scientific one. (A linear trend having particularly obvious interpretation.)
For a spectrometer in particular, and I have used many and designed a few, that’s fine in some contexts. Just not in others.
Meaning no disrespect! It’s a fine project. I’ve also been adapting this sensor as a tiny, handheld colorimeter and low res spectrometer for fun. It’s a slick unit.
Using different illumination sources like this is clever and might be used in interesting response measurements for certain samples.
And btw., I’m not the first one using cubic spline interpolation in this regard.
Interpolational and smoothing cubic spline for mass spectrometry data analysis:
https://www.sciencedirect.com/science/article/abs/pii/S1387380615003991
Tungsten anode spectral model using interpolating cubic splines:
https://pmc.ncbi.nlm.nih.gov/articles/PMC3985923/
etc.
I had this idea like 10 years ago. When ams came out with that sensor I even tried to get them to send me a sample since I was a broke college student. I was starting from scratch on learning electronics to make it happen though and never quite got there. Happy to see that it works at least.
Did you consider using lamps and small band-pass dichroic filters on the wheel?