WSAL19564 – AS7341 Spectral Color Sensor/en
Erscheinungsbild
Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.
Summary
The AS7341 spectral color sensor from Waveshare uses the AS7341 chip with 8 visible spectrum channels, one near-infrared channel and one no-filter channel. It communicates via I2C (address 0x39), features six independent 16-bit ADCs for parallel data processing, and includes two brightness-adjustable LEDs for illumination in dim environments.
Related products at JW Tech
Technical overview
- Core chip: AS7341-DLGM, an 11-channel IC for spectrum recognition and color matching; spectral response approximately 350–1000 nm.
- Six channels are processed in parallel via independent ADCs; remaining channels are accessed through a multiplexer (SMUX).
- I2C device address of the AS7341 is 0x39 (see datasheet, page 21).
- Operating voltage: 3.3 V or 5 V; operating current approximately 20 mA (LED off) or 70 mA (LED on).
- Dimensions: 30.5 mm × 23 mm; mounting hole 2.0 mm.
- Pinout: 1 VCC, 2 GND, 3 SDA, 4 SCL, 5 INT (interrupt output), 6 GPIO (general-purpose I/O).
- Two high-brightness LEDs provide fill light in dim environments; brightness is programmable.
- A dedicated channel detects ambient light flicker at 100 Hz or 120 Hz; integration time and gain are adjustable.
- SYNS mode: measurements are triggered by a falling edge on the GPIO pin; the GPIO is not connected by default.
- Spectral interrupt: upper/lower thresholds are programmable; the triggering channel can be selected among CH0–CH4.
- Available demo projects: Getdata, Getflicker, Syns, INT, pinINT, Clear – each provided for Arduino, STM32, and Raspberry Pi.
Commands and examples – verify before use:
AS7341_EnableLED(true); // LED Enable
AS7341_ControlLed(false,10);//Turn on or off the LED and set the brightness of the LED
while(!AS7341_MeasureComplete()); // Jump out of this loop when GPIO receives a valid signal.
AS7341_SetInterruptPersistence(0); // Set the sensitivity of spectrum interruption
AS7341_SetSpectralThresholdChannel(4); //Set the channel to detect interrupts
Notes and version constraints
- For SYNS testing, the GPIO pin must be briefly pulled high and then released to generate a falling edge; the pin is not permanently connected by default.
- If serial output shows only zeros or stops after startup: verify hardware connections, especially that SDA and SCL are not swapped; power off, reconnect, and rerun.
- Demos were verified on NUCLEO-F103RB (STM32RBT6) and OpenH743I-C (STM32H743IIT6); migrating to other boards requires adjusting pin mapping and configuration.
- The I2C address 0x39 is taken from the datasheet; resolving address conflicts on the bus may require manual confirmation.
- The demo uses serial port 2 (PA2, PA3) at 115200 baud, 8 data bits, 1 stop bit, no parity; deviations require configuration changes.
Source and revision record
- AS7341 Spectral Color Sensor - Waveshare Wiki
- Source revision: 99320
- Captured: 2026-09-01T04:30:33+00:00
- SHA-256:
20004dabc0dcf9167b9b8f07d19483c73a96510a19dee81232fa9979bb20f488