I am trying to design a dimmer circuit with the arduino and the lamp on a different power supply. This is my first time trying to design something using Eagle so go easy on me, but please feel free to critique my schematics =)
After a lot of research into the topic, I have a few questions that I hope you guys can help me with:
Do my circuits work? (First things first I guess)
Is my assumption correct that when using the second schematic, once the Arduino pin is low, the lamp is turned off, however not so when the first schematic is used?
How exactly is R1 and R2 calculated?
As far as I understand one does not need a fly-back diode for a lamp. However if you would like to install one in case the circuit is used for a motor, Is my assumption correct that it will be connected in parallel with the lamp?
Is it necessary to smooth the pwm out from the mosfet? Would it increase the life of the lamp? Similarily would that reduce the high frequency noise that some dimmed lamps make?
Is there anything else I should consider?
Mosfet IRF1010ZPBF: http://www.irf.com/product-info/datasheets/data/irf1010z.pdf
Optocoupler 4N35: http://www.vishay.com/docs/83717/83717.pdf
- Do my circuits work? (First things first I guess)
First one will, second on probably not as there is no active pull-down to turn off the MOSFET.
- Is my assumption correct that when using the second schematic, once the Arduino pin is low, the lamp is turned off, however not so when the first schematic is used?
Correct to a degree. In the first circuit the opto is acting like a logic inverter. If you change the wiring in your first circuit so that pin 2 of the opto wires to the Arduino pin 9 and the resistor wires to +5vdc then the inversion goes away (by double inversion) such that an Arduino low output turns off the lamp and a high turns on the lamp.
- How exactly is R1 and R2 calculated?
R1 determines the internal LED current, usually set to allow 10-20ma to flow. 1K should be fine. R2 sets the collector current of the opto's output transistor when the internal LED is on. This determined by the specific opto chip's datasheet, but is not too critical in this circuit, but might effect the speed of turning on and off the mosfet due to the R/C time constant of the mosfets gate capacitance and R2. I would lower it to 2k ohms myself and test.
- As far as I understand one does not need a fly-back diode for a lamp. However if you would like to install one in case the circuit is used for a motor, Is my assumption correct that it will be connected in parallel with the lamp?
Yes, with the cathode side of the diode wired to the positive side of the lamp connection and the anode wired to the mosfet side of the lamp.
- Is it necessary to smooth the pwm out from the mosfet? Would it increase the life of the lamp? Similarily would that reduce the high frequency noise that some dimmed lamps make?
No, the main advantage of using a PWM signal is that the switching mosfet is either fully on or fully off at any given instant, therefore not having to dissipate any voltage drop so it runs much cooler. If you filter the pwm signal to the mosfet then it acts as a linear resistor and dissipates energy. Same effect on the lamp but less effiecent.
- Is there anything else I should consider?
Yes, your second circuit won't work reliably. To turn off the mosfet there must be a path to external power ground connection to discharge the gate of the mosfet and thus turn if off. In your second circuit when the opto turns off there is nothing to force the mosfet gate to turn off.
Thanks a lot!
Here's the final circuit in case anyone's interested:
This thread is being very useful to me.
I have mounted the circuit and it is working like a charm. I am using a STP40NF10L MOSFET and wired to a 36V power source.
First question: I guessed a 60K in R2 but not sure if this is the correct value (for 36VDC).
Second question: In this circuit, in the case of arduino is powered off or not connected at all, the MOSFET is powered on. How to make the MOSFET off by default? I guess that is by a pull-down resistor, but not sure about how to wire it.
Any help will be very welcome.
Thank you and best regards,
I guessed a 60K in R2 but not sure if this is the correct value (for 36VDC).
This is not very important the value you used will give you 1.6mA current through the opto transistor which is fine. How did you get a 60K resistor? I would have just used a 56K being the closest lowe standard value.
How to make the MOSFET off by default?
You can't with this circuit, a pull down resistor would not work. You would need another transistor between the opto and the existing transistor to invert the signal.
Thank you for your kindly reply.
The 60K has obtained by a 10k resistor in series with a 50k potentiometer. I used the pot to experiment with several values, but I noticed that this no matters in the circuit proposed.
I have found the solution for my previous questioning:
I modified the above circuit a bit by placing a 47K resistor before the pin 5 of the optocoupler (between vcc and pin 5) and used a 100k value for R3. Worked as intended! But... I noticed that the switching is slow. So, I changed the R3 to 10K. The switching is fast now, but I noticed a lot of heat in the MOSFET. What is the optimal value for R3 in order to gat a fast switching and low heat dissipation on the MOSFET?
Note: I am using 36VDC in the MOSFET circuit.
Thank you and best regards,