-1
\$\begingroup\$

enter image description here

For light our light filter we need to have RGB LEDs that are controlled via 50% duty cycle 1kHz square wave from arduino micro controller.

Since there are 4 RGB LEDs connected in parallel they draw a lot of current that is given by an external source. We decided to try controlling switching on and off with a mosfet to have 0 current from controller. The issue is that all of the 3 colors share same ground, so whenever one of the mosfets "opens" they all turn on, while we would want only, for example, RED to light up on all 4 RGB LEDs.

If we try to position mosfet before the LED then we are able to select which LED to light up, however the current is significanly smaller (from 20mA drop to 3mA). And also flunctuating Vgs.

For the circuit on the picture Vcc is connected to resistors and is 5V or 7.4V (we can power it from 2 different batteries), Voltage at gate is 5V, Source connected to ground. There are 3 Mosfets corresponding to each color. Voltage drop across RED is 1.9V, Green and blue 3.3V

The question is what would you suggest as the most elegant and simple way of being able to controll LEDs independently and is it possible at all if the LED shares the same ground.

\$\endgroup\$
  • \$\begingroup\$ The issue is that all of the 3 colors share same ground OK, that means can only switch all LEDs on or all LEDs off if you switch in the negative side (which is what you're doing). What you want is to control the RGB colors individually. You can only do that if you switch on the positive side using a PMOS. You cannot do this with common cathode LEDs and an NMOS (ignoring using the NMOS as source follower as that is inefficient). \$\endgroup\$ – Bimpelrekkie Dec 7 '16 at 14:42
  • 2
    \$\begingroup\$ Please post another schematic more useful than this. The supply isn't shown, the leds aren't shown, all we see is a bunch of wires mostly shorted together, a jumper that you never talked about, three strangely connected resistors (?), and the mosfet in the middle of this mess. This isn't something that can be useful as it is. \$\endgroup\$ – dim Dec 7 '16 at 14:46
  • \$\begingroup\$ Sorry for terrible drawing, there is a mistake, pin 2 on jumper is ground, others are going to LEDs and 1, 3 ,4 should not be connected to ground \$\endgroup\$ – Mike Mazowski Dec 7 '16 at 15:16
0
\$\begingroup\$

If excessive current waste isn't an issue then using an N channel MOSFET to shunt away current from it's respective LED is fine. It's easier to drive this way rather than use a P channel MOSFET and (say) a bipolar transistor to control current into the LED. It's also more effective than using an N channel MOSFET as a source follower because you won't get full brightness unless you could raise the gate voltage a lot higher.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.