MAX7219 pulse visible but all LEDs stay on

Hi everyone,

I have a little problem with my first 8x8 matrix using a MAX7219 and an arduino pro mini.
Wiring seems ok, but my problem is that all LEDs stay on no matter what code I input into the arduino.

I have tried a simple pulse for only a few LEDs, but it result in all LEDs being On, with a slightly brighter pulse on all LEDs.

Anyone has an idea where the problem could come from?

Thanks in advance

Here is my code:

//We always have to include the library
#include "LedControl.h"

/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 12 is connected to the DataIn 
pin 11 is connected to the CLK 
pin 10 is connected to LOAD 
We have only a single MAX72XX.
*/
LedControl lc=LedControl(12,11,10,0);

/* we always wait a bit between updates of the display */
unsigned long delaytime=100;

void setup() {
 /*
  The MAX72XX is in power-saving mode on startup,
  we have to do a wakeup call
  */
 lc.shutdown(0,false);
 /* Set the brightness to a medium values */
 lc.setIntensity(0,8);
 /* and clear the display */
 lc.clearDisplay(0);
}



void loop() { 
//switch on the led in the 3'rd row 8'th column
//and remember that indices start at 0! 
lc.setLed(0,2,7,true);   
delay(50);
lc.setLed(0,0,1,false);   
delay(550);

}

You need a 10k pull-up on the latch or "CS" line.

Now, did you purchase this as a module on eBay?

A number of such have been sold with the wrong matrix module; it is the "reverse" version with cathodes swapped for anodes. The matrix is perfectly functional but clearly will not work with the particular PCB design.

It is possible to use flying wires to swap the connections but that makes the module rather ridiculous. This wrong version will light all LEDs brightly (not actually a good thing) with no code running at all and with the 10k pull-up on the "CS" line. Note that the correct module will sometimes start up all LED lit without that pull-up, but will then function correctly if the code is right.

If you have been sold the wrong module on eBay, claim a refund - but keep the module and display for other experiments.

I don't have a 10K pull-up on the 8x8 LED matrix I have and they work.

Yes, they work.

How often do we hear that here! :roll_eyes:

This point is - his does not work.

There is therefore a fault-finding procedure to be followed, and excluding one common cause of a fully lit display will potentially save many needless back-and-forth volleys.

Is there a 10K Rset resistor, and 10uF and 0.1uF caps from the supply pin to Gnd?

I dare say we will know when and if he ever comes back to explain just what it is he has.

Paul__B:
Yes, they work.

How often do we hear that here! :roll_eyes:

This point is - his does not work.

There is therefore a fault-finding procedure to be followed, and excluding one common cause of a fully lit display will potentially save many needless back-and-forth volleys.

I am saying that it is most likely something else since even without the pull-up/pull-down for LOAD and the filtering capacitors, my board worked. My components were cheap components bought on eBay.
I added the resistors and capacitors later. :confused:

In all likelihood, he has the column-anode 8x8 and not the column-cathode 8x8 that has many tutorials written for it for the MAX7219.

For whatever reason, I see more of the column-anode 8x8, and they are cheaper.

ieee488:
I am saying that it is most likely something else since even without the pull-up/pull-down for LOAD and the filtering capacitors, my board worked. My components were cheap components bought on eBay.

And as I said - we are talking about pragmatic fault-finding procedure.

It most likely is something else, and specifically the display with the wrong polarity according to the original description. The fact of the matter is however, that with long interconnecting leads that pick up mains interference, without that pull-up it is not uncommon for the display to be written to all-on at switch on and if the connections to the Arduino - or the code - are also incorrect and it fails to be controlled, then it will not be cleared.

That is why the pull-up is important; simply to exclude such a confusing possibility.

Paul__B:
And as I said - we are talking about pragmatic fault-finding procedure.

It most likely is something else, and specifically the display with the wrong polarity according to the original description. The fact of the matter is however, that with long interconnecting leads that pick up mains interference, without that pull-up it is not uncommon for the display to be written to all-on at switch on and if the connections to the Arduino - or the code - are also incorrect and it fails to be controlled, then it will not be cleared.

That is why the pull-up is important; simply to exclude such a confusing possibility.

I prefer to deal with the more likely scenario when troubleshooting.

The circuit is very forgiving if I am able to get it to work without the filter caps and the resistor.

Hi all,

Thanks for all your inputs. Sorry for late reply.

I haven't bought the matrix already made. For the project I am doing, I will be driving around 180 Leds, so I am only using the Max7219 (well eventually 2 or 3) for multiplexing purposes and run a simple code that will light the leds alternatively. There's probably a simpler way to do that, but I thought it would be cool to play around with an Arduino and learn about multiplexing.

