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:
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:
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?