

The Adafruit AS7341 is a highly versatile spectral sensor capable of measuring light intensity across multiple wavelengths. It features 6 color sensing channels, along with additional near-infrared and clear channels, enabling precise color detection and spectral analysis. This makes the AS7341 an excellent choice for applications such as color matching, environmental monitoring, robotics, and scientific research.
The sensor is compact and communicates via the I2C protocol, making it easy to integrate into microcontroller-based systems like Arduino or Raspberry Pi. Its high sensitivity and advanced features allow for accurate measurements even in low-light conditions.








Below are the key technical details of the Adafruit AS7341:
The Adafruit AS7341 breakout board has the following pins:
| Pin Name | Description |
|---|---|
| VIN | Power input (3.3V to 5V). Powers the sensor and onboard voltage regulator. |
| GND | Ground connection. |
| SCL | I2C clock line. Connect to the SCL pin of your microcontroller. |
| SDA | I2C data line. Connect to the SDA pin of your microcontroller. |
| INT | Interrupt pin. Can be used to signal the microcontroller when data is ready. |
| RST | Reset pin. Pull low to reset the sensor. |
| LED | Controls the onboard LED for illumination during measurements. |
To use the Adafruit AS7341 with an Arduino UNO, follow these steps:
Wiring:
Install the Adafruit AS7341 Library:
Example Code:
Use the following example code to read data from the AS7341:
#include <Wire.h>
#include "Adafruit_AS7341.h"
// Create an instance of the AS7341 sensor
Adafruit_AS7341 as7341;
void setup() {
Serial.begin(115200);
while (!Serial); // Wait for Serial Monitor to open
// Initialize I2C communication and the sensor
if (!as7341.begin()) {
Serial.println("AS7341 not detected. Check wiring!");
while (1); // Halt execution if sensor is not found
}
Serial.println("AS7341 initialized successfully!");
}
void loop() {
// Read and print the visible light channels (F1-F6)
Serial.println("Visible light channel readings:");
for (int i = 1; i <= 6; i++) {
Serial.print("F");
Serial.print(i);
Serial.print(": ");
Serial.println(as7341.readChannel(i));
}
// Read and print the near-infrared (NIR) channel
Serial.print("NIR: ");
Serial.println(as7341.readChannel(7));
// Read and print the clear channel
Serial.print("Clear: ");
Serial.println(as7341.readChannel(8));
delay(1000); // Wait 1 second before the next reading
}
0x39. Ensure no other devices on the I2C bus share this address. Sensor Not Detected:
0x39).Inaccurate Readings:
Arduino Freezes or Crashes:
Can the AS7341 measure UV light?
No, the AS7341 is designed to measure visible and near-infrared light (350 nm to 1000 nm).
What is the purpose of the interrupt pin?
The interrupt pin can signal the microcontroller when a measurement is complete, reducing the need for constant polling.
Can I use the AS7341 with a 5V microcontroller?
Yes, but you must use level shifters for the I2C lines to avoid damaging the sensor.
This concludes the documentation for the Adafruit AS7341. For further details, refer to the official Adafruit guide or datasheet.