This application calls for a transistor to operate in it's linear region, and not as a switch.
Use an NPN transistor. The base gets connected directly to RC5, The collector to 9V and the emitter to the LED Anodes. This will accomplish your objective of having the current come directly from 9V instead of your small regulator. The NPN effectively becomes a regulator as it's emitter will be either a diode drop below 5V (4.3V or 4.4V) when RC5 is high, or 0V when RC5 is low.
The voltage across the transistor when it's on will be 9V - 4.3V = 4.7V Multiply this by the current flowing to get the power dissipated by the device, and if it is too high, then choose a resistor, based on the maximum current, and put it between the collector and 9V to move some power out of the transistor and into the resistor. (I doubt you will need to do this).
As a side note, the LED will maintain brightness down to about 6V without any adjustment of pulse width, so if this is the only reason for the PWM then you could connect the base directly to 5V instead of RC5. However, left at RC5 you can still dim the LEDs for aesthetic reasons, and power savings.
Bookmarks