Sparkfun AS7263 NIR spectral sensor

I just can’t seem to get the onboard led to turn on, isn’t the onboard led supposed to be my main source of illumination for the organic material that I’m testing , I’m using an esp32 with this, I just need to use it on a banana and get the values for the six wave lengths, so I can know the various levels of organic absorbance for visible and NIR light

From the photo, it appears that the header pins were not soldered properly to the sensor board. I would not expect the sensor to work at all.

See this guide: How to Solder: Through-Hole Soldering - SparkFun Learn

1 Like

this is the board’s under

The pins have not been installed correctly on the sensor board. The black insulating strip should be in direct contact with the underside of the PCB, and the solder applied to the pins protruding through the vias on the top side.

My guess is that even if the solder connections are OK, the pins are too short to make good contact with the protoboard.

Rather that removing/resoldering, use a QWIIC connector cable instead.

Done, Hopefully didn’t damage the board :sweat_smile:

Shoot, that’s what happened: The pin’s headers are back-to-front. You might possibly reach the pins with female jumpers in place of your Yel, Purp, Blue, etc (IOW, jumper to the stubby pins on NIR and bypass the protoboard), not very well or reliably but those jumpers never are.

If you decide to resolder it, getting the old header off might be a chore, especially compared to how easy is would have been to install. I certainly recommend not making any attempt to reuse the header, mostly to make it easier to remove but also because it will have solder on the socket side. You might be able to tug the black plastic off the pins and leave yourself six really easy things to desolder instead of one hard thing. If not, see if you can carefully & gently cut/sever the plastic header at the pinch points, that’s what they’re for. In any case, take good time & care to not tear or overheat, both can occur very easily.

Edit: We doubled! Look ok, I’d give those spheroid blobs on the left another run with the solder gun.

Made an attempt, I believe it still works, I used new headers

The center joints below are cold solder joints, and should be touched up. The one on the lower left has too much solder, and may also be cold in the interior.

Either your solder pencil is not hot enough or you are not heating the joints correctly (the pencil tip must make contact with the header pin to make sure it heats up sufficiently). What type of solder are you using?

Capture

noted, do you normally make use of this sensor

I’ve fully made all the corrections , thanks alot, Do you know how I can get the on board led to turn on

Does the ‘power’ LED light up now when wired up? Share a new photo of the new setup

Please verify that you can communicate with the board by running the I2C address scanner program, and that the correct I2C address is identified.

Then, try collecting data from the board. Point it at a dark background and an incandescent light bulb to check.

Something looks ‘off’ with your board. Did you get it from sparkfun or somewhere else?

1 Like

The only thing that light up when I’m connected to my computer is the esp32 , although I’m using the UART pins and not i2c cos the program couldn’t detect any i2c devices but when I switched to pins 16 and 17 it started reading (although the on board LED is still the main source of light I desperately need)

Here’s my code =>

#include <Arduino.h>

// — UART/Hardware Pin Definitions —

// The AS7263 will be accessed via the ESP32’s second hardware UART (Serial2).

// SDA connects to RX2 (GPIO 16). SCL connects to TX2 (GPIO 17).

#define SENSOR_TX_PIN 17 // ESP32 TX2 → Sensor SCL

#define SENSOR_RX_PIN 16 // ESP32 RX2 → Sensor SDA

#define BAUD_RATE 115200 // Default UART speed for AS726X

// — Time-Based Measurement Configuration —

const int READINGS_TO_AVERAGE = 5; // Using 50 for fast acquisition and good averaging

const unsigned long MEASUREMENT_INTERVAL_MS = 1000; // Updated to 1 second (1000ms) for frequent logging

unsigned long lastMeasurementTime = 0; // Tracks the last time a measurement was taken

// — AS7263 Virtual Register Definitions (Derived from AS726X.h) —

#define AS72XX_SLAVE_STATUS_REG 0x00

