Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

Sensor Module Project Nano

project: AMS AS726X spectrometer (UNO)

Introduction

This small “project” post covers how to wire an integrated module with the AMS AS72Sx 6 channel broad band spectrometer to an Arduino UNO board.

The I2C communication bus

The spectrometer sends data for 6 (12 or 18) spectral bands using the I2C communication bus.

Preparing the Arduino IDE

Your Arduino board must have the SDA and SCL ports required for the I2C communication bus. If you are using one of Arduino’s standard boards they should be included with the latest version of Arduino IDE. On smaller boards that lack dedicated SDA and SCL ports A4 is used for SDA and A5 for SCL. For boards that do not have A4 and A5, the alternative is to program the I2C board, outlines in this GitHub repo,

If you are using a board from a partner, you probably need to configure Arduino IDE for that particular board. As an example, you can look at the manuals for how to configure Arduino for the Adafruit’s Metro Express board.

Adafruit or sparkfun

Breakout boards with the AMD AS72Sx sensor(s) are offered both by Adafruit and Sparkfun. Sparkfun is easier to work with if you use their Qwiic connect system for I2C devices. You can then use the Qwiic Cable - Breadboard Jumper (4-pin) for connecting the spectrometer to the board. If you use the Adafruit spectrometer you have to solder the breakout board.

Wiring

The wiring is (almost) the same regardless if you use the Adafruit or Sparkfun breakout boards. The Adafruit manual is here.

The difference between Adafruit and Sparkfun is that the Sparkfun breakout board requires 3.3 v power, whereas the Adafruit breakout board can be powered with either 3.3 or 5 v.

Wiring an AS726x 6-channel spectrometer. The Adafruit breakout board can be powered with either 3.3 or 5 v (as shown), whereas the Sparkfun board only have a connection for 3.3 v.

Sketch

The sketch below works both with the Adafruit and Sparkfun breakout boards.

Adafruit additional components

Adafruit TFT display 1.44 (240 x 135), also available from Elfa.

Adafruit TFT display 0.96 (160 x 80).

The board used in the Adafruits manual for Arduino wiring of these components is the Adafruit METRO M0 Express, also available from Elfa. But an ordinary Arduino UNO board works as well.

Mikroelektronika (Mikroe)

Mikroe offers the AS7261 RGB+NIR sensor as a breakout board, but not specifically for Arduino.

University of Novi Sad have demo project for creating a AS7261 XYZ Sensor - Colorimeter. The project include wiring to an Arduino board, include a 3D-printed shell, and a demo video on youtube and code written in Laboratory Virtual Instrument Engineering Workbench (LabVIEW). The STL model is under the repo subfolder stl and the LabVIEW file under the directory code/AS7261-VI.

Arduino wiring of the Mikroe "Spectral Click" AS7261 spectrometer.
STL model for casing to the Mikroe "Spectral Click" AS7261 spectrometer.
Sensor Module Project Nano