issue with PNP transistor // pwm control appears to be in reverse?

i am just working on a little project involving some common cathode RGB led's. I am using the following schematic

which works great at lighting up the led, however i only just noticed that it actually works in reverse. i.e. when I send a value of 0 it will light up to maximum brightness and when I send a value of 255 it is totally dim. I am confused, and not totally clear what is causing this problem? is this an issue with using PNP transistors? am totally baffled, but also sure that it must be a fairly easy solution, just can't figure it out and the internet is not proving too helpful..

any ideas?

PNP - low on base turns it on, high on base turns it off. PNPs "like" to source current into a load - high side driver.

NPN - low on base tursns it off, high on base turns it on. NPNs "like" to sink current from a load - low side driver.

If connecting to 12V, required method is that pullup resistor to 12V supplies the High to turn the base off, and NPN is controlled by Arduino to bring PNP base low to turn it on.
All power supplies need to have grounds connected to provide common reference point, unless power/Gnd are using optoisolators or transformers for separation.

Yeah... A transistor is an inverter.

i.e. If you build a single-stage audio amplifier, it's gonna invert the signal (which has no effect on the sound unless you invert the right channel and not the left, or something like that.)

thanks for the swift replies!
yes, makes sense now, annoyingly I need to use Common Cathode LED's otherwise it seems like it would be a lot easier.
@CrossRoads => you don't by any chance have a schematic of sorts to help illustrate the required setup? am i correct in understanding i need to have a PNP and NPN transistor in place? side by side.. one controlling the other..?

You are correct. Here's a couple examples. NPN controls the PNP turn-on, pullup resistor controls the turn-off.

R3 limits the current into the PNP base for turn on, R2 limits the current out of the base for turn on.

Or just invert your logic (Low = on) (High = off) PWM aka analogWrite(pin,0) = Full on... analogWrite(pin,255) = Full off.

Or just invert your logic (Low = on) (High = off) PWM aka analogWrite(pin,0) = Full on... analogWrite(pin,255) = Full off.


Just remember if you are using that circuit, the common reference point is +Vs so DO NOT connect two grounds.