Strange behavior of AS7265x on results of common lamps in comparison with Sekonic

Hi.

I’ve been trying to make the AS7265x sensor work, tried 2 libraries, many tests, comparison with Sekonic C-800, and this is the spectrum I get when an incandescent lamp shines on the diffuser (I previously checked that it just attenuates a bit the same way in every wavelength) and then to the sensor, which is close.

incandescent.png

I also tried with other lamps, and they work better. When there’s infrared light added, it doesn’t respond well.

I also uploaded the same firmware (of the sensor) to it, but nothing really changed. I’m sure it uploaded because the program read the data that was sent as well. I’m waiting for Osram to respond with the firmwares to try once again.

This is the LED lamp I also test on. Just the channel 9 is very far away from the point it should be.

(Orange is what the theory said using Sekonic C-800, and blue is what I measured).

LEDlamp.png

Does anyone know what could be? If I try to manually calibrate and put gains outside of the library, it’s impossible to obtain a reasonable calibration, because one channel requires gain for one lamp, and attenuation for the other lamp, only few channels require both attenuation or gain (which is doable).

The part in the code that interferes with the sensor is this:

On the setup:

 // Once the sensor is started we can increase the I2C speed
  Wire.setClock(400000);

  // There are four gain settings. It is possible to saturate the reading so don't simply jump to 64x.
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  // sensor.setGain(AS7265X_GAIN_1X); // Default
  // sensor.setGain(AS7265X_GAIN_37X); //This is 3.7x
  // sensor.setGain(AS7265X_GAIN_16X);
  sensor.setGain(AS7265X_GAIN_64X);
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  // There are four measurement modes - the datasheet describes it best
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  // sensor.setMeasurementMode(AS7265X_MEASUREMENT_MODE_4CHAN); //Channels STUV on x51
  // sensor.setMeasurementMode(AS7265X_MEASUREMENT_MODE_4CHAN_2); //Channels RTUW on x51
  // sensor.setMeasurementMode(AS7265X_MEASUREMENT_MODE_6CHAN_CONTINUOUS); //All 6 channels on all devices
  sensor.setMeasurementMode(AS7265X_MEASUREMENT_MODE_6CHAN_ONE_SHOT); // Default: All 6 channels, all devices, just once
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  // Integration cycles is from 0 (2.78ms) to 255 (711ms)
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  sensor.setIntegrationCycles(49); // Default 50*2.8ms = 140ms per reading
  // sensor.setIntegrationCycles(1); // 2*2.8ms = 5.6ms per reading
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  // Drive current can be set for each LED
  // 4 levels: 12.5, 25, 50, and 100mA
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  // White LED has max forward current of 120mA
  sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_12_5MA, AS7265x_LED_WHITE); // Default
  // sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_25MA, AS7265x_LED_WHITE); //Allowed
  // sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_50MA, AS7265x_LED_WHITE); //Allowed
  // sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_100MA, AS7265x_LED_WHITE); //Allowed

  // UV LED has max forward current of 30mA so do not set the drive current higher
  sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_12_5MA, AS7265x_LED_UV); // Default
  // sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_25MA, AS7265x_LED_UV-bad); //Not allowed
  // sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_50MA, AS7265x_LED_UV-bad); //Not allowed
  // sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_100MA, AS7265x_LED_UV-bad); //Not allowed

  // IR LED has max forward current of 65mA
  sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_12_5MA, AS7265x_LED_IR); // Default
  // sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_25MA, AS7265x_LED_IR); //Allowed
  // sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_50MA, AS7265x_LED_IR); //Allowed
  // sensor.setBulbCurrent(AS7265X_LED_CURRENT_LIMIT_100MA, AS7265x_LED_IR-bad); //Not allowed
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  // The status indicator (Blue LED) can be enabled/disabled and have its current set
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  // sensor.enableIndicator(); // Default
  sensor.disableIndicator();

  sensor.setIndicatorCurrent(AS7265X_INDICATOR_CURRENT_LIMIT_1MA);
  // sensor.setIndicatorCurrent(AS7265X_INDICATOR_CURRENT_LIMIT_2MA);
  // sensor.setIndicatorCurrent(AS7265X_INDICATOR_CURRENT_LIMIT_4MA);
  // sensor.setIndicatorCurrent(AS7265X_INDICATOR_CURRENT_LIMIT_8MA); // Default
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  // The interrupt pin is active low and can be enabled or disabled
  //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  // sensor.enableInterrupt(); // Default
  sensor.disableInterrupt();

