How many numbers with MAX7219CNG?

I'm looking to build a set of gauges that display values using 7-segment LEDs. Each set will display four different numbers (like temp, voltage etc) simultaneously, so I'll need 10 7-segment LEDs (2x 2-digit and 2x 3-digit).

I know the MAX7219CNG can drive up to 64 LEDs, so I'll need more than one. But do I need one chip per number (so four in total), or can one chip handle two values simultaneously?

If you Google;

max7219 7 segment

You will see many examples.
You can also get this module;

There is also a library for it, you have control of each individual 7seg display.

Tom... :smiley: :+1: :coffee: :australia:

one MAX7219 can drive up to 8 digits. So you would need at least two ICs.

The IC doesn't care about what you send, so it's up to you to print on the positions you want to have.

BTW: some time ago I've adopted the "LED Control library" to show numbers (and characters) a lot easier by reusing the print.h classes. Additionally I've added support for HW-SPI which will speed up the communication with the IC.
You can read about that modified library here

Thanks all. I found the pinouts for the chip and discovered that there's an individual pin per digit, then pins for the A-G segments, so it's just a matter of finding the right tutorial to get my head around all the available options. Last time I played with segment LEDs I was using shift registers, so this chip is a new method for me.

The datasheet will show you how to wire your custom display.
Nevertheless I would start with a module like suggested by TomGeorge.
You can proof your software with the premade module.
Afterwards switch over to your custom build.

The trick is to use two of the modules illustrated, use only the digits in the places you need, and mask out the other digits so you have the appearance of four separate displays where there are actually only two.

Cheap and effective. :+1:

Thanks all for the support, and thanks especially to noiasca for his library that expands the LEDControl options. I already had components at hand, so I've been able to build a breadboard prototype to explore a few options

All it does is measure values from a pair of voltage dividers and show them in different numbers, but ultimately that's all I need to do. The unused numbers will measure a third variable resistor, and the fourth numbers I need will be shown on a separate 3-digit display, driven either by another max7219 or maybe just using a shift-register-based solution.

Code attached (1.7 KB)

1 Like

With a little creativity, you could show 9 digits with one MAX7219, using the DP from each digit for the segments of the 9th digit. (9 x 7 = 63, so there is even one bit to spare).
You'd have to wire up your own digit, a premade board won't do it.

wow. you made it already working. Congratulation.

Two things:

  • consider to use HW-SPI - at least give it a try.
  • and regarding:


lc.print(converted1, 1);

it might be enough if you just want to display one decimal of a float.

Thanks for your helpful comments noiasca. About this:

It works, but the behaviour is subtly different. With dtostrf I am declaring 4 characters (inlcuding the decimal point), which places the float character on the right digit of my 3-digit display at all times, even if the number is less than 10. With lc.print, the left digit always takes priority, so the right digit is blank/off if the number is less than 10. For my purposes I'd rather keep the dtostrf behaviour.

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