Problem with Max7219 matrix display

I've been trying to connect a LED matrix display to an Arduino Uno for a project I'm working on, but I'm having trouble getting it to function properly. As a test I tried having it display a simple message, but when I uploaded the program, all the LEDs on some of the modules just light up and the rows start flashing back and forth. It's inconsistent which modules light up and sometimes one of the modules will only light up a couple of the LEDs without flashing. I'm inexperienced with using arduinos and matrix LED displays, so is there something I'm missing? The hardware I'm using is an Arduino Uno, and the display is a 8x32 Max7219 LED matrix display, with the rest of the project that it's connected to being mostly just wires and resistors. I've included the code as well, even if it's very simple and just used for testing:

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 3
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

void setup() {
myDisplay.begin();
}

void loop() {
myDisplay.print("Test");
}

What exact matrix do you have? Can you post a link to where you got it? Are you sure of the HARDWARE_TYPE?

How is the matrix powered?

This is the matrix I'm using, got it from the same website: Max7219 dot matrix module 4-in-1 led display module Sale - Banggood.com

I'm basing the project off a project someone else has done, so I'm using the same HARDWARE_TYPE that was used in their code (they used the same display, though they used two of them). The matrix is powered by the arduino, from the 5V pin.

Well it is the wrong hardware type then, because that is the FC-16 module, so you need to specify that in the code.

The marking "QS-15-100" is unhelpful, but "FC-16" is probably printed on the side of the board under the matrices.

That listing is substantially more expensive than Aliexpress and it has the useless jumpers projecting from the back, but at least it appears to be the version with the displays socketed so you can re-work the end interface pins in order to gang boards together.

Just as long as you do not imagine you can power the UNO (or Nano, Pro Mini, Mega etc.) using the useless "Vin" pin or "barrel jack". Each module may draw up to 320 mA at full brightness, so you can easily overload the USB supply or the "polyswitch" which protects it on the UNO.

Okay, that might be the problem, though when I was working on it earlier I did change the hardware type to FC-16 after looking at some tutorials, and it didn't fix it, though I might have messed something up while doing so, so I'll try that again.

I don't have access to the project currently, but fairly certain that the display I have is a bit different from the one listed, as I don't believe it has the jumpers. So might be a different hardware type than FC-16, now I know how to check the hardware type at least. Also thanks for the warning with the Vin pin, wasn't planning to use it, but now I know not to use it in the future.

Try it with the this define for hardware type:

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW

For this test you should get away with powering from the Arduino 5V (USB), but like @Paul_B says, you should power the matrix from an external 5V supply that can supply enough current for a fully lit display at full brightness. An old cell phone charger is what I use.

No, it will definitely be the FC-16, the other types look entirely different (and I do not know if there is even another type that comes in strips of four).

Which is to say, you connect the supply (5 V and ground) directly to the display and to the "5V" and ground pins on the Arduino.

Sometimes the LED matrices are plugged in the wrong way round on the boards, so you may want to try that as well. Shouldn't damage anything.

I tried changing the hardware type, but this didn't seem to help unfortunately. I tried what @marco_c said, but this just made the display show the dots in a grid-like pattern, regardless of what I tried to make it print. At least it wasn't flashing anymore.

It definitely is FC-16, so leave it like that.

Change the code to

void setup() {
myDisplay.begin();
myDisplay.print(“Test”);
}

void loop() {}

I suspect that, because you are .printing hundreds of times a second, you are seeing the flashing when the display is cleared before print (ie, it actually spends more time cleared than printed).

You better believe it! :sunglasses:

That didn't fix it unfortunately. I've tried some other things that didn't fix it either, so I think the problem is just with the display I have. Since it didn't work, I just dropped the display and used the console to print what I wanted.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.