I have wired and soldered all the cathodes and anodes to a basic board (yes it took a while). Following your advice I have inverted the cathodes and anodes and it seems like all the LEDS have turned off. The diagram I found had the cathodes and anodes inverted..

Anyway, will now retry to put everything together now that I have the right capacitors and see how it goes.

I'm a beginner and still trying to get my head around currents and voltages, but have read to never run leds directly on digital arduino pins.
I didn't know this. I have however successfully ran 10+ leds per pin without any resistor. I know this is bad and should'nt be done, but how is this possible? I have managed to light 64 leds all at once too without multiplexing. How is this possible since 20mA x 64leds is way above what the USB current is supposed to deliver?

Im using an Arduino Pro Mini connected to a computer via USB and a serial converter. Leds are clear and light yellow. Ebay specs show 2v - 20mA.

Just a quick update to let everyone know that this is now working. Thanks for your help.

I realise this topic has gone without activity for a while but I thought I would reply to it in order to help others who may chance upon this thread too.

I had recently built a large dot matrix display panel (8x8x22) from the modules available from this supplier. While the line of matrix modules initially (sorry for the unintended pun here!) worked immediately when powered solely from an Arduino UNO, I found after several power cycles, it would eventually only light all LED's, across all the 22 modules, i.e. without any matrix animation, e.g characters etc; Powering the display from an external PSU didn't help - the display permanently stuck on across all modules, with all LEDs fully lit up.

I added a 10K ohm pull up resistor between the LOAD (CS) line and +5v VCC from the UNO and this cleared the problem and now I'm able to run the display with full control and no further fully simultaneously alight LED modules. It also didn't help to find two of the display drive DUPONT cables were broken, thus confusing fault finding further!

Anyway, subsequently, I can run this 22 unit long matrix module all day every day from a single Arduino UNO without the need for an external PSU or any other form of power assistance.

In addition, the UNO also powers a GPS device from the Arduino UNO +3.3v line via a bi-directional level shifter. Moreover, the UNO also has a CAN BUS shield mounted to it for communication with the CAN BUS in my car.

The Arduino doesn't appear distressed in any way. Even so, I will eventually take some of the load off its shoulders and fit an external power buck when the vehicle telemetry prototype is more finalised for placement in my car.

All the best,

M.

The "barrel jack" feeding the on-board regulator can mange something of the order of 200 mA before the regulator thermally shuts down, hopefully non-destructively. And that is if it is supplied from a regulated 7 V. He ("Ryme_Extrinseca") refers to using it in a car so I would expect (since he did not explain) that he might be powering it from 12 V. He makes reference to an "external PSU" but of course, an Arduino has no "internal" power source so he must be supplying it from something that he presumes to be self-evident and my guess is the USB socket. :grinning:

The USB input can supply at least 500 mA, and perhaps something up to one Amp depending on the behaviour of the polyfuse.

The modules cited by the way, are the standard F-16 design. Useful to know for Marco's software.

OK, I stand corrected. Thanks Paul. I will delete my posts. @Ryme_Extrinseca, please forgive my incorrect advice. Carry on as you were, everything is fine.

No worries, PaulRB. I'm also not sure why 'Paul__B' seems so cross. It's only a tinsy winsy Arduino - hardly a multi-million pound super computer - thus nothing more than a hobby toy thingy without any commercial interest at all. My project is merely fun and distraction while I recover from major surgery. One would hope that hobbyist enquiries, on a hobbyist site like this, would invite more casual and less intense but more helpful comment. Goodness knows what I have to face in my line of work if I retorted to some of the abuse (physical and verbal) I take in the course of my day to day work. Surely, many are here to merely learn and have fun? I share my experience working on my project so that others can either take it or leave it or share the interest at some other level, should they choose to.

Anyway, at the time I metered the Arduino +5 v Vcc line and read off I think around +150mA at maximum display content, i.e. all modules lit ('88888888888888888888888') at full 'intensity' (15). The 'quiescent' current (so to speak), i.e. nothing on the display, is less that 40mA. As pointed out by 'Paul__B' I'm only using USB tethered to the UNO. Also, as I mentioned previously, I will consider a power buck or similar convenient power source once I'm fit enough to integrate all of this into my car.

As far as this project goes, I'm not throwing elaborate graphics or such like a the matrix. Simply, the matrix strip (comprising of 22 LED matrix modules mentioned above) displays content in the order as follows:-

