Flickering on LED Array

Please, check this video on YouTube.

I have an LED Array powered by Arduino.
The code blinks only the first column. Notice how the other two columns on the right have flickering LEDs on the same two rows with the first column. If an LED is not on the same row with the blinking column, no flickering is noticeable. Counting rows from the bottom - in the first column the blinking rows are 3 and 4, and the same rows in the second and the third column have flickering when the first column blinks, but row #2 in the second column and row #1 in the third column doesn't have that flickering.

How can I eliminate that flickering?

Post your code & schematic to start.

Please, before I do that, let me put the question differently: is it true, that the more LEDs in a row you have in ON state the dimmer each one of those ON in the row will be?

sealemar:
Please, before I do that, let me put the question differently: is it true, that the more LEDs in a row you have in ON state the dimmer each one of those ON in the row will be?

In depends completely on how you are doing things.

We really can’t help you without a lot more information. Start with the code and the schematics, and it’ll save us all a lot of time.

I notice various resistors on the breadboard, but none clearly connected to the display in operation.

Unless you are using a MAX7219 or similar purpose-designed driver chip - and I am pretty sure you are not - you must have resistors for whichever of the rows or columns that are being driven simultaneously whilst the other dimension is selected, otherwise you will be overloading the Arduino even more dangerously than you probably need to be to cause this effect.

If you have removed resistors in an attempt to increase the brightness, you have completely misunderstood the need for buffer transistors in the dimension opposite to where the resistors must be.

Go get a MAX7219 and learn how to use it. :smiley: Seriously, this is the only sensible and dead easy way to drive a small number of these matrices.

This is how I would have pictured the flickering led's from noise. I am not sure, I have never seen it, but check your capacitors, or put some in...

My apologies for leaving the topic. My problem was in the walking bit which was travelling the columns. After I'd switched it to walk the rows I had no problems with dimming rows (and columns) any more. This post helped me to understand that.

The resistor must be in the line that only takes the current for one LED. If it were otherwise then the brightness of the LEDs would change depending on how many LEDs are on at any one time.

The same blog post says:

If you want to drive a matrix with an arduino you must use an external driver for the current source or current sink. Despite some tutorials suggesting otherwise, you will over stress the arduino by many times above the absolute limit if you try. These tutorials (one on the official Arduino site) are very bad and will eventually destroy your Arduino although you might think it works for some time eventually the Arduino will fail.

But it doesn't say how to understand that you are about to over stress the Arduino. How to calculate the amount of current which is needed to be sunk/sourced? I have an LED array with two shift registers in series - one for the rows and the other one for the columns.

The question on that topic looks very similar to what I'm facing. 595 are separated, but that seems like the only difference. ULN is discussed there to sink the current.

But my concern is the current flow through 595 at the top if I turn on all LEDs in a row since 8*20mA = 160 mA which is over the ~35 mA capacity of the 595.

Where do the numbers come from?

To Paul__B
I notice various resistors on the breadboard, but none clearly connected to the display in operation.
The resistors are connected to the LED rows.

Where do the numbers come from?

Typically, one uses current limit resistors to allow max current of 20mA/LED as that is the max continuous current for many LEDs.
If you have a multiplexed matrix with shift registers and ULN2803, then one would expect all the anodes to be driven together while 1 cathode at a time is enabled.
8 LEDs, all on, = 20mA * 8 = 160mA.
Datasheet for 74HC595 has absolute max limit on the VCC and GND pin of 70mA. If all 8 outputs are HIGH and current limit resistor allows 20mA per output, than a lot more current is requested than the chip supports. Resistors should be changed to only allow 8-9mA per output.

What I have now is two 74HC595 in series and 220 Ohm resistors on each of the LED array rows. I don't have ULN2803 on my circuit.

CrossRoads:
Resistors should be changed to only allow 8-9mA per output.

