Switching between several high power DC devices

dcdigital-logicmosfetpwm

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?

Best Answer

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.