Do I really NEED transistors for a seven segment display?

So my project is using three common cathode seven segment displays, and I’ve seen people recommend using them, but more for large displays. The ones I’m using are 35mm tall (the housing) so really not big at all. Do I need transistors at all for this project?

Do I need transistors at all for this project?

Yes, because without one on each display you will exceed the absolute maximum value for the Arduino pin which will have to sink all the current for the segments. This is limited to 40mA then you can only have 40/7 mA per segment.

No, you may not need transistors. Increase the value of the series resistors on the segments to maybe 1K and the current will be within the limits of Arduino pins. If course, the displays will not be very bright. But if the displays are small perhaps they will be bright enough. Try it.

OK, a bit of common sense here! :cold_sweat:

What displays are these? That’s where we start. Give the specification or preferably, a Web link.

If they use one LED per segment which means they require less than 4 Volts, then it is a great waste of time (literally!) multiplexing them using the Arduino. You use a MAX7219 driver which is purpose-designed for this very application, :grinning:

If multiple LEDs per segment, then it’s a whole different ball game! For common anode LEDs, use one TPIC6B595 per digit but for common cathode displays it gets difficult. :astonished:

Not so difficult. MIC2981 to buffer output of 74HC595 to source current into each anode.
Then shift data the '595 similar to shifting data into the MAX7219.

Make up a fontArray to make the bits to the digits to be displayed

byte fontArray[] = {
0b00111111, // 0 with DP-g-f-e-d-c-b-a
0b00000110, // 1
0b01011011, // 2


Standard 7-segment definition:
f b
e c
d DP

Then send the byte to the display

digitalWrite (ssPin, LOW);
SPI.transfer(fontArray[numberToDisplay]); //example:  fontArray[1] sends 0b00000110 to the shift register to turn on b, c.
digitalWrite (ssPin, HIGH);

If there’s only one LED per segment, then I think I would rather avoid using the 24-pin MAX7219 and instead multiplex the displays by segment. One GPIO pin would only need to drive a maximum of three segments, not seven. Furthermore, in addition to not needing transistors, you also wouldn’t need segment resistors - only three common cathode resistors. And the SevSeg library supports this method of multiplexing. But we need a link to the displays so we know what we’re dealing with.

By digit multiplexing every segment is lit for 1/3 of time and pin current is limited to 40/7 mA. By segment multiplexing it is 1/7 of time with 40/3 mA of current. You get average current 40/21~2mA per segment in either configuration. You save a few resistors but spend more time by the multiplexing.