Controlling anode and cathode on rgb LEDs


I keep running into this problem, and usually I find a work around but cant this time, so thought it best to ask for the correct solution.

I have 4 seperate RGBW led strips I want to control from an arduino. The strip is 12V common anode. I have the pwm pins of the arduino triggering a logic level N mosfet, which sinks the current for each channel. For the sake of simplicity to control, I want all strips to adjust colour levels from the same 4 mosfets, which all works fine.

I then however want to be able to dim each strip individually ,which (not wanting 16 seperate channels) means controlling the 12V supply to each strip’s anode. I could do an on off simply with a physical switch, or a relay, but if I wanted to fade all channels on one strip up and down, this is proving harder.

I tried with a pnp transistor, but they 12V 5V issue meant it never switched off, I don’t have a P mosfet to try, but could I use a P mosfet, wired with 12V to drain and the LED strip downstream of source.

I’ve attached a crude diagram of 1 of the 4 strips (the other 3 would join before the rgbw mosfets) though I did this on my tablet so it’s not the best diagram.

What do you think, can I wire a P mosfet above the draw component? Or is there a better way?

Many thanks!

P-MOSFET usually need a 10V swing to turn fully on and fully off.
A resistor pulling the gate high to turn it off.
A NPN can then be used to pull the gate low to turn it on.
Maybe ULN2803 could be used as the buffer for the Arduino, which is an 8-channel open collector output part.
Or 74LS06.

You could also look at MIC2981 to switch the high voltage on/off, it has 8 channels of high side switching.
You'll have to look at the current needed by the strips; maybe P-channel MOSFET will remain the way to go.

Third diagram on this site shows a high-side switch with P-channel mosfet.
Note that you loose brightness when matrixing (switching one strip 'on' at the time).

Eight mosfets (four N-channel and four P-channel) gets you already half way of proper dimming with 16 mosfets.
I would use a PCA9685 breakout board for the 16 N-channel mosfets,
and the Brunnels library for smoother dimming than an Arduino pin.

Screenshot_20200611-233726_Electric Circuit Studio.jpg

Note that you loose brightness when matrixing (switching one strip 'on' at the time).

Note that apparently this - multiplexing - is not the intention here. :astonished:

I then however want to be able to dim each strip individually ,which (not wanting 16 separate channels) means controlling the 12V supply to each strip's anode.

Assuming you get the p-channel MOSFETs working, there will be another problem to solve. You will be controlling the colour using pwm to control the cathodes, and controlling the brightness using pwm to control the anodes. These pwm signals will, by default, be the same or similar frequencies. If controlled by the same internal timer, they will be synchronised, if different timers, not synchronised, but either way it won't work well or maybe not at all. You need the pwm signals controlling the anodes to be a very different frequency to those controlling the cathodes, ideally at least a factor of 10 different. I think this should be possible with some direct control of avr timer registers, assuming that is what you are using (you forgot to say).

Thanks all for the variety of options!

Seems there is no perfect (or small package) answer for this but lots of things for me to play about with.

Thanks for the thoughts! x