Home Code IS31FL3741 LED matrix module and Arduino example

IS31FL3741 LED matrix module and Arduino example

by shedboy71

In this article we look at a module with lots of LEDs on it, its an IS31FL3741 LED matrix module from adafruit

Module Information

At the centre of the module is the IS31FL3741

The IS31FL3741 is a general purpose 39×9 LED Matrix programmed via an I2C compatible interface.

Each LED can be dimmed individually with 8-bit PWM data and 8-bit scaling data which allowing 256 steps of linear PWM dimming and 256 steps of DC current adjustable level.

Additionally each LED open and short state can be detected, IS31FL3741 store the open or short information in Open-Short Registers. The Open-Short Registers allowing MCU to read out via I2C compatible interface. Inform MCU whether there are LEDs open or short and the locations of open or short LEDs.

The IS31FL3741 operates from 2.7V to 5.5V and features a very low shutdown and operational current.


Supply voltage range: 2.7V ~ 5.5V
9 Current Sink × 9 SW matrix size: drive up to 351 LEDs or 117 RGBs
Individual 256 PWM control steps
Individual 256 DC current steps
Global 255 current setting
SDB rising edge reset I2C module
Programmable H/L logic: 1.4/0.4, 2.4/0.6
29kHz PWM frequency
1MHz I2C-compatible interface
interrupt and state lookup registers
Individual open and short error detect function

The adafruit module features a 13×9 RGB LED matrix breakout for a grand total of 117 RGB LEDs

Parts Required

Name Link
Arduino R4 Aliexpress link
is31fl3741 https://learn.adafruit.com/adafruit-is31fl3741/arduino
Connecting cables Male to Male + Male to Female and Female to Female Jumper Wire Dupont Cable



I use an Arduin oR4 Wifi, just because that is my board of choice at the moment. This would work just as well with an Arduino Uno or similar board. I did not use the QWIC connector on the R4. Mainly because its 3.3v only, so for ease of use and dealing with multiple sensors I use a 5v connection on the board

My board of choice is an R4 clone board with extra headers fitted – very handy

Code Example

You can install the Adafruit IS31FL3741 library for Arduino using the Library Manager in the Arduino IDE.

Click Manage Libraries, search for IS31FL3741 , and select the Adafruit IS31FL3741 library, and install the latest version:

You may be asked about dependencies if this is the first time you have installed an Adafruit library, click “Install all” to install them as well.

The library has several example – this one scrolls text on the matrix and we have toned the brightness down as well – they are bright leds


#include <Adafruit_IS31FL3741.h>

Adafruit_IS31FL3741_QT matrix;
// If colors appear wrong on matrix, try invoking constructor like so:
// Adafruit_IS31FL3741_QT matrix(IS3741_RBG);

// Some boards have just one I2C interface, but some have more...
TwoWire *i2c = &Wire; // e.g. change this to &Wire1 for QT Py RP2040

char text[] = "Arduinolearning!";   // A message to scroll
int text_x = matrix.width(); // Initial text position = off right edge
int text_y = 1;
int text_min;                // Pos. where text resets (calc'd later)

void setup() {
  Serial.println("Adafruit QT RGB Matrix Scrolling Text Test");

  if (! matrix.begin(IS3741_ADDR_DEFAULT, i2c)) {
    Serial.println("IS41 not found");
    while (1);

  Serial.println("IS41 found!");

  // By default the LED controller communicates over I2C at 400 KHz.
  // Arduino Uno can usually do 800 KHz, and 32-bit microcontrollers 1 MHz.

  // Set brightness to max and bring controller out of shutdown state
  Serial.print("Global current set to: ");

  matrix.enable(true); // bring out of shutdown

  // Get text dimensions to determine X coord where scrolling resets
  uint16_t w, h;
  int16_t ignore;
  matrix.getTextBounds(text, 0, 0, &ignore, &ignore, &w, &h);
  text_min = -w; // Off left edge this many pixels

void loop() {
  matrix.setCursor(text_x, text_y);
  for (int i = 0; i < (int)strlen(text); i++) {
    // set the color thru the rainbow
    uint32_t color888 = matrix.ColorHSV(65536 * i / strlen(text));
    uint16_t color565 = matrix.color565(color888);
    matrix.setTextColor(color565, 0); // backound is '0' to erase previous text!
    matrix.print(text[i]); // write the letter

  if (--text_x < text_min) {
    text_x = matrix.width();




A video I tried to take of the example above


You may also like

Leave a Comment