The AS7265x has to be driven with 3.3 V and I have chosen the I2C connection with an SEEEDUINO XIAO. The I2C Scanner shows the correct address, but no data appear. Other I2C devices work with the SEEEDUINO with SDA Pin4 and SCL Pin5. All data are zeros. I tried an Arduino Zero clone too, but this even worked with no I2C device. Now I will try a Nano with lever shifter, but with not much hope. I have purchased the board in Germany and none of the firms are testeing the board neither could give a reference of a working application.
My AS7265x ran the Sparkfun library examples “out of the box”, following the Getting Started guide with a 3.3V Arduino Pro Mini and Qwiic connectors. Since the library example will halt if the sensor.begin() method fails, it is hard to see how you could get all zeros for data. Unless perhaps the sensor firmware chip is not installed or current.
First few lines of output from library example “Example1_BasicReadings”:
AS7265x Spectral Triad Example
A,B,C,D,E,F,G,H,I,J,K,L,R,S,T,U,V,W
34.33,35.73,61.85,35.15,36.83,38.04,32.32,49.56,51.25,58.18,60.70,29.76,94.28,123.75,187.74,169.30,205.39,207.05,
34.33,35.73,61.85,35.15,36.83,38.04,31.80,49.56,51.25,58.18,60.70,30.66,93.12,123.75,187.74,169.30,205.39,207.05,
Please post the code, using code tags, and a closeup, focused photo of your setup, and perhaps someone will spot a problem.
What does that mean?I tried an Arduino Zero clone too, but this even worked with no I2C device
Serial Monitor.pdf (45.1 KB)
This is the serial monitor output.
The slightly modified program I use is the following:
/*
Read the 18 channels of spectral light over I2C using the Spectral Triad
By: Nathan Seidle
SparkFun Electronics
Date: October 25th, 2018
License: MIT. See license file for more information but you can
basically do whatever you want with this code.
This example takes all 18 readings, 372nm to 966nm, over I2C and outputs
them to the serial port.
Feel like supporting open source hardware?
Buy a board from SparkFun! https://www.sparkfun.com/products/15050
Hardware Connections:
Plug a Qwiic cable into the Spectral Triad and a BlackBoard
If you don’t have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
Open the serial monitor at 115200 baud to see the output
*/
#include “SparkFun_AS7265X.h” //Click here to get the library: http://librarymanager/All#SparkFun_AS7265X
AS7265X sensor;
void setup()
{
Serial.begin(9600);
sensor.begin();
delay(5000);
//while(Serial.available());
Serial.println(“AS7265x Spectral Triad Example”);
if (sensor.begin() == false)
{
Serial.println(“Sensor does not appear to be connected. Please check wiring. Freezing…”);
while (1)
;
}
Serial.println(“A,B,C,D,E,F,G,H,R,I,S,J,T,U,V,W,K,L”);
}
void loop()
{
sensor.takeMeasurements(); //This is a hard wait while all 18 channels are measured
Serial.print(sensor.getCalibratedA()); //410nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedB()); //435nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedC()); //460nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedD()); //485nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedE()); //510nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedF()); //535nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedG()); //560nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedH()); //585nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedR()); //610nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedI()); //645nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedS()); //680nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedJ()); //705nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedT()); //730nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedU()); //760nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedV()); //810nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedW()); //860nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedK()); //900nm
Serial.print(“,”);
Serial.print(sensor.getCalibratedL()); //940nm
Serial.print(“,”);
Serial.println();
}
Please use code tags when posting code.
The “modified” code has two calls to sensor.begin(). Why?
I suggest to start over, with the unmodified library example and the 3.3V processor.
The reason for
Serial.begin(9600);
sensor.begin();
delay(5000);
//while(Serial.available());
Serial.println("AS7265x Spectral Triad Example");
if (sensor.begin() == false)
{
Serial.println("Sensor does not appear to be connected. Please check wiring. Freezing...");
while (1)
;
}
was, that the seeeduino tends to omit even the first Serial.print and it seemed necessary, to give him some time. Now I tried it with an Nano and can even run the original Example 1, but the serial monitor shows only zeros. I wonder, since there is an EEPROM on the board, if it is not programmed. I had given back the board to BERRRYBASE one time, but they do not test them.
See the output of a nano with the original Example 1 Basic readings of Sparkfun
The best choice of using 3.3 V Processors was the nano with a level shifter, but the seeeduino an the wemos D1 Mini show the same.
the seeeduino tends to omit even the first Serial.print
Most Arduinos do that, when you don’t give Serial.begin() time to finish making the connection, before trying to print.
Remove one of the extra sensor.begin() calls and try again. But I suspect that the sensor firmware is missing or corrupted.
Of cause I have tried the original example1 and the others, with sensor.begin only in the test. All examples (including temperature) produce only zeros in the values. Is there any way to reprogram the EEPROM? We really need this board for our experiments and very enjoy its possibilities. The way to exchange it over and over seems useless and time consuming. Can you give us advice?
Try using the AS7265x library Example 7 to read the firmware version.
To make sure that the Arduino serial connection is made before the sensor is addressed, modify the example to use the following:
Serial.begin(9600);
while(!Serial);
Serial.println("AS7265x Spectral Triad Example");
This application note from AMS describes how to update the firmware: https://www.mouser.com/pdfDocs/AS72xx_A … 1-00-2.pdf
Finally we solved the problem with the following steps:
-
We used an Arduino Nano with level shifter - no success
-
We tried an older version of the h file 1.0.1 with a Toshiba Laptop - no success
3.We tried it on another Computer (Lenovo X201) - success
It would be worthwhile to mention, that the sensor digitizes with 16 Bit.
Here are some raw data illuminated with a LED lamp
So, you have no idea what the real problem was?