Color sensor chip

Here’s an interesting device that might be fun to experiment with… the ams as7341 color sensor chip.

It senses light intensity in eight bands across the visible spectrum. From the data sheet:

One intended application is to put it next to the camera in a smartphone and sense the ambient light, to set the white balance more accurately without having to estimate it from the camera image.

It’s available on a Adafruit breakout board for $16, or this dfrobot one. It’s an I2C sensor so should be very easy to hook up to any Arduino, Raspberry Pi, or other microcontroller.


Yes, I am using a similar chip from ams, the AS7261, to read illuminant/reflected CCT and Duv on location. With a controller and small battery my hacked package is about the size of a full USB memory stick. Only drawback is that it does not work well as-is and requires calibration, which introduces the need to have good reference sources at either end of the spectrum.

1 Like

Does that output values that you can enter directly into darktable / Rawtherapee / etc to set the white balance correctly?

What do you use as a reference to calibrate it?

The AS7261 in theory measures XYZ natively so ideally you can get xy, CCT, Duv and any other related metrics from it. CCT should be what it is. On the other hand I have no idea what the units of the tint slider are in RawTherapee/DT/LR etc. - or why they are expressed as a ratio. Easy enough to produce once one understands how they relate to XYZ. Normally xy chromaticity maps to CCT and Duv, the latter being distance above (positive) or below (negative) the Planckian locus.

For calibration I used the two typical reference illuminants: a halogen lamp and an overcast day, both read with an Xrite Color Munki/i1Studio. The design of the chip is less than ideal because its aperture provides uneven shading so an appropriate diffuser is required.


1 Like

This is the AS7262 before calibration and without the diffuser.

1 Like

Oooh, nice! I would not be surprised if this kind of chip is in the e.g. spyder-colorimeters.

And with this you mean a power-calibration so which wavelength specific flux represents which signal level and not whether the center wavelengths of the pass-bands are off by a nanometer or two, correct? Or both?

Relative rather than absolute calibration. For CCT and Duv we just need X, Y and Z to be in the correct proportions given an illuminant.

Looking at the idealized plot in the OP you can see that some ‘color’ channels are more sensitive than others, so that if we actually had an illuminant that supplied the same power per small wavelength interval (Se) we would not get the same count per channel out of the chip. In addition to that, from what I can tell the sensitivity is not nearly as well behaved and predictable as shown. Same with the chips I have been playing with, that read wider bandwidths (e.g. XYZ)

So the idea is to provide a few reference illuminants to compare to chip readings and come up with a correction matrix or similar. So far I haven’t ventured that far, limiting myself to the two ends of the spectrum and interpolating. If one plays with WB sliders one realizes that accuracy in CCT is not critical, plus/minus a couple of hundred K is fine, though I think one could get pretty close with my setup. This is the CCT of my screen

And this is from a warm LED bulb, spec’d at 2700K:

1 Like

That plot is probably a measurement of just the color filters…‘spectral responsivity relative to F8’ sounds suspiciously like not the sensor+filterstack responsivity.
By comparing to standard illuminants, you kind-of come closer to an absolute calibration. And then the X,Y and Z ratios will have the right proportions. Pretty amazing little thing that you built there. Would sell for a lot of money in the cinema-world. Heck even as a photographer I would like to have that in a lightmeter…

1 Like