AS7343 - UNO R4 WIFI - no spectral data

I am using the Arduino IDE and SparkFun Example 1 to read basic colors. I had to modify SparkFun_AS7343.h to specify Wire1 to use I2C on the QWIIC connector. Now the AS7343 appears to be initializing correctly as every function before the actual reading of data responds correctly. After that I get “Failed to read spectral data”. So I tried several other examples and get the same results. I have tried everything I can think of and leaning towards a bad sensor.

Any help would be appreciated.

Thanks!

Maybe try adding a small (150-200ms) delay after the smux line

Thanks, I’ll try that.

1 Like

I have added delays in several different places in the code. That didn’t help. Then I tried a few methods like reset(), enable and setWaitTime(), getDeviceAddress(). Every function seems to work except reading spectral data.

Thanks!

Let me try to find my R4 and test, hang tight!

I decided to try the AS7343 on my new UNO Q. I resisted because the Arduino App Lab didn’t included libraries for the AS7343 and I didn’t feel like moving them over manually. I got the UNO Q to work in the Arduino IDE.

I am now getting spectral readings!

They are inconsistent and variable without moving the sensor but at least I’m not getting the “Failed to read spectral data” error. So it appears it’s something weird with the R4 Wifi board. I would be interested if you can figure that out!

Now that I’m getting readings I can pursue getting more stable readings. I’ll probably start with more of the examples.

Thanks for your help TS!

I got to thinking about why it may not be working on the R4 and figured it has be something with I2C. I found out there are two valid clock speeds for I2C on the R4: 100KHz and 400KHz. I also read that 400Khz was default so I tried Wire1.setClock(100000) and there was no change. Then I decided to try to force 400KHz and it works! So maybe it’s actually defaulting to 100KHz or it needs to be explicitly set when using Wire1, I don’t know.

Anyway, problem is solved! :slight_smile:

1 Like

Odd - awesome, good detective work!