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