AS7331 returns same values each time

Just got the AS7331 Sparkfun Sensor and when I call the read sensors functions with the example sketches, I get the same return values each time.

UVA:2.66 UVB:2.95 UVC:1.30

It seems like this problem was reported on this thread but without resolution.

Note that I get exactly the same values returned as what they reported, and it seems like this happens in other posts as well.

I’ve tried this on two different AS7331 sensors that I just purchased.

I’m running this on an ESP32 Lolin D32, and have tried two different ESP32s with the same result. The same ESP32s can use the AS7265x Spectral Triad sensor just fine.

I’ve tried both these sketches with the same result

Example01_Basic_OneShot
Example02_CONT_Mode

Here’s my breadboarded setup. Note running interrupt to pin 15 and the software code works fine.

And thoughts?

It sounds like a defective sensor; if purchased from us fill out the form at www sparkfun com/returns to get a replacement unit sent out

Ordered through Amazon, so you think both sensors are defective, then?

I missed that you had 2

Are you using it in one-shot mode? Try one of the others if so

I tried both these sketches, one shot and continuous:

Example01_Basic_OneShot
Example02_CONT_Mode

I wonder if there was a bad batch from Amazon; I’d assume that other thread/case was resolved by the replacements but I’m not certain

I’d suggest getting replacement units and trying those

yes, I authorized a return from them.

I’m going to try the mini version this time around:

Looks to be the same sensor with a smaller profile. I don’t need the Qwiic connectors for what I’m doing.

Great - circle back if those give any issues!

Hmmm…both the 2 new sensors aren’t working, either.

scratching my head…thoughts here?

Darn! Is it precisely the same issue (strange but identical output)?

same issue.

I’ll try it with an Arduino Uno and see if I can replicate it there.

It not working with the ESP32 chips that I have, I guess could be a problem with some library somewhere, though other SparkFun sensors have been fine with my ESP chipset.

That, and try updating your ESP libraries as well :smiley:

same problem with the Arduino Uno.

The ESP32 libs are up to date, so are the AS7331 (2.2.0), and the SparkFun Toolkit (1.0.0).

Btw the Example02_CONT_Mode.ino doesn’t seem to trigger interrupts on the Arduino Uno for some reason, maybe because it’s looking for 3.3v, not 5.0V?

but the Example01_Basic_OneShot just spits out the same garbage values that I saw with the ESP32.

stumped over here…

Frustrating! It might be time to create an issue here GitHub · Where software is built detailing what’s going on and the testing already done (give library details and such like you did here) and hopefully we’ll hear back shortly

ok.

it is here:

1 Like