Electronic – arduino – Controlling Power LEDs through multiplexer

arduinoled-drivermultiplexer

I'm working on a circuit to control some number of 1W Power LEDs with Arduino. I used the constant current driver with MOSFET from here: http://www.pcbheaven.com/userpages/LED_driving_and_controlling_methods/ but connected the MOSFET gate to Arduino output pin – and it worked like a charm.

But because I need to control more LEDs than Arduino output pins, I added multiplexers in-between. The complete circuit looks like this:

no_pulldown

The control logic on Arduino is straightforward and simply outputs HIGH to the common output and appropriate address to A/B/C pins. The problem is that when switching between LEDs they don't turn off completely. They behave as if the the output from the multiplexer was left floating, even though the tech sheet (http://www.ti.com/lit/ds/symlink/cd4051b.pdf) says that inactive pins should get '0'.

It seemed like a reasonable idea to put a resistor between the MOSFET gate and the ground to pull it down, like this:

pulldown

and it does work just fine, but I have two questions:

  • why didn't it work properly without it? which part of the multiplexer tech sheet actually indicates that I need that resistor?
  • what should be the value of R3? I had 100kOhm at hand, so I just put them in, but I would much rather have something chosen based on R1/R2/Q1/M1/V1. Same question for R2 actually – what does it influence? just the switching time for M1?

Best Answer

The datasheet for the CD4051 shows that both ON and OFF there will be +/- leakage current on the output pins. This tells you that the voltage present on an output pin can be EITHER high or low depending on the leakage current. It is no '0' which is a digital state.

Your addition of the 100 kohm resistor simply provided a path for enough of the leakage current to ensure the output was low enough to cutoff the FET.

enter image description here

You would be much better to use a digital device such as the 74HCT595 serial shift register to achieve your goal. With this device you can serially shift out the state required for each of your LEDs and then transfer from storage to output using the STCP transition. You'd need only 3 MCU pins to do all this and with the /OE set low you get definite high and low signals for all channels.

One potential negative is that the 74HCT595 does not work at 9 V ….so this would need to be powered from the Arduino 5 V supply.