28 May 2018
Like a kid with a new toy, I could not resist testing the spectrometer out on various targets.
First, I soldered headers onto the board and mounted it on a breadboard along with a small Arduino-programmable (Ladybug) STM32L432 MCU:
I tested out the led controls a bit more and found that by default the top and bottom source leds are off. So I played around with turning them on and testing whether the spectrometer could "see" them. I think the 850 nm leds I bought simply do not work. I have never gotten a signal from the 850 nm when the led was supposed to be on. The 940 nm led does work and I experimented with different current drives up to 50 mA. My MCU board has a 150 mA LDO so I don't want to press things too much. The broad band (5700 K, 90 CRI) led (yellow square thing on the AS7265X board) defaults to 100 mA as far as I can tell. I must say, the AT commands are somewhat cryptic and I will have to do a lot more experimenting to make sure I understand how to use the led sources correctly. It would help if I could actually see the leds!
I programmed the button to turn on the broad-band source, then take a spectrum, then turn off the broad-band source, kind of like flash photography. It sort of kind of works, but there are latency issues due to the relatively slow serial interface and I don't always get a clean 18-channel spectrum. Sometimes the leading or lagging channel is missing or mixed up with OKs and other AT command activity. But it is usable, and I can simply position the breadboard over an object, press the button like taking a picture, and read off the 18-channel data from the serial monitor. Still a bit clunky but eminently usable.
I did a little more measuring with this rig held a few centimeters from each object:
The white paper spectrum is again basically the spectrum of the broad-band source (plus the 940 nm led I think). When applied to various household objects, the absorption of the objects changes the spectrum recorded by the spectrometer. So flourescent green paper absorbs strongly in the blue but not much elsewhere. The banana and red pepper absorb strongly in the blue and between ~600 and 700 nm. Definitely different and distinguishable.
I think the right way to plot such data is by correcting for dark current and normalizing by the white paper spectrum. We basically want to know how much of the source light is reflected back, and it makes sense to plot the reflected spectra of our test object as a ratio to the reflected spectra from a quasi-ideal (white paper) reflecting object. The dark current is zero, at least that is what I measure with the broad-band illumination off at these gain (2) and integraton time (100 ms) settings.