I'm working on my first ever PCB, and would like to include two 7-segment displays. The device will be powered from mains, so power consumption is not an issue. I have chosen the Broadcom HDSM-293L, with a forward voltage of 2.1V and a maximum current of 25 mA per segment.
The microcontroller I'm using is an STM32F030K6T6, which should be able to deliver 25 mA per pin.
To be able to show seperate digits on the displays I need to be able to toggle the common cathode outputs, but the uC can't sink the current of several LEDs into a single pin, so I'm using transistors for this purpose - a subject I'm not entirely comfortable with. Online tutorials have told me that BJP NPN's are suitable for the purpose, so I've chosen the ON Semiconductor MBT3904DW1T1G, a package of two such transistors suited for 200mA.
The below schematic shows how I've wired GPIOs from the microcontroller through 56Ohm resistors to each anode, and connected the cathodes to the collector of the transistors. I've also connected GPIOs through 1K resistors to the transistor gates.
Is this a sensible way of powering the 7-Segment displays? Are the components I've chosen suited for the task? And is everything correctly connected safe in terms of amount of current?
Thanks for any help!
EDIT: Several people in the comments pointed out that the maximum sourcable current across all the IO pins of the STM is 80 mA. To address this, I'd like to change out the LED resistors for 120 ohm ones, which should reduce the current draw for each segment to 10 mA for a maximum of 70 mA at a time (I don't need the dots).