How can I control a 3 x 7 segments display with common anodes?

Hi!

I got a small 7 segments display that can display 3 digits. The problem is that it has common anodes and 3 separate cathodes (One for each number). So if I connect all 3 anodes to ground and some anodes to (+) I'll get the same number on each display.

Image URL

The scheme looks like this. I looked around and I found this IC to drive some sort of my display. I search something similar that could do the same but with 3 digits display and support serial input. My arduino will be pretty busy so it wont have a lot of avilable outputs.

I also though about using D flip-flops but it would require high frequency refresh and I don't know if it would work as it should.

Do you have any ideas how can I drive this dispaly without visible lag?

With this type of display, you are forced to use multiplexing, because of the way the display is wired inside. To minimise the number of pins and complexity of your code and number of extra components required, it's best to use a multiplexing driver chip. Suggestions would be max7219 or ht16k33.

PS. All these types of displays have common anodes and common cathodes, but we refer to them as "common cathode" or "common anode" according to which pins are connected to more segments. In your display, pins a to f are each connected to 3 segment's anodes, but the 3 "ground" pins, as you called them, are connected to 7 segment's cathodes. So we describe this as a common cathode display.

That’s what I though, but I thing that using max7219 would be a huge overkill for such small display. Aren’t there any other (cheaper) methods to controll this display? Like some flip-flops and a small multiplexer?

That's what a MAX7219 is - basically 8 shift registers and the multiplex control.
$1.99 here
https://www.taydaelectronics.com/catalogsearch/result/?q=max7219

Skiermaxhtc:
That's what I though, but I thing that using max7219 would be a huge overkill for such small display. Aren't there any other (cheaper) methods to control this display? Like some flip-flops and a small multiplexer?

You are kidding! :astonished:

The single MAX7219 is the proper way to do it. (The HT16K33 is fine too, but the MAX is easier.) "Some flip-flops and a small multiplexer" - whatever that random choice of parts means - would not only be more difficult to arrange and not do the job properly, but would in fact be more expensive. :roll_eyes:

TM1637 is another option which you could say is less overkill, because it only drives 4 or 6 digits, not 8. But try looking for that chip to buy at less cost than max7219. All I can find is modules with the display soldered on, and you want one to drive a display you already have. TM1637 does not have a standard interface like max7219 (SPI interface) or ht16k33 (i2c interface), so the Arduino pins used can't be shared with other sensors, displays etc.

My arduino will be pretty busy so it wont have a lot of avilable outputs.

How many pins can you make available to drive the display? With 6 Arduino pins, you could control a 74hc595 and 3 npn transistors such as bc337. 10 resistors would also be needed. The results would not be as good as using a max7219. With 10 Arduino pins, you could drive the display with only 3 npn transistors and 10 resistors. Again, the result would not be as good as max7219, but it might be good enough.

Alright guys, thanks for help. I was searching on mouser.com where max7219 is for like $8, that’s why I’m asking if there is no cheaper option. Anyway I guess I’ll stick with this IC. Right now I’m using 19 pins on my arduino so I think I’m forced to use arduino nano, except if there is a way to save some pins on rotary encoders, because currently I’m using 4 of them which makes 8 busy pins.

Anyway, If I stick with nano, I’ll have 3 free pins. I guess it’s enough to drive the max7219 which requires only Data in, Clock and Load?

Mouser will only sell genuine max7219 because they have a reputation to protect. Most forum members buy the clones, because the price is reasonable, given the level of tech involved. After all, why would you pay more for a simple led driver chip than you would pay for an entire raspberry pi zero? The clones generally work fine.

PaulRB:
After all, why would you pay more for a simple led driver chip than you would pay for an entire raspberry pi zero? The clones generally work fine.

Guess you're right, but where to buy them? Previously I bought some MSGEQ7 on aliexpress and I was kinda disappointed (they didn't work at all from two different sellers). Are there any "clone" sellers that are worth my money? A chinese shop or European one.

Buy your parts from reputable sourcres, such as Mouser for MSGEQ7.
https://www.mouser.com/ProductDetail/SparkFun/COM-10468?qs=%2Fha2pyFadugY6HA7DXLlzSr8jPXTtlRrz8LdeIHXYjI%3D

Oddly, Mouser shows Sparkfun as the OEM for the MSGEQ7.
These guys are the real OEM as far as I know:
https://mix-sig.com/index.php/msgeq7-seven-band-graphic-equalizer-display-filter

I buy multi-chip lots of MAX7219 from TaydaElectronics, have not had a problem with them, even tho they are clones (packaging difference from genuine Maxim, and when I asked Maxim about them (a while ago, posted this in the forum even) I was told that Tayda is not an authorized distributor).

Skiermaxhtc:
Guess you’re right, but where to buy them? Previously I bought some MSGEQ7 on aliexpress and I was kinda disappointed (they didn’t work at all from two different sellers). Are there any “clone” sellers that are worth my money?

Well, the MSGEQ7 is nowhere near as popular with experimenters as the MAX7219s and I have certainly not pursued them.

The problem here is this:

Skiermaxhtc:
I got a small 7 segments display that can display 3 digits.

This is a sort of “cart before the horse” problem.

Although her prices have recently inflated substantially for what is probably a fairly obvious reason and she frequently posts bogus “auctions” (there is one at the moment!), most here have generally found “Alice” reliable. buying a MAX7219 to match a display you already have is just not sensible! Essentially, you have an orphan part.

If you want a display, this is what you buy:

There! It’s done!

Before the postage charge appeared, it was just US$1.85 shipped to your mailbox. There are other versions of this module, but if you only want four digits, you just pull off the second display because they are socketed - it makes no difference to the operation and you code it for only the four digits you want. If you only want three digits, just mask off the fourth but seriously, you don’t only want three digits, do you? :grinning: In fact, I doubt you would say “no” to eight digits; you can have a lot of fun with that.

There are other, smaller four digit modules, equally cheap, some configured as a clock display, using the TM1637 and requiring two dedicated pins to control so if that is what you want, search on TM1637 (or here it is for you! :roll_eyes: ). Either way, you do not sensibly build a display; you just buy it.