I'm trying to put together a dimmable light for an aquarium. I am using an LM350T to create a constant current source and an RFP30N06LS MOSFET as a switch. The LEDs will be driven with 625 mA of current, the only thing I haven't figured out how to do yet, is to calculate the size of the resistor that will go between the Arduino PWM output pin and the MOSFET.
My circuit looks like this (please excuse the poorly drawn kpaint file):
Any tips on how to calculate the value for the resistor (R1) and/or critique of my circuit would be greatly appreciated.
What about 470 ohms? This will limit the current to healthy 10mA. If your PWM frequency is not to high this should be sufficient. Anyway in your setup I would stick to a plain old BPT.
Thanks. So the only calculation I need is the I = V/R and keep the current down low enough so I don't burn out processor?
As for the transistor itself, how do you know when to choose a BPT or a MOSFET? I went with the MOSFET because initially I was going to be running 1 A through the circuit but, when I tried it this morning, the LED got very hot, that's why I decided to drop the current to 625 mA. Is 1A or 625 A still low enough that a BPT would have been sufficient? I've already picked up and soldered in the MOSFETs, should I yank them out or will they work just as well?
Yep, you should not burn the processor. You want a low resistor though in order to charge the gate capacitance as fast as possible. If the FET has a very high capacitance and you have a high PWM frequency you even need a dedicated driver.
No, I would stick to the MOSFET if it is already soldered. In general BPTs are less sensitive to static and they are cheaper. So if you have just 625mA a cheap BPT would have done just as well. Actually your whole circuit is so uncritical it just does not really matter at all. Almost anything would do.
You will have problems with that circuit because the voltage drop of the LEDs and the LM350T will reduce the mosfet gate-source voltage to less than it needs. You should connect the led stack and LM350T between +12 and mosfet drain (i.e. LM350T IN to +12v and the last LED to mosfet drain), and connect mosfet source to ground instead.
R1 is not critical, I suggest 220 ohms or thereabouts.
Is that because the Arduino output pin will be at ~ 5 V and the MOSFET source will be at ~ 11V and the MOSFET requires ~ 0.7 V between G and S to operate?
That means the circuit should look like this:
Is there any risk that, while there is no voltage applied to the output pin of the Arduino, current will feed through from the drain to the gate and into the processor?
Is there any risk that, while there is no voltage applied to the output pin of the Arduino, current will feed through from the drain to the gate and into the processor?
No, but a good practice is to wire a 10k ohm resistors between the mosfet gate and source terminals, this will ensure that the mosfet turns off if the arduino is powered off but the +12vdc is still on.
I'd connect the 10K resistor from the Arduino pin to ground rather than the gate to ground, to ensure the mosfet gets the full 5v drive from the Arduino and therefore has the lowest possible on-resistance.
There is a chance that the LM350T may not like being driven at the PWM frequency or may require a decoupling capacitor, but I don't have enough experience with that device to know whether this is likely to be a problem.