#define AS72XX_SLAVE_WRITE_REG 0x01

#define AS72XX_SLAVE_READ_REG 0x02

#define AS7263_R_L 0x08 // R channel (16-bit)

#define AS72XX_SLAVE_TX_VALID 0x02

#define AS72XX_SLAVE_RX_VALID 0x01

#define AS726x_CONTROL_SETUP 0x04

#define AS726x_LED_CONTROL 0x07

#define AS726x_INT_T 0x05

#define POLLING_DELAY 5 // Amount of ms to wait between checking for virtual register changes

#define TIMEOUT 3000

// — Function Prototypes —

uint8_t virtualReadRegister(uint8_t virtualAddr);

void virtualWriteRegister(uint8_t virtualAddr, uint8_t dataToWrite);

uint16_t getChannelValue(uint8_t baseRegister);

bool waitForDataAvailable();

void takeAveragedMeasurement();

void triggerSingleShotMeasurement(); // Explicitly triggers the measurement

// — Core Communication Functions (UART Bridge) —

// Reads a single 8-bit value from the sensor’s virtual register via the UART bridge

uint8_t virtualReadRegister(uint8_t virtualAddr) {

uint8_t status;

// 1. Wait for RX_VALID (meaning we can write to the slave)

for (int i = 0; i < TIMEOUT; i += POLLING_DELAY) {

// We read the status register via Serial2.read() until the slave is ready (RX_VALID)

status = Serial2.read(); 

if (status & AS72XX_SLAVE_RX_VALID) {

  break; 

}

delay(POLLING_DELAY);

if (i >= TIMEOUT - POLLING_DELAY) {

  Serial.println("Error: UART read timeout on pre-write check.");

  return 0;

}

}

// 2. Write the Virtual Register address to the slave (with 0x40 read bit set)

Serial2.write(virtualAddr | 0x40);

// 3. Wait for TX_VALID (meaning the slave has data ready for us to read)

for (int i = 0; i < TIMEOUT; i += POLLING_DELAY) {

status = Serial2.read(); 

if (status & AS72XX_SLAVE_TX_VALID) {

  break; 

}

delay(POLLING_DELAY);

if (i >= TIMEOUT - POLLING_DELAY) {

  Serial.println("Error: UART read timeout waiting for TX data.");

  return 0;

}

}

// 4. Read the 8-bit data from the slave

return Serial2.read();

}

// Writes a single 8-bit value to the sensor’s virtual register via the UART bridge

void virtualWriteRegister(uint8_t virtualAddr, uint8_t dataToWrite) {

uint8_t status;

// 1. Wait for RX_VALID (meaning we can write to the slave)

for (int i = 0; i < TIMEOUT; i += POLLING_DELAY) {

status = Serial2.read(); 

if (status & AS72XX_SLAVE_RX_VALID) {

  break; 

}

delay(POLLING_DELAY);

if (i >= TIMEOUT - POLLING_DELAY) {

  Serial.println("Error: UART write timeout on pre-write check.");

  return;

}

}

// 2. Write the Virtual Register address to the slave

Serial2.write(virtualAddr);

// 3. Wait for RX_VALID again

for (int i = 0; i < TIMEOUT; i += POLLING_DELAY) {

status = Serial2.read();

if (status & AS72XX_SLAVE_RX_VALID) {

  break; 

}

delay(POLLING_DELAY);

if (i >= TIMEOUT - POLLING_DELAY) {

  Serial.println("Error: UART write timeout waiting for second pre-write check.");

  return;

}

}

// 4. Write the 8-bit data to the slave

Serial2.write(dataToWrite);

}

// Reads the 16-bit value for a specific wavelength channel

uint16_t getChannelValue(uint8_t baseRegister) {

// The AS7263 stores 16-bit values in two consecutive registers (High then Low byte)

uint8_t h = virtualReadRegister(baseRegister);

uint8_t l = virtualReadRegister(baseRegister + 1);

return (uint16_t)h << 8 | l;

}

