Driving relays with a prop and mosfet?
Neutron
Posts: 21
Hello,
I have used the BS2 on a couple occasions to drive standard automotive type relays, with either a bs170 MOSFET or the uln2803 darlington array. This afternoon I started playing around with using the Propeller to do the same. I personally like the idea of using MOSFETs instead of the uln2803, due to the fact that you eliminate the .7 volt drop (and the heat) that comes with the darlington.
What i noticed was that there was just slightly more voltage drop across my bs170 when driving the gate with 3.3V as opposed to 5.0V. This makes me wonder if I am almost but not quite completely driving the gate to saturation?
The datasheet for the bs170 lists the Max Threshold Voltage as 3V
I found these mentioned in another thread http://media.digikey.com/pdf/Data Sheets/Rohm PDFs/2sk3065.pdf The datasheet claims a Max Threshold Voltage of 1.5V, which would give me more fudge factor for imperfect situations.
My question is: am I being overly paranoid about the ever so slight difference in voltage drop I am seeing in the bs170? Or would I be better off using the lower threshold MOSFET any way?
Best Regards,
Levi
PS. The coil currents I am dealing with are approx 150mA. I'm using the MOSFET as a low side switch, with the other end of the coil attached to 12 - 15 Volts+ and a diode across the coil to absorb the inductive "kick".
I have used the BS2 on a couple occasions to drive standard automotive type relays, with either a bs170 MOSFET or the uln2803 darlington array. This afternoon I started playing around with using the Propeller to do the same. I personally like the idea of using MOSFETs instead of the uln2803, due to the fact that you eliminate the .7 volt drop (and the heat) that comes with the darlington.
What i noticed was that there was just slightly more voltage drop across my bs170 when driving the gate with 3.3V as opposed to 5.0V. This makes me wonder if I am almost but not quite completely driving the gate to saturation?
The datasheet for the bs170 lists the Max Threshold Voltage as 3V
I found these mentioned in another thread http://media.digikey.com/pdf/Data Sheets/Rohm PDFs/2sk3065.pdf The datasheet claims a Max Threshold Voltage of 1.5V, which would give me more fudge factor for imperfect situations.
My question is: am I being overly paranoid about the ever so slight difference in voltage drop I am seeing in the bs170? Or would I be better off using the lower threshold MOSFET any way?
Best Regards,
Levi
PS. The coil currents I am dealing with are approx 150mA. I'm using the MOSFET as a low side switch, with the other end of the coil attached to 12 - 15 Volts+ and a diode across the coil to absorb the inductive "kick".
Comments
Basically you have the wrong MOSFET for the job. You want a logic level MOSFET (ideally one rated for 3.3V operation rather than just 4.5V).
Ignore the threshold voltage, that's irrelevant for using a MOSFET as a switch (a logic level MOSFET would likely have threshold below 1V, note). The important information in the datasheet is the value of Vgs used to measure Rds(on) - if it only lists the on-resistance for Vgs=10V then you can't rely on it working at 5V at all, let alone 3.3V. Most logic-level devices (of the TO220 packaged variety) list Rds(on) at Vgs=4.5V. These will conduct at 3.3V, not nearly as well as at 5V (and there will likely be a lot of variation between devices. Pick a logic level MOSFET with an Rds(on) ten times lower than you really need and I bet it will work fine (assuming the threshold voltage is well below 3V).
For completeness note that the threshold is the point the device changes from fully OFF to just conducting a few microamps - not the point it switches fully on at all.
BS170 is marginal - the 2sk3065 is a nice part, or you could go more mainstream with something like a SOT223 NDT3055L ?
I have done direct measurement of a number of MOSFETs around the gate threshold. See:
N-Chanel MOSFETs
Look at my graphs of Vgs vs. R. This should tell the story.
To be specific, I did my measurements on a bunch of parts in a single lot.
This doesn't necessarily mean all parts will show similar results.
Sorry but I haven't measured the BS170, although I think I have some.
The best TO-220 package MOSFET now, in my opinion. is the IRF3708.
There are several IPAK or TO-251 MOSFETs I like although I haven't measured these.
This package is much smaller than TO-220 at 0.1" thick which is thinner than a TO-92.
IRLU2703
IRLU014
RFD14N05L
Duane J
I can't disagree more.
Assuming your driving a motor, relay, beeper circuit. or blinking lights.
I would be hard pressed to find any electronic advantage for the Bipolar over a MOSFET.
1. Bipolars have more voltage drop which consequently results in more power dissipation possibly requiring a heat sink.
2. Bipolars require base resistors which tend to limit how much current can be switched when driven by a prop pin. MOSFETs don't need a resistor.
3. Even high current MOSFETs happily switch mA or uA currents.
Duane J
I don't have a problem with using mosfets where they are superior such as in high current circuits, resistive switching etc. But I switch a lot of my lower current loads with tiny SOT-23 style BJTs which switch very happily with low saturation. You can't really get any useful mosfets in such a small package as the the Rds-on would be way too high and the voltage drop would be much higher than the Vce-sat of a BJT. Plus power mosfets struggle to get really good Rds-on at low gate voltages anyway, yes you can get them but in a low current switching circuit such as relays the BGT is definitely the choice, time and time again. Once you go over the 1 to 3A range then it's a very different story.
Just to answer briefly on each of your points:
1. BJTs can have much lower "voltage drop" than an equivalent mosfet in a lower current circuit with low drive voltage (note the SOT-23 mentioned switches 1A loads easily)
2. MOSFETs don't "require" a resistor but I normally put one in anyway as I have had gate-drain breakdowns which dump the full load voltage onto a poor Prop pin. The resistor stops everything going up in a great big puff of smoke/fire. (plus what's a resistor anyway)
3. Of course they're happy, but is the designer? The gate capacitance makes the power mosfet a very very poor choice for signals (mA/uA).
Summary:
For low driving voltages and currents around 1A or so ..... use a BJT
EDIT: This is the transistor I use for switching up to 500ma straight from a Prop pin as it has built in resistors.
It does say .3V @ 50mA. I would expect Vce at 500mA would be at least 0.8V which would be 400mW which is higher than the allowed maximum of 200mW so you can't really get to 500mA.
Do you know what the actual Vce @ 500mA is?
Here is a nice MOSFET:
Si1304BDL
Vds 30V, 710mA continuous (4A pulsed), 240mW @ 70C in an SC-70/SOT-323 package. A bit smaller than an SOT-23.
Fully specified at Vgs of 2.5V & 0.386ohm @ 750mA
This is 193mV & 97mW @ 500mA
This dissipates much less power and has much less voltage drop. About the same cost.
or
BSH103
Vds 30V, 850mA continuous (3.4A pulsed), 500mW @ 80C in an SOT-23 package.
Fully specified at Vgs of 2.5V & 0.500ohm @ 500mA
This is 250mV & 125mW @ 500mA
And there are lots of others.
If I want to switch 1A then I would use a MOSFET in an IPAK package. And dissipate nearly no heat due to the low on resistance.
Duane J
Now that I'm reading the datasheet correctly, it is apparent that the bs170 is not up to the job here.
I have several project ideas that are floating around in my head right now. I have been playing with XBees for a little while now, and see some wireless control projects in my future. In addition, a few weeks ago I came across an old lab-sample incubator from the 1950's, it became mine for 20$. I would like to fix it up and do a Prop based control for temp and humidity, to make it into an egg incubator.
At this point I don't have a specific project in mind, I'm just trying to learn. Ideally I will probably end up switching all but the highest currents directly with MOSFETS or some other solid state means. The IRF3708 is particularly enticing since it appears to be able to switch 7.5A at Prop level gate voltage, and 15A if I were to feed 10V to the gate.
Best Regards,
Levi
After looking at the datasheet for this... Essentially you put 3.3V into one of the input pins and get almost VDD on the corresponding output pin correct?
So if I were supplying the TC4427 with +12V on its VDD pin, I would get approx 12V out?
Best Regards,
Levi
You missed the point about the DDTDs, I mentioned them because they are cheap and handle loads up to 500ma though frequently I use them to switch LCD backlights of around 200..300ma with the Prop's duty-cycle mode efficiently. I measure 180mV Vce-sat @230ma or about 42mW.
The smallest mosfets I use are normally dual mosfets in an SO-8 pack such as the Si4906DY which has a continuous drain current of around 5A @75'C (10A combined) and are snapped on hard with a gate drive of 2.5V.
I am very familiar with perhaps too many MOSFETs in all shapes and sizes but thanks for pointing out the SOT-23(ish) mosfets, they might prove useful somewhere although they are over twice the price and I would still use the BJTs where I use them now.
Horses for courses.
Be careful reading MOSFET datasheets, I use the IRLB3036 and they have a top figure of 270A continuous drain current @25'C in a TO-220. The important thing for low-speed switching is the:
1) Gate voltage required to achieve desired Rds-on (the gate threshold figure is not really a good indicator).
2) The Rds-on or on resistance @75'C or more (once it gets warmer, it will get hotter)
3) Gate capacitance which will limit the speed of switching unless you use drivers (kiss)
The choice of part also depends upon whether you need through-hole or smd parts but for TH stuff I use the IPAK devices that Duane also mentioned.
Thanks Peter.
For future reference, at approx what switching speed does one have to start thinking about gate capacitance?
My soldering skills are pretty decent so SMD components are not a deal breaker. I have done a few up "dead bug" style before just so I could use them in a breadboard.
Thanks,
Levi
If you are only switching at very low speeds at <1kHz then it's okay to drive a mosfet directly from the Prop. For disaster protection I just use a series resistor from the Prop to limit the amount of current in that event but not too high a value that it starts impacting the switching speed. You will probably find a value of around 1K a good compromise. Bear in mind though that mosfets can turn on or worse still, partly on if the gate is left floating which is exactly what happens when the Prop is powering-up or in reset or if software has not configured the I/O pin. The usual trick is to use a pull-down resistor from the Prop pin to ground of around 10K or so. This is not the same as a "bias" resistor which normally goes from a BJT's base to ground. So you do need resistors to drive mosfets
You have to do the math - without proper gate driving the switching losses can easily dominate even at a few kHz. Switching losses depend on supply voltage times load current and switching frequency times switching-time. Driving a MOSFET with a gate charge of 220nC at 5V from a 220 ohm resistor will have about a 10us switching time, at 1kHz PWM that's 2% of the time in switching.
If the load is 24V 10A, then you have about 1.2W switching loss assuming a uniform VI/4 dissipation over the switching period (resistive rather than inductive load). 1.2W means you need a heatsink even if the MOSFET can handle 10A without one (a 220nC MOSFET is likely to be a few milliohms Rds(on)).
I've seen people drive a gate through a high-value resistor such as 10k - this might not be safe for high power loads, even one switching event could overheat/melt the MOSFET - fortunately MOSFET datasheets often have a graph of maximum switching time v. power dissipation.
(The 10k pull down used in many circuits is fine though - its job is to prevent the gate floating up while the microcontroller initializes (the gate will be discharged at power-up so no switching events happen).
Drive the same 220nC gate with a good driver (0.5A lets say) and switching takes 450ns, switching losses reduced by a factor of 20 to 60mW. Inductive loads are more complex to analyse - the current may be steered into the body diode too. Switch 200V at 50A and switching losses are crucial (switching transients in the kW range), as is thorough protection circuitry.
BTW driving a gate at high currents caused dissipation in the gate series resistance (typically an ohm or so), which means that overdriving the gate could be counter-productive eventually - again you do the maths to see whether this is an issue.
And lastly a caveat about fast switching: faster switching transients generate more interference in nearby wiring and components - a ground plane and attention to layout and shielding becomes more important as switching speeds and load currents and voltages increase.
Thanks for the info. For what I have in mind in the near future (simple on-off control) it seems that I can ignore the capacitance issue. It is however good to know at what point I will need to re-evaluate my strategy for future projects.
Wow that's quite the list of MOSFETs! That IRF3708 looks terribly useful.
BTW, all the solar projects you have posted there are way cool!