Introduction: 128x64 Yellow/Blue OLED for Arduino Nano, With TSL2591

About: More better electronics.

You can build an OLED display onto an Arduino Nano with a TSL2591 spectroscopic sensor (well, two channels - visual and NIR ...) by combining sketch examples online. What you get is a 4-line display of total flux, visual flux, NIR, and an index called the NDVI index.

First install some libraries:

TSL2591: https://github.com/adafruit/Adafruit_TSL2591_Libra...

SSD1306: https://github.com/adafruit/Adafruit_SSD1306SSD1306

GFX https://github.com/adafruit/Adafruit-GFX-Library

Sensors https://github.com/adafruit/Adafruit_Sensor

Step 1: Fixing Setup of the Adafruit_SSD1306.h File

The file "Adafruit_SSD1306.h" may be set for a 128x32-pixel display. If you have the 128x64 display you will want to edit near lines 73-75 of the file. Comment out the _16 and _32 lines and UNcomment the _64 line. It should look like the picture.

Step 2: Wiring the Arduino Nano, the TSL2591 and the SSD1306 OLED Display.

I am reusing a Nano - hence the header pins ...

Power over USB-mini - code also provides Serial port output that can be read externally and logged, if you like.

Step 3: My Code

Get the code and upload to the board. Output will be on the OLED screen, as well as over the serial port - Full, Visual, IR, and the NDVI.