// Checks the control register for the data ready flag

bool waitForDataAvailable() {

for (int i = 0; i < TIMEOUT; i += POLLING_DELAY) {

uint8_t control = virtualReadRegister(AS726x_CONTROL_SETUP);

if (control & 0b00000010) { // Check for the DATA_RDY bit (bit 1)

  return true;

}

delay(POLLING_DELAY);

}

Serial.println(“Error: Measurement timeout.”);

return false;

}

// Function to explicitly trigger a single measurement (Mode 2)

void triggerSingleShotMeasurement() {

uint8_t control = virtualReadRegister(AS726x_CONTROL_SETUP);

control &= 0b11111100; // Clear the mode bits (Bits 0 & 1)

control |= 0b10; // Set to Mode 2: Single measurement of all R,S,T,U,V,W

virtualWriteRegister(AS726x_CONTROL_SETUP, control);

}

// — Application Logic Functions —

// Function to take and average multiple measurements

void takeAveragedMeasurement() {

// Array to hold the SUM of all 6 channels

double sumValues[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};

Serial.print(“\n[”);

Serial.print(millis());

Serial.print("ms] Starting ");

Serial.print(READINGS_TO_AVERAGE);

Serial.println(" single-shot readings for averaging…");

// Loop to take the required number of readings

for (int i = 0; i < READINGS_TO_AVERAGE; i++) {

// CRITICAL: Explicitly start the measurement. This is what forces the LED to fire.

triggerSingleShotMeasurement(); 

// Wait for the sensor data to be ready

if (waitForDataAvailable()) {

  // Sum the six RAW 16-bit readings

  sumValues\[0\] += getChannelValue(AS7263_R_L);

  sumValues\[1\] += getChannelValue(AS7263_R_L + 2); 

  sumValues\[2\] += getChannelValue(AS7263_R_L + 4); 

  sumValues\[3\] += getChannelValue(AS7263_R_L + 6); 

  sumValues\[4\] += getChannelValue(AS7263_R_L + 8); 

  sumValues\[5\] += getChannelValue(AS7263_R_L + 10);

} else {

  Serial.print("Warning: Data timeout on reading ");

  Serial.println(i + 1);

}



// Reset the control register to clear the Data Ready bit, 

// preparing the chip to accept the next trigger.

virtualWriteRegister(AS726x_CONTROL_SETUP, 0b00000000); 

// Print a progress update every 10 readings

if ((i + 1) % 10 == 0) {

  Serial.print(".");

}

}

Serial.println(“\n— Averaging Complete —”);

// Print the header for easy CSV import

Serial.println(“Channel,Wavelength (nm),Averaged Value (Raw)”);

double r_avg = sumValues[0] / READINGS_TO_AVERAGE;

double s_avg = sumValues[1] / READINGS_TO_AVERAGE;

double t_avg = sumValues[2] / READINGS_TO_AVERAGE;

double u_avg = sumValues[3] / READINGS_TO_AVERAGE;

double v_avg = sumValues[4] / READINGS_TO_AVERAGE;

double w_avg = sumValues[5] / READINGS_TO_AVERAGE;

// Calculate Average = Sum / Count and print the final results

Serial.print(“R,610,”); Serial.println(r_avg/1000, 2);

Serial.print(“S,680,”); Serial.println(s_avg/1000, 2);

Serial.print(“T,730,”); Serial.println(t_avg/1000, 2);

Serial.print(“U,760,”); Serial.println(u_avg/1000, 2);

Serial.print(“V,810,”); Serial.println(v_avg/1000, 2);

Serial.print(“W,860,”); Serial.println(w_avg, 2);

Serial.println(“---------------------------------------------------------”);

Serial.print("Waiting ");

Serial.print(MEASUREMENT_INTERVAL_MS / 1000);

Serial.println(" seconds for next reading…");

};

void setup() {

Serial.begin(115200);

Serial.println(“— AS7263 UART Communication (Explicit Single-Shot) —”);

Serial.println(“Initialized Serial Monitor (115200)”);

// Initialize Serial2 for communication with the sensor

Serial2.begin(BAUD_RATE, SERIAL_8N1, SENSOR_RX_PIN, SENSOR_TX_PIN);

Serial.print(“Sensor connection established on UART2 (RX:”);

Serial.print(SENSOR_RX_PIN);

Serial.print(“, TX:”);

Serial.print(SENSOR_TX_PIN);

Serial.println(“)”);

// — Initial Configuration —

// 1. Soft Reset: Ensures the chip is in a known state

virtualWriteRegister(AS726x_CONTROL_SETUP, 0x80);

delay(5); // Wait for the chip to reset

// 2. Set Integration Time (50 cycles = ~140ms)

virtualWriteRegister(AS726x_INT_T, 50);

// 3. Enable DRIVER LED (Illumination)

// Set drive current to 6.25mA (0b001). Enable both Driver (Bit 5) and Indicator (Bit 4).

virtualWriteRegister(AS726x_LED_CONTROL, (0b001 << 3) | (0b1 << 5) | (0b1 << 4));

// NOTE: We do NOT set continuous mode here. We will explicitly trigger Mode 2 (Single-Shot) in the loop.

Serial.print("Configuration Complete. Readings will be averaged every ");

Serial.print(MEASUREMENT_INTERVAL_MS / 1000);

Serial.println(" seconds.");

}

void loop() {

unsigned long currentMillis = millis();

// Check if the interval has passed since the last measurement

if (currentMillis - lastMeasurementTime >= MEASUREMENT_INTERVAL_MS) {

lastMeasurementTime = currentMillis; // Update the timer



// Execute the full measurement and print sequence

takeAveragedMeasurement();

}

}

=====================================

I’m using Platform IO on Vs code, and this is what prints on the serial monitor =>

[1627867ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,53.66

S,680,53.66

T,730,53.66

U,760,53.66

V,810,53.86

W,860,53.86

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1628867ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,41.79

S,680,53.66

T,730,53.91

U,760,65.53

V,810,65.53

W,860,65.53

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1629867ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,18.55

S,680,6.06

T,730,19.20

U,760,6.19

V,810,7.60

W,860,8.67

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1635008ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,15.28

S,680,13.03

T,730,6.89

U,760,12.47

V,810,6.42

W,860,15.48

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1639774ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,6.35

S,680,5.80

T,730,25.37

U,760,19.18

V,810,19.64

W,860,6.50

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1643374ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,29.48

S,680,22.72

T,730,31.87

U,760,34.83

V,810,12.61

W,860,17.02

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1645602ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,52.33

S,680,52.48

T,730,39.39

U,760,39.59

V,810,52.38

W,860,43.38

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1646801ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,65.53

S,680,65.53

T,730,65.49

U,760,62.77

V,810,65.53

W,860,65.53

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1647801ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,30.21

S,680,34.55

T,730,30.36

U,760,44.03

V,810,39.37

W,860,41.93

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1648839ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,52.43

S,680,39.82

T,730,39.42

U,760,65.48

V,810,52.68

W,860,60.42

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1650239ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,65.53

S,680,65.53

T,730,65.53

U,760,65.53

V,810,65.53

W,860,65.53

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1651239ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,15.67

S,680,13.21

T,730,26.98

U,760,13.47

V,810,15.73

W,860,26.16

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1652841ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,52.48

S,680,65.53

T,730,65.53

U,760,65.53

V,810,65.53

W,860,65.53

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1653841ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,3.02

S,680,20.80

T,730,3.04

U,760,6.17

V,810,0.13

W,860,8.05

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1656377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,52.48

S,680,63.74

T,730,54.89

U,760,52.43

V,810,52.48

W,860,52.43

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1657377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,65.53

S,680,65.53

T,730,65.53

U,760,65.53

V,810,65.53

W,860,65.53

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1658377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,54.89

S,680,52.53

T,730,65.53

U,760,65.53

V,810,65.48

W,860,52.63

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1659377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,53.25

S,680,53.25

T,730,52.84

U,760,52.43

V,810,52.43

W,860,52.68

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1660377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,52.48

S,680,65.53

T,730,65.53

U,760,65.48

V,810,65.53

W,860,65.53

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1661377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,53.26

S,680,52.64

T,730,53.20

U,760,43.18

V,810,52.43

W,860,56.42

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1662377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,56.49

S,680,52.48

T,730,65.53

U,760,65.53

V,810,58.11

W,860,61.44

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1663377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,50.12

S,680,40.14

T,730,42.86

U,760,39.85

V,810,34.52

W,860,39.32

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1664377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,65.53

S,680,65.53

T,730,65.53

U,760,65.53

V,810,65.53

W,860,65.53

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1665377ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,40.14

S,680,53.25

T,730,53.25

U,760,54.89

V,810,52.43

W,860,52.44

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1666716ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,65.53

S,680,65.53

T,730,65.53

U,760,65.53

V,810,65.53

W,860,65.53

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1667716ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,21.21

S,680,19.43

T,730,42.23

U,760,40.20

V,810,43.47

W,860,41.73

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1669004ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,52.58

S,680,39.59

T,730,40.24

U,760,56.42

V,810,47.10

W,860,52.89

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1670004ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,16.97

S,680,23.14

T,730,37.71

U,760,20.76

V,810,8.38

W,860,15.64

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1671750ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,20.09

S,680,33.58

T,730,31.78

U,760,10.65

V,810,36.39

W,860,4.18

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1673662ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,16.18

S,680,21.07

T,730,22.90

U,760,22.95

V,810,16.69

W,860,24.01

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1676037ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,19.93

S,680,48.79

T,730,41.42

U,760,41.12

V,810,48.05

W,860,34.55

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1678122ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,16.45

S,680,41.26

T,730,21.18

U,760,27.56

V,810,29.02

W,860,30.76

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1680150ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,31.28

S,680,47.17

T,730,59.65

U,760,10.54

V,810,24.91

W,860,36.06

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1682590ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,29.50

S,680,30.87

T,730,12.49

U,760,32.94

V,810,24.24

W,860,26.40

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1685788ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,5.76

S,680,5.71

T,730,6.47

U,760,6.26

V,810,25.05

W,860,25.85

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1688869ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,65.53

S,680,65.53

T,730,65.53

U,760,65.53

V,810,54.02

W,860,65.53

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1689869ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,13.65

S,680,6.29

T,730,20.23

U,760,6.55

V,810,12.79

W,860,5.43

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1692376ms] Starting 5 single-shot readings for averaging…

-– Averaging Complete —

Channel,Wavelength (nm),Averaged Value (Raw)

R,610,24.64

S,680,16.98

T,730,12.64

U,760,23.66

V,810,22.79

W,860,37.29

---------------------------------------------------------

Waiting 1 seconds for next reading…

[1695294ms] Starting 5 single-shot readings for averaging…

-— Closed the serial port COM7 ----

You’d just use the “void takeMeasurementsWithBulb();” and associated function. Check out the library AS726X NIR/VIS Spectral Sensor Hookup Guide - SparkFun Learn

Also curious where this’n came from…haven’t seen beige qwiic ports on ours yet!

I’m currently using the getChannelValue() to get my measurements, so do I just call the above function ? And also , I got mine off Aliexpress

Since your board appears to be a counterfeit, you should ask Aliexpress why the light does not come on.

Please put your code inside ‘preformmated text’ tags

Like this.

It’s very difficult to read your code as it is.

1 Like