AS7263 NIR sensor I2C ERROR

Hi,

I assembled the AS726X to a Qwiic and a redboard. Based on the hookup tutorial. However, when I tried to run the AS726X example code, it displays ‘I2C ERROR’ in the serial monitor.

Then I use codes to scan I2C, it returns no connection. But if I tightly push the AS726X to the Qwiic, the scanner shows its port is at 0x49. But if I leave it there, the connection failed again.

Is there any way to solve the issue? I bought two wires, none of them works.

Thanks,

Yang

Are you using the AS7265x found on this [board?

Or is there a different product SKU that you’re using in the AS726 family?](SparkFun Triad Spectroscopy Sensor - AS7265x (Qwiic) - SEN-15050 - SparkFun Electronics)

Hi,

I bought the red board(DEV-13975), Qwiic shield board(DEV-14352), the AS7263 NIR sensor(SEN-14351), two Qwiic cables(PRT-14427), and the USB cable to assemble all of them based on the tutorial. However, when I run the NIR sensor example code, it returns ‘I2C Error’. I used Wire.beginTranssmission(1~127), and Wire.endTransmission() to scan the devices, it returns NACK on transmit address.

Any suggestions? Do they have connection issues?

Thanks,

Yang

My NIR sensor is AS7263(SEN-14351), which is bought from SparkFun.

Can you please verify if you’ve tried using the code below at all?

#include "AS726X.h"

AS726X sensor;

void setup() -{
  sensor.begin();
}

void loop() -{
  sensor.takeMeasurements();
  sensor.printMeasurements();
}

*NOTE: before compiling the above code, remove the (-)'s infront of the {. This was done becasue we have a small bug concerning this character.

There is no printMeasurements() in the library. And the takeMeasurements() does not return any thing.

My apologies. Can you tell me which of the example codes from the [hookup guide that you are using?](https://learn.sparkfun.com/tutorials/as726x-nirvi?_ga=2.211882385.407553103.1582559371-2114068872.1578439588)

I combined the codes of I2C scanner and example 1. Once the scanner found the device, it will perform the sensor.takeMeasurementWithBulb(). The codes work when I slightly move the connection pins between the shield and the red-board. But if I leave them there, the connection seems lost. So I think that caused by the hardware connection between the shield and the red-board.

I have some Serial terminal prints:

15:37:34.285 → Scanning…

15:37:34.285 → No I2C devices found

15:37:34.318 →

15:37:34.790 → Scanning…

15:37:34.823 → No I2C devices found

15:37:34.823 →

15:37:35.323 → Scanning…

15:37:35.323 → No I2C devices found

15:37:35.357 →

15:37:35.823 → Scanning…

15:37:35.823 → No I2C devices found

15:37:35.861 →

15:37:36.365 → Scanning…

15:37:36.365 → No I2C devices found

15:37:36.404 →

15:37:36.860 → Scanning…

15:37:36.894 → No I2C devices found

15:37:36.894 →

15:37:37.386 → Scanning…

15:37:37.386 → No I2C devices found

15:37:37.423 →

15:37:37.873 → Scanning…

15:37:37.910 → No I2C devices found

15:37:37.948 →

15:37:38.430 → Scanning…

15:37:38.430 → I2C device found at address 0x49 !

15:37:38.837 → Reading: R[16059.89] S[5897.50] T[1354.40] U[800.81] V[917.49] W[593.11] tempF[77.0]

15:37:39.038 → done

And I also want to ask what those number means. Are they wavelength?

Reading: R[16059.89] S[5897.50] T[1354.40] U[800.81] V[917.49] W[593.11] tempF[77.0]

I just know the temp is the temperature.

Thanks,

Yang

I would definitely check those shield connections, but the code and sensor seem to work.

Those values can be found in the [Datasheet on page 11. They do appear to be different wavelengths and the units are counts/(uW/cm^2).](https://cdn.sparkfun.com/assets/learn_tutorials/1/4/3/AS7263_Datasheet.pdf)

Yes, the codes definitely work.

I’m wondering if there any ways I can convert the NIR sensor output counts/(uW/cm^2) to wavelength (nm)?

Those channels are specific to certain wavelengths. You could state in your print statements the wavelength and calculate a confidence value or intensity count to show which wavelengths are most prevalent.

Is there any materials I can look into for how to compute the confidence value or intensity count?

Unfortunately, we don’t have anything available on our end.