LED Matrix glitchy pixels and it stays on after unplugging

Hello, this is my first time dealing with electronics and my led matrix just arrived. I got it running but there are artifacts on the last few pixels.

The matrix somehow also stays on without power as seen at the end.

I followed the original wiring guide and I'm pretty sure I got it connected properly. esp32 is powered by my PC and the matrix is powered by the PSU in the video (RND LAB DC POWER SUPPLY 320-KD3005D)

I am using the code from

https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA/blob/master/examples/2_PatternPlasma/2_PatternPlasma.ino

and the matrix is https://www.waveshare.com/rgb-matrix-p2-64x64.htm

Power supply is set to 5V 5A

Wiring should be correct:

The number of times we have heard that.
Post the code, not links.
No idea what the video is showing.
Do you know what a capacitor does?

The video is showing the glitchy pixels at the end and the fact that the LED matrix stays on after turning off the PSU.

Last blocks of pixels and last few individual LEDs are weird

Last few LEDs are yellow / dimmed even though the PSU can deliver several times more amps than the Matrix is pulling and the brightness is at like 5%

PSU is off but matrix isnt, it continues to play animations with only red color until i unplug the ESP32

Here is the code with comments removed

#include <Arduino.h>

#include <ESP32-HUB75-MatrixPanel-I2S-DMA.h>
#include <FastLED.h>

#define PANEL_RES_X 64
#define PANEL_RES_Y 64
#define PANEL_CHAIN 1

MatrixPanel_I2S_DMA *dma_display = nullptr;

uint16_t time_counter = 0, cycles = 0, fps = 0;
unsigned long fps_timer;

CRGB currentColor;
CRGBPalette16 palettes[] = {HeatColors_p, LavaColors_p, RainbowColors_p, RainbowStripeColors_p, CloudColors_p};
CRGBPalette16 currentPalette = palettes[0];

void setup() {
	Serial.begin(115200);
	Serial.println(F("ESP32-HUB75-MatrixPanel-I2S-DMA DEMO"));

	HUB75_I2S_CFG mxconfig(
		PANEL_RES_X,
		PANEL_RES_Y,
		PANEL_CHAIN
	);

	mxconfig.gpio.e = 18;

	dma_display = new MatrixPanel_I2S_DMA(mxconfig);
	dma_display->setBrightness8(10);

	if (!dma_display->begin())
	Serial.println("I2S memory allocation failed");

	Serial.println("Fill screen: RED");
	dma_display->fillScreenRGB888(255, 0, 0);
	delay(1000);

	Serial.println("Fill screen: GREEN");
	dma_display->fillScreenRGB888(0, 255, 0);
	delay(1000);

	Serial.println("Fill screen: BLUE");
	dma_display->fillScreenRGB888(0, 0, 255);
	delay(1000);

	Serial.println("Fill screen: Neutral White");
	dma_display->fillScreenRGB888(64, 64, 64);
	delay(1000);

	Serial.println("Fill screen: black");
	dma_display->fillScreenRGB888(0, 0, 0);
	delay(1000);

	currentPalette = RainbowColors_p;
	Serial.println("Starting plasma effect...");
	fps_timer = millis();
}

void loop() {
	for (int x = 0; x < PANEL_RES_X; x++) {
			for (int y = 0; y < PANEL_RES_Y; y++) {
				int16_t v = 128;
				uint8_t wibble = sin8(time_counter);
				v += sin16(x * wibble * 3 + time_counter);
				v += cos16(y * (128 - wibble) + time_counter);
				v += sin16(y * x * cos8(-time_counter) / 8);

				currentColor = ColorFromPalette(currentPalette, (v >> 8));
				dma_display->drawPixelRGB888(x, y, currentColor.r, currentColor.g, currentColor.b);
			}
	}

	++time_counter;
	++cycles;
	++fps;

	if (cycles >= 1024) {
		time_counter = 0;
		cycles = 0;
		currentPalette = palettes[random(0,sizeof(palettes)/sizeof(palettes[0]))];
	}

	if (fps_timer + 5000 < millis()){
		Serial.printf_P(PSTR("Effect fps: %d\n"), fps/5);
		fps_timer = millis();
		fps = 0;
	}
}

Do you need more info?

Do you know what might be causing this?

Yes, a wiring diagram. A photo of a hand drawn is fine.
Glitchy pixels is probably a manufacturing defect. Staying on is possibly residual charge.

