Skip to content

AS7331 returns same values each time #12

Closed
@scottkildall

Description

@scottkildall

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.

Serial Output:
AS7331 UV A/B/C Command (One-shot) mode Example.
Sensor began.
Set mode to command.
UVA:0.00 UVB:0.00 UVC:0.00
UVA:2.66 UVB:2.95 UVC:1.30
UVA:2.66 UVB:2.95 UVC:1.30
UVA:2.66 UVB:2.95 UVC:1.30
UVA:2.66 UVB:2.95 UVC:1.30
UVA:2.66 UVB:2.95 UVC:1.30
UVA:2.66 UVB:2.95 UVC:1.30

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 four different AS7331 sensors that I just purchased, with very similar results — sometimes an initial different value, but is always comes back to these three settings: UVA:2.66 UVB:2.95 UVC:1.30

I purchased the two sets of sensors (2 each) in two different purchases, and two are the Mini Spectral Sensor, two are the regular one.

I’m running this on an ESP32 Lolin D32, and have tried two different ESP32s with the same result. Note: 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.

Libraries Used
esp32 by Espressif Systems
3.2.0

(note, I also tried 3.1.3)

SparkFun AAS7331
2.2.0

SparkFun Toolkit
1.0

I also tried it with the Arduino Uno, and the same results.

Wiring snapshot:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions