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:
- Get a 2 to 4 bit decoder.
- Connect 2 output pins from the controlling device to the 2 select pins of the decoder.
- Get 4 AND gates.
- Using the AND gates, AND together each of the 4 outputs of the decoder with the single PWM output from the controlling device.
- 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:
- Does this approach make sense?
- Is there a way to accomplish this using only a single MOSFET?