I want to control brake/ turning lights for a trailer.
A microcontroller digital output will drive optocouplers, which in turn will drive mosfets to turn on the brake/ turning lights
I am thinking of this circuit to drive them, is this circuit appropriate?
Are the resistor values correct? if not why and which values are?
This will work. There is enough gate voltage using that emitter follower since the MOSFET Vt threshold voltage is 3 volts :
But it is better to use a common emitter circuit . Why not ground the emitter and get the extra gate voltage? Inverting the input and using the common emitter amplifier configuration is preferred, but maybe you have some reason not to get the full gate drive of 5 volts.
If 100 ohms drives 36 nC gate charge to 4 volts, RC gate time is
100*140nF = 14 microsecond rise time, is OK
Not all resistances are known.
DroidDr, your solution is exactly what I would do, simple, isolates the arduino from the car electrics, and you understand how it works(thats the main thing).
Tom.
AmbiLobe:
This will work. There is enough gate voltage using that emitter follower since the MOSFET Vt threshold voltage is 3 volts : http://www.irf.com/product-info/datasheets/data/auirlz44z.pdf
But it is better to use a common emitter circuit .
A photo transistor doesn't have a base connection so there is no difference placing the load on
the emitter or the collector side.
MarkT:
A photo transistor doesn't have a base connection so there is no difference placing the load on
the emitter or the collector side.
actually, some of them have one (pin 6 of 4n25 is the transistor base pin)
but I agree with you, if you don't use it, it works well with the load on the emitter side
The mosfets I am going to use are similar but not the one on the schematic: Either FQP30N06L or AOI518 ( both logic level N channel, 2.6V max Vgs(th) )
The optocoupler I am going to use is a PS2501-4A, 16 pin, 4 channels. I think it would be equivalent to the one I put in my schematic, except for the base.
The reason I did the schematic that way (correct me if I am wrong I am still new at this)
when the optocoupler transistor is off, the gate of the mosfet goes to ground, through the 2 resistors, shutting it off, so power loss on the 5V or uC failure means mosfet = off.
when the optocoupler transistor is on, the mosfet gate charges through R15 and will quickly gain full charge and have no current, meaning we will have (5 - Vforward transistor), ( 5 - 0.7V) = 4.3V or so on the gate, Correct?
The 470ohm resistor is to limit the current through the transistor to about 10mA or arounds there. 4.3 volts accross the resistor, ( 4.3V/470ohm) = 9.1mA.
I put the R15 100 ohm resistor to limit the gate charge current, as to limit the 'surge' in the optocoupler transistor. I really don't know if it is necessary???
I have thought about the common emitter config, and so far have come up with this schematic (attached). I don't know if this is the right way???
If the transistor is off, the circuit is a voltage divider, 470 + 10000, .477mA, giving about 4.78 V to the gate once charged, activating the mosfet.
if the transistor is on, the Vgs is = transistor Vforward? or about 0.7V??? shutting off the mosftet since Vgsth is 2-2.6V.
The only problem with this is that if the microcontroller or optocoupler fails the mosfet stays on, but 5V failure means mosfet = off through 10k resistor.
"The only problem with this is that if the microcontroller or optocoupler fails the mosfet stays on"
Yes, good point. The first circuit has a safer operation under conditions of input control loss. Go with the safer emitter-follower.
MarkT said, "A photo transistor doesn't have a base connection so there is no difference placing the load on the emitter or the collector side."
The emitter is heavily doped, and the collector is lightly doped. That impurity concentration compared to the base's is what makes Hfe =100 for a common emitter, and Hfe <1 for common collector connexions. The emitter follower is also better than a collector follower for the same reason.
I tried the first schematic I posted and I have 4.7V at Vgs. I used 560ohm instead of 470 and 220 instead of 100 though, just cause I was lazy
For this mosfet it is appropriate, if I wanted more, I could connect the Drain to a resistor and then to 12V. I suppose this will make a voltage divider to power the gate, getting what is desired on the mosfet gate (> 5V if warranted, if the mosfet is not logic-level).
AmbiLobe:
MarkT said, "A photo transistor doesn't have a base connection so there is no difference placing the load on the emitter or the collector side."
The emitter is heavily doped, and the collector is lightly doped. That impurity concentration compared to the base's is what makes Hfe =100 for a common emitter, and Hfe <1 for common collector connexions. The emitter follower is also better than a collector follower for the same reason.
I don't think he means that the emitter and collector are interchangeable. I think he means that since the "base" drive is from photons hitting the transistor die, you are not subject to the same conditions of an emitter follower. IE, connect the collector to 12V, and the emitter is not limited to 5V-0.7V as it would be if it were just a regular BJT transistor with 5V going into the base.
DroidDr:
I tried the first schematic I posted and I have 4.7V at Vgs. I used 560ohm instead of 470 and 220 instead of 100 though, just cause I was lazy
For this mosfet it is appropriate, if I wanted more, I could connect the Drain to a resistor and then to 12V. I suppose this will make a voltage divider to power the gate, getting what is desired on the mosfet gate (> 5V if warranted, if the mosfet is not logic-level).
Would this be the correct way to approach this?
Connect the optoisolator collector to 12V, emitter to the Gate, then a 470 ohm resistor to ground. No need to involve 5V on that side of the optoisolator, and more drive is fine on a MOSFET. The limit on Vgs (Gate to Source voltage) is usually on the order of 20V. So no need for voltage dividers.
Connect the optoisolator collector to 12V, emitter to the Gate, then a 470 ohm resistor to ground. No need to involve 5V on that side of the optoisolator, and more drive is fine on a MOSFET.
This applies to the schematic in the first post. Sounds convincing, especially the fact that MOSFET should be off while Arduino output is high impedance ( off / reset )
As amplification If/Ic is not that high for optocouplers, wouldn't a bigger resistor from emitter/gate to GND be more appropriate ( 1k ? or even more ? )
Limit is rather that on If = 0 the gate is still/drops quickly to GND level, isn't it ?
polymorph:
Connect the optoisolator collector to 12V, emitter to the Gate, then a 470 ohm resistor to ground. No need to involve 5V on that side of the optoisolator, and more drive is fine on a MOSFET. The limit on Vgs (Gate to Source voltage) is usually on the order of 20V. So no need for voltage dividers.
You are quite correct, the mosfet Vgs spec is +- 20V
The other smaller-sized mosfet I am planning to use is also +-20V
To keep the current to about 10mA through the opto isolator, I would put a larger resistor, unless I mis-understand. (12V-0.3V)/0.01A = 1170ohm, so lets say 1k.
Makes sense?
Am I missing something? The forward voltage i.e. 1.2V is for the input side of the Optocoupler (the LED).
I am actually using a PS2501-4 four port optocoupler, same spec for forward voltage drop (1.2V) at desired current levels (10-20mA). (did not find or bothered looking online for the PS2501-4 eagle diagram).
What I meant by forward voltage is the voltage drop in the output, the transistor Voltage drop between Collector and emitter, since I am getting 4.7 V on the gate of the mosfet, the 0.3V loss is either resistance losses and or transistor losses.
Am I missing something? I am not yet familiar enought with optocouplers.
No I meant R13, the resistor going from emitter to ground on the optocouple output and putting 12V on the collector. I am referring to the first drawing in the post, not my second drawing.
If you have 12V drop minus losses in wiring and transistor, then 1k will give you about 10mA or so through the optocoupler output is what I meant.
It will all be clear in my head when I study the transistors in my textbook
Why are you aiming for 10 mA on the optocoupler output? It takes very little current to drive the MOSFET, I would have thought one mA or so would be enough, but am subject to correction by the transistor experts.