There are no other components other than the PSU, the ESP32, the LED Matrix, and the cables. I did not add an extra capacitor or anything

the esp32 (NodeMCU-32S) is currently plugged into my pc via USB-C for power.

Here is a list of the pins I have connected:

Additionally, GND (Matrix) with GND (esp32).
I have configured (software) and connected (physically) `E_PIN_DEFAULT` to 18. It doesn’t say what pin to use so I used the most convenient one.

I have just verified that every single pin connection matches with what I posted above.

The guide only connects one of the GND pins to the esp32. I tried connecting both which caused the matrix not to turn on and only draw the idle current.

The weird thing is that the esp32 seems to be contributing power to the matrix trough the data pins? When the PSU is off and the ESP is on, only red pixels show up and they are dim, but visible and controllable, so its not residual power. It even happens when the PSU was off for hours. I’m scared to turn on the panel for too long as this feels wrong and I want to avoid damaging the components since they are expensive for me

Correction: B is at 19 as in the code above, not as shown in the image. Im tired, its 2 am.

The datasheet of the Matrix is needed.
What is the device labelled HUB75?
If connecting the Gnd causes the panel to not work that might be a big clue.
Good luck. I doubt I can help further given what is known.

HUB75 is not a "device", just is a common type of the led matrix 16pin connector.

A weak voltage penetrates from the signal pins of the ESP32 and lights the LEDs with the lowest forward voltage - the red ones. This weak supply is no longer enough to turn on the green and blue pixels. This is absolutely normal for such matrices, I have observed this more than once.

In general, all your pictures indicate that you have everything connected correctly and the panel is compatible with the specified library.

1 Like

@swarkin you don't have everything connected correctly when you have the PSU disconnected but the ESP32 connected. This is called "phantom powering" and is bad for both the ESP and the driver chips on the display. Don't do it!

1 Like

In this case, do you think the Matrix itself might be damaged? Theres no other reason I can think of on why the last pixels on this panel behave this weirdly like in the image.

Im gonna write an email to waveshare support and ask them whether this is a defect and whether it can be replaced/refunded.

This was only because I was power cycling the matrix to try out a new program and I am not going to run it without an external PSU.

Just to verify, when everything is on and running (PSU, Matrix, ESP32, etc..) then this isnt a problem, right? Only when the external PSU turns off for whatever reason its bad?
Or does this “Phantom powering” also happen with the external PSU and I just dont see it?

There could be another reason - improper using of the library. Why didn't you write an issue on the library Github?

Correct

If any chip which is not powered is receiving a signal on one of its other pins from an external circuit that is powered, phantom powering can occur. It's bad for 2 reasons:

  1. The ESP's data pins can only supply a few milliamps. If more than that flows, they can be damaged. Powering all those LEDs, even if it is only the red LEDs and they are only shining dimly, takes more power than is safe for the ESP's data pins to source.
  2. Phantom powering is possible because all chips have ESD protection diodes built-in. Without them, they would probably be destroyed by static before they ever got used. But the side-effect of having those diodes is that if a chip isn't connected to a power supply, but one of its other pins is connected to a circuit that is powered, current will flow from that pin to the chip's power pin, powering it. The ESD diodes are not designed for that purpose, and this can damage the whole chip.

No, it doesn't happen because when the PSU is on, the voltage at the chip's power pin is the same or higher than the signal from the external circuit, so no current flows through the ESD diodes.

While this might be possible, the issue with the last half row of pixels being washed out / dimmed still remains (same area where the black pixels were showing up), even when just displaying static white at any brightness level.

The glitchy pixels seem to only happen when many different colors are being displayed. Static image or not doesnt matter

Beginners are usually forgetting that the long/thin connection wires from the power supply could be the limiting factor.
Leo..

I have contacted waveshare support and after a few round trips it turned out that their connection diagram was wrong. :ok_hand:

On top of that, the library they use has changed default pin configurations as well.

For anyone with the same problem, you must use the version on Github instead of the waveshare website, and make sure to configure pin E to something valid, as well as connect both GND pins, even though this is not shown in the wiki. Don’t follow the example code.

The other issue that I mentioned in the title seems to be “Phantom powering”:

Thanks for the ideas and explanations everyone.

Yes, its mandatory for panels > 32 pixels high.
And its clearly stated in the library README

Added:
Moreover, pay attention to the comment in your own code:

I know about the E pin issue, i was summarizing things that could have gone wrong for anyone potentially having the same issue :slight_smile:

1 Like