cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting 3 digit 7 segment display (common cathode) to stm32

Matija1
Associate II

Hi everyone,

I’m planning to connect a 3-digit 7-segment common cathode display to my STM32 MCU. The display will be multiplexed, and I intend to use 2N2222 NPN transistors to switch each digit (common cathode). Each segment will have its own current-limiting resistor.

For safety, I’m designing for If = 10 mA per segment instead of 20 mA. I’ve attached my resistor and transistor current calculations (see attachment). I used 3.3 V as Vcc, because GPIO Output HIGH is 3.3 V. Ignore resistor value on shematic.

Could you please check if my calculations and connection approach are correct, and confirm whether using 2N2222 transistors is suitable in this case? I’m also a bit concerned whether 3.3 V will be enough to properly drive the display.

WhatsApp Image 2025-10-06 at 21.13.48.jpeg

Matija1_0-1759776516134.png

Matija1_1-1759778334404.png

 

 

2 REPLIES 2
gbm
Principal

1. What color? It makes a big difference. Ordinary low-brightness red is not a good choice.

2. NMOS logic level transistors will be better then npn. You will save on base current this way.

3. In low ambient light conditions (on-desk use) you may skip the transistors by setting the anode current to approx. 3..5 mA. This will work very well with high-brightness red, yellow and pure green despite what the display datasheet says.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
bestiem
Visitor

let me try