0
\$\begingroup\$

I would like to control several high power DC devices (12V DC LEDs). From a tutorial, I found that I can control these using a 3.3V PWM input and a MOSFET. From what I understand, the MOSFET only allows current to flow through the LED to ground when the PWM input is high.

I have several (lets say 4) of these LEDs and want to be able to select which one I am controlling. If I could activate the LEDs directly using the 3.3V PWM, then I would probably try to do something like this:

  1. Get a 2 to 4 bit decoder.
  2. Connect 2 output pins from the controlling device to the 2 select pins of the decoder.
  3. Get 4 AND gates.
  4. Using the AND gates, AND together each of the 4 outputs of the decoder with the single PWM output from the controlling device.
  5. Connect the outputs of the AND gates to the LEDs.

I think this would work (please correct me if I'm wrong). If I got one MOSFET per LED, then this approach could still work with the higher power devices that I can't directly control. My two questions are:

  1. Does this approach make sense?
  2. Is there a way to accomplish this using only a single MOSFET?
\$\endgroup\$
4
  • \$\begingroup\$ How much current will each load need? What PWM frequency do you intend to use? \$\endgroup\$
    – alexan_e
    Mar 2 '14 at 21:24
  • \$\begingroup\$ Is the load current level a secret and you refuse to share it with us? All the replies have to rely on guesswork of the intended current. \$\endgroup\$
    – alexan_e
    Mar 2 '14 at 22:24
  • \$\begingroup\$ @alexan_e Haha no it is not a secret. I was trying to figure this out. Right now it looks like 200ma to 300ma. I do not have the LEDs yet. \$\endgroup\$
    – mushroom
    Mar 2 '14 at 22:43
  • \$\begingroup\$ The high power in the title made it sound like if it was intended for a led string that needs several Amps or some kind of multi-watt power led. \$\endgroup\$
    – alexan_e
    Mar 2 '14 at 22:49
1
\$\begingroup\$

You can skip step 3 if you get a decoder with an enable input, e.g. 74HC238. Connect the PWM output to the enable input and this will switch the decoded output on and off with the PWM signal. You will still need one sink per device you want to switch though.

\$\endgroup\$
7
  • \$\begingroup\$ Thanks for your response. I do have 74HC238s. So, no way around the multiple MOSFETs? \$\endgroup\$
    – mushroom
    Mar 2 '14 at 21:32
  • \$\begingroup\$ You need some sort of high-voltage sink. So not a MOSFET per se; you could use e.g. a ULN2803A. \$\endgroup\$ Mar 2 '14 at 21:33
  • \$\begingroup\$ Hi Ignacio. I am looking at the datasheet for the UNL28038A and am trying to figure out how this is interchangeable with the MOSFET. Would I apply the PWM signal to the B inputs and connect the C output to the negative side of the LED? Could you describe how they are interchangeable? \$\endgroup\$
    – mushroom
    Mar 4 '14 at 0:54
  • \$\begingroup\$ That is correct. The NPN darlingtons in the '2803A perform the same low-side switching as the NMOSFET in the original circuit; the important part in the circuit is the switching, not the MOSFET. \$\endgroup\$ Mar 4 '14 at 1:48
  • \$\begingroup\$ I have managed to screw this up somehow. Could you describe a circuit, show a diagram, or provide a link explaining how to use the ULN2803A to switch the LED? I have an external 12V power supply. In my current setup, the light just stays on forever regardless of how I set the PWM signal. \$\endgroup\$
    – mushroom
    Mar 5 '14 at 1:58
1
\$\begingroup\$

Why don't you look for an analogue multiplexer that can run from a 12V power supply and has low on-resistance and can take the current for one LED. You haven't stated the LED current so this approach may not yield a definite result.

This one might work for you: -

enter image description here

If you use the correct package 200mA is the max current but you might be able to current share with two devices. It all totally depends on the LED spec. There are possibly higher power multiplxers as well.

\$\endgroup\$
1
  • \$\begingroup\$ This is a great idea but I happened to have all the materials necessary for the accepted answer. \$\endgroup\$
    – mushroom
    Mar 5 '14 at 3:29
0
\$\begingroup\$

Does this approach make sense?

Yes, it might work.

However, the real question is if this is what you really want. Being able to choose a single LED to power at a time is less useful than being able to power all LEDs simultaneously. And the fact is that this latter version is simpler and requires less components, while providing more flexibility. So I see no point in doing the original version.

Is there a way to accomplish this using only a single MOSFET?

Only if the LEDs are of so little power that an IC is enough to power them (15-20mA/output). Power LEDs usually require larger currents, for which you need some external power switching device (a MOSFET or a transistor).

\$\endgroup\$
4
  • \$\begingroup\$ They're 12V LEDs. Unless you're using CD4k (which won't have enough drive strength anyway), you need a driver. \$\endgroup\$ Mar 2 '14 at 21:43
  • \$\begingroup\$ I was trying to conserve output pins on the controlling device. In order to power all of LEDs simultaneously, would I then have a to use a single output pin of the controlling device per LED? 2 vs 4 is not a huge deal, but when I start getting into higher numbers of LEDs then it would start to make a big difference. \$\endgroup\$
    – mushroom
    Mar 2 '14 at 21:49
  • \$\begingroup\$ Using a single output pin per LED is a very easy way to do it. For 4 outputs, there's no point in complicating it further. For a larger number of outputs, there are clever ways to manage many outputs through only 2-3-4 output pins (74HC595 is the key to search for). For your original concept, you need actually 3 pins: 2 for selection, 1 for PWM output. You could directly control each LED, so then you need 4 output pins (each providing a PWM signal for that LED). \$\endgroup\$ Mar 2 '14 at 22:16
  • \$\begingroup\$ Yes, but it only needs 1 PWM output instead of 4. \$\endgroup\$ Mar 2 '14 at 23:06

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.