PLEASE KEEP YOUR DISTANCE
SPEED KILLS!
30 MPH ZONE
nn MPH
6 9 2018
11:30am
Ambient Air Temperature nn C
Direction Bearing nnn Degrees

All of the above 'telemetry data' is taken from a mix of GPS and CAN BUS signal sources.

The above characters making up those sentences 1 thro 3 are sequentially scanned across the matrix strip when I drive through a 30MPH zone.

Else, sentence No 4 runs most of the time while I'm driving.

With a randomising algorithm, sentences 5 thro 8 intermittently interrupt the MPH display when the vehicle is stationary and read out those parameters, i.e. date, time etc;

I'm currently working to try to squeeze in time management code which will convert the simple '6 9 2018' format into something more meaningful, i.e. '6 September 2018' instead. However, I'm already at the limits of the UNO memory, so eventually I will have to change to a MEGA to add more code to carry out more functions. The UNO also carries a GPS module and a CAN BUS shield, so it should have its work cut out with the matrix loading it too.

Either way, the UNO sits happily running all the above and has so over the past month, all day every day, churning out all that useless information pending more formally mounting it in a display frame for the rear window of my car.

When I'm well enough, I plan to make a YouTube presentation of the making of my project. so that anyone who is interested can share in the fun I have had making this project and the reasons behind it. Since I drive well in excess of 20,000 miles per annum in the course of my work (I'm a RGN these days), I'm tired of drivers tailgating me when I'm trying to adhere responsibly to speed restrictions and caring for other road users safety. I live in a County which also has some of the highest statistical incidences of drivers speeding. Besides, it's not pleasant caring for patients coming through A&E after being on the receiving end of careless/inconsiderate drivers' actions. So, even if my project serves no other purpose but to irritate drivers driving too close and tailgating me, at least others with a deeper conscience will be reminded of their responsibilities when driving in adherence to road users and their safety.

All the best,

M.

Only 150mA for the whole 22x8x8 display? That does not seem like very much... You said intensity is set 15. To display a figure "8" would probably take 14 LEDs? Combine that with the 1/8 multiplex ratio would mean that only around 38~39 LEDs are lit at any instant. That's less than 4 mA per led. The max chips are capable of 10 times as much current, if pushed to the limit. Are you finding them bright enough in full sunlight? I wonder what value of current-setting resistor these modules have...

Beats me!

I gave out the readings from my ammeter (Fluke Model 73). I can't be bothered to scope the activity on the data lines. I see no point anyway.

The brightness is fine for what I want it for, I'm not looking to burn my eyeballs out just yet. The modules appear to have a SMD chip resistor which set the current limit on each module and that's the way they'll stay.

The UNO has been running for a month, day and night, cycling through the values I also mentioned without any issue. Having said that, I had a batch of duff Dupont connectors which played merry hell with the display at one point. I solved that with a codged-up shield-type PCB interface that plugs the UNO directly to the back plane of the LED matrix strip.

On reflection, I think if I were to carry out this project again (and I wouldn't) then I would source the matrix modules from another supplier. I thought the ones I used for my display are s***e frankly. For example, the first batch came without any screen printed on the PCB!

73,

Mark

Hi Everybody !

I build myself a news ticker out of max7219 8x8 matrix modules ,ran by a raspberry pi zero.
with my first prototype I discovered that sometimes at power ON all modules (4x4 modules) light up and the pi zero is in a boot loop as the voltage drops too much.
I worked around the problem with adding a solid state relay,so the pi zero can turn on /off the matrixs on its own (after boot up,and running a python script to clear the matrix)... that works flawless.Positive side effect => the whole thing uses even way less power when in nightmode (wifi&ssr off) than before without the ssr and just wifi off and no use of the matrix display.

Now with protype 2 ,I managed to pack 31 8x8 modules into a super thin aluminum housing (1m @ 20x32mm).Everything is packed into the small room behind the matrix modules (even the pi zero !!).Even a small smd buzzer,and 3 different usb sockets (left/middle / right) had to fit in :slight_smile:
But now the same problem as said above appears here again.. sometimes when pluging in the power,all modules light up,and again a boot loop.(even when using a 3A usb power adapter).When I unplug and plug in again,sometimes a few modules wont light up,and then the raspi can boot,and clear the leds at the earliest time (@reboot@cron).

Now I tried a pull up resistor 10kohm (CS => 5+),but its all the same :frowning:
And there isnt any room to integrate a solid state relay behind the matrixes

Any ideas what I can do (and keeping this small form factor) are HIGHLY appreciated !!!

Use an adequate power supply.

Also, run some power supply "bus" wiring with decent cable, to supply power every 8 modules.