On the loop:

if(sensor.takeMeasurements())// This is a hard wait while all 18 channels are measured
  {
    printf("Error: too long to answer");
  } 
canal_espectrometro[0] =  sensor.getCalibratedA();
  canal_espectrometro[1] =  sensor.getCalibratedB();
  canal_espectrometro[2] =  sensor.getCalibratedC();
  canal_espectrometro[3] =  sensor.getCalibratedD();
  canal_espectrometro[4] =  sensor.getCalibratedE();
  canal_espectrometro[5] =  sensor.getCalibratedF();
  canal_espectrometro[6] =  sensor.getCalibratedG();
  canal_espectrometro[7] =  sensor.getCalibratedH();
  canal_espectrometro[8] =  sensor.getCalibratedR();
  canal_espectrometro[9] =  sensor.getCalibratedI();
  canal_espectrometro[10] = sensor.getCalibratedS();
  canal_espectrometro[11] = sensor.getCalibratedJ();
  canal_espectrometro[12] = sensor.getCalibratedT();
  canal_espectrometro[13] = sensor.getCalibratedU();  
  canal_espectrometro[14] = sensor.getCalibratedV();
  canal_espectrometro[15] = sensor.getCalibratedW();
  canal_espectrometro[16] = sensor.getCalibratedK();
  canal_espectrometro[17] = sensor.getCalibratedL();
  printf("\n\n");
  for (int i = 0; i < 14; i++)
  {
    printf("%f\n", canal_espectrometro[i]);
  }
delay(3000);

The other 4 channels are infrared and doesn’t matter to my use.

The 14 channels were ordered in ascending order of wavelength, as the code shows.

I’m using a diffuser I bought on internet for lightning, it’s about 1 mm thick and covers the 3 sensors with ease. It has a milky appearance and it’s not very light blocking.

I’m using a box with the lights inside on top, they shine down on a part where I put the sensor. There is only a small error (when I turn off the lamps) from the ambient light, which is few counts, less than 3 counts (only penumbra from the ambient). And for when the lamps are on, I check with the Sekonic and it seems no different than what it should be, it’s the lamp spectrum in any position.

I verified the diffuser measuring the incandescent light with the Sekonic in the same spot with and without the diffuser, and ran this app https://apps.automeris.io/wpd/ to get the data from image and saw it was nearly only one value of attenuation for all frequencies. And even if it was the diffuser, it’s the same for both lights, and I take care to don’t touch it when measuring the 2 lights (one each time) so it won’t change position. If it was something with the diffuser, it would appear for both lamps.

There isn’t any material inside that could be reflecting off the light, it’s a wood box, it probably has some particular spectrum, but Sekonic shows only the almost perfect incandescent spectrum with temperature of about 2450 K, and CRI of about 98.X.

I can show you the data I collected (that I didn’t show yet) if you want, as how I theorized how much each channel should read, based on the gaussian curve of each channel, the data I got from Sekonic, and the calculation (integration) of the spectrum for each channel.

It might be just the inherent limits https://cdn.sparkfun.com/assets/c/2/9/0 … asheet.pdf (-/+ 10 nm) if you’re already using calibrated channels…I do notice that all of the graphs in the datasheet state they are normalized, so it looks like they expect backend data correction?

You could also try swapping to continuous mode and see if that helps