27 May 2018
I received the pcbs with the corrected design yesterday and put one of the boards together today. Assembly was straightforward, much like the first time, since the board layout didn't really change much. The 850 and 940 nm leds got smaller and I properly connected the AS72651 sync pin (AKA ADO) to the AS72652 reset pin, according to the data sheet schematic, which apparently in this instance is correct.
I loaded the firmware onto the 4 Mbit SPI flash (version 1.2.7, still the same as the one on the AMS download site), power cycled the spectrometer and was happy to see the rgb led blink once and go out, as it should.
I am still having trouble getting the device to respond to I2C commands and it is basically unusable in I2C mode. I have asked AMS if there might be a reason for this, and I will figure this out eventually. I2C mode is nice since each of the 18 channels can be queried individually and I2C is a more natural way (at least for me) to interface the spectrometer with a microcontroller.
I was able to get the spectrometer to work in UART mode using the AT commands. This is useful to check for basic function; I was able to to verify that all three sensors are functional. It is convenient to have a single command (ATDATA) that returns all 18 of the data channels, although the ordering of the data is not straightforward. There is another command (ATXYZR) which is supposed to output the counts in order of wavelength but I found this not to be the case using the calibration plate as a reference. But ATDATA does seem reliable, so I did a little bit of testing just to see what the new spectrometer could do.
Using the bright 470 nm led on the calibration plate I measured a strong signal peaking at 460 nm with a strong side band at 485 nm, just as I should. I turned on the broad-band 5700 K 90 CRI source on the spectrometer board for the next two measurements. First, I pointed the spectrometer at white paper, and see a spectrum characteristic of the luxeon Z ES led output with a narrow peak at ~450 nm and a broad peak at ~600 nm. In other words, white paper reflects most of the source light without strongly absorbing any particular wavelength so the reflected spectrum looks like the emitted spectrum. There is the odd exception of the peak at 940 nm, which could have been my finger in the field of view. (I will have to be more careful when I start using the spectrometer in earnest!)
Next I turned the spectrometer with the same 5700 K 90 CRI source on to a knitted cap I use as a bowl on my work bench. The material is made of dark blue yarn with coarse knitting, so it absorbs a lot of the light due to its rather porous nature and absorbs mostly in the red reflecting weakly in the blue, in this case at ~460 nm with a little bit of a bump in the green at 560 nm and maybe one at 705 nm.
I think best results using the spectrometer will be had with the spectrometer mounted inside some sort of container (like a toilet paper tube) to limit stray light and to allow the spectrometer to be placed over objects to be measured.
I also found it tiresome to constantly enter ATDATA into the serial monitor whenever I wanted to record a spectrum so I will likely program the button on my Dragonfly development board to take a spectrum measurement on pressing. This will be very convenient.
Lot's more testing to do yet. I need to create some kind of fixture to allow more reliable testing instead of holding things in my hands. I want to develop some more automated way to plot the spectra. I need to understand how to optimize gain and integration times, etc.
I also want to find out if the broad band source is sufficient to distinguish between different materials (with less extreme differences than white paper and dark blue yarn!) such as salt and sugar, for example. I'd also like to sort out the I2C interface on this device.
But overall, I am happy with progress to date. I now have a small, inexpensive spectrometer whose utility I can start to assess.