Does that mean that if I have stronger resistors, I don't have to have ULN2803? What's ULN2803 purpose in there, then?

As a separate question. I have it all powered from Arduino's USB -> 5V pin. I want to change that to 3 AA batteries -> 5V pin. The voltmeter showed around the same voltage in both cases. Do I have to account for the change somehow?

How about a schematic? 3rd request.
Are you saying you have '595 to rows of anodes, and 2nd '595 to columns of cathodes?
Are you planning to turn on more than one anode and one cathode at a time?
Any more than that and you are overstressing the cathode-driving '595.
The ULN2803 would a high ciurrent buffer for the output of the cathode '595 to allow current sinking of 8 LEDs, and 1/8 rows multiplexing vs 1/64 LEDs multiplexing.

4.5V or 5V, both are fine for a power source.

I watched your video three times and I'm not sure what the issue is. Are you saying the lights on the right should not be fading when the ones on the left come on?

A schematic would really help here. There's lots of these LED matrix projects out there, and they are slightly different - maybe a link to the project you are doing, if it shows the wiring? Then, we should check your actual wiring and make sure it matches up. If the project is posted on the web somewhere, please post the links.

Is it this? LED Matrix - Dual Color - Medium - COM-00682 - SparkFun Electronics

This is what I was working on and what I had questions about:

sealemar:
This is what I was working on and what I had questions about:
sealemar talks 0x43 0x6F 0x64 0x65: BinaryClock Hardware
sealemar talks 0x43 0x6F 0x64 0x65: BinaryClock - a binary clock DIY

Something very odd about your schematic. It shows pushbuttons connected to Vcc but no pull-down resistors.

Of course, the proper way to connect the pushbuttons, is to ground and use the "INPUT_PULLUP" function, but I cannot see how your project even works with the configuration as it is shown.

Paul__B:
Of course, the proper way to connect the pushbuttons, is to ground and use the “INPUT_PULLUP” function, but I cannot see how your project even works with the configuration as it is shown.

Thank you Paul for spotting that error. It was on schematics only. Push buttons are connected to Atmega and grounded. And on Atmega internal pull up resistors are set as per westfw. I’ve made changes to schematics on the blog post and in the GitHub project.

My concern is that it discharges three AA batteries really fast. A couple of weeks and three Duracell are dead. Does anybody know what can be a cause?

sealemar:
Push buttons are connected to Atmega and grounded. And on Atmega internal pull up resistors are set as per westfw. I've made changes to schematics on the blog post and in the GitHub project.

Ah well, that's better.

sealemar:
My concern is that it discharges three AA batteries really fast. A couple of weeks and three Duracell are dead. Does anybody know what can be a cause?

If that is with the display running, I would say you are doing extremely well to get that amount of running time.

If it is showing the display only "on demand" - for a limited time after a button press - well, it's not doing too bad either. If you are using "sleep" to shut down except on a button press then perhaps it should last a little longer, noting that you have no "power" LED or regulator as a full Arduino board does. But I gather you cannot be doing that, as it is supposed to be keeping time. :smiley:

sensai:
This is how I would have pictured the flickering led's from noise. I am not sure, I have never seen it, but check your capacitors, or put some in...

Capacitors are good. But the flashing left-side square looked more like a program glitch than the erratic flashing from noise.

Paul__B:
If that is with the display running, I would say you are doing extremely well to get that amount of running time.

If it is showing the display only "on demand" - for a limited time after a button press - well, it's not doing too bad either. If you are using "sleep" to shut down except on a button press then perhaps it should last a little longer, noting that you have no "power" LED or regulator as a full Arduino board does. But I gather you cannot be doing that, as it is supposed to be keeping time. :smiley:

You're right it should be keeping time and the display should be running constantly. I don't update display with every loop() iteration, instead I check millis() and update every 2 milliseconds. It looks like it made batteries life a little bit longer, but not significantly.

Is there any other way to extend battery life?