MOSFET use in a uC application - Page 1
Forum section: electronics / projects

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 11:00:13 am
content: Hi chaps..I am going to be driving a 12ohm load at 12v (1A) using a kinetis 3v3 MCU.I currently use this mosfet:http://uk.farnell.com/international-rectifier/auirf7805q/mosfet-n-ch-30v-13a-so8/dp/1909590with a 1k gate resistor (I assumed this as I have never really used MOSFETs before)I'm running it at 300Hz with a duty range of 20-80% .. it gets REALLY hot.Its RDSon is very low, and so I thought its heat dissipation would be very low also.Where am I going wrong?I have scoped its rise time and it is approx 20uS is this too slow is that the issue?Any recommendation as always, appreciated..Cheers,Matt

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 11:03:16 am
content: Also, I have a 100k pulldown on the gate, as was aware you cannot or should not leave them floating... is that not the case with logic level mosfets? Is that perhaps the issue?Look forward to your replies

author: dannyf
author_rank: Super Contributor
timestamp: February 28, 2014, 11:56:14 am
content: QuoteAssuming PP output from the mcu, the likely cause is high switching losses caused by the high gate resistor and the gate capacitance. Check our mcu datasheet to see how much current is available on that pin and reduce the gate resistor to push the output current to that limit.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: February 28, 2014, 11:59:55 am
content: From what you have said, it shouldnt be so hot.If the heat is mainly from the conduction it would be: 1A , 0.011 ohms = 11mW.Rough figures for switching losses, should really be done with calculus.If the heat was from switching it would be 20u secs x 2 = 40uS; every 3.33mSeconds. so it is switching 1.2% of the time, the rest is either on or off.The Vds while switching say average 6v.Current while switching say average 0.5a.Average power while switching is 3W.Average power attributed to switching losses is 3 x 0.012 = 0.036 wattsTotal losses is 47mW.Probably shouldn't be so hot.But I think the 1k is slowing down the switching a lot. so use the lowest you can keeping the GPIO outputs happy as if they were driving a short.Say they source/sink 20mA and at 3.3v then to limit conduction use 165 ohm. Obviously round up. That way you can drive faster and use less power while switching.Ps. Hope my calcs are correct. I didn't check them.Dannyf just posted.What he said ^.

author: Psi
author_rank: Super Contributor
timestamp: February 28, 2014, 12:54:01 pm
content: +1 for lower gate resistor.Unlike with a regular transistor mosfets don't need a gate resistor at all.However, without one your MCU's output pin is at risk of damage from over-current if you try switching very fast. Since the MCU output pin can only supply say 20mA there's a limit on how fast you can turn the fet on/off and any time spent transitioning between these states causes a high RSon resistance and lots of heat.This is one of the reasons people use a mosfet "gate driver" chip which can handle high peak currents. The other reasons is higher gate voltages mean lower steady state RSon resistance, so a 3.3V mcu can drive a 12V gate driver IC for exampleTry 100ohms and see what that does to the heat problem.Also confirm your 100K pulldown is infact 100K. If you mistakenly grabbed a 1K for example it will form a 50% voltage divider and the Gate will get driven from 1.65V which will cause a really high on resistance and lots of heat.

author: uwezi
author_rank: Unknown
timestamp: February 28, 2014, 01:48:57 pm
content: Most probably you gate voltage does not rise enough. You are running a 3.3 V controller, which means that your output voltage at best reaches 3.3 V for a high level. If you look into the datasheet you will find Fig. 3 which gives you a "typical" RDS,on. But then you also find in the table on "Static Electrical Characteristics" that the actual threshold voltage for your transistor can be as high as 3 V - you will never be able to turn such a transistor fully on with a 3.3 V output pin.The heat comes from the fact that your MOSFET is running significant amounts of time in the sub-threshold region.If possible use a driver transistor to switch the gate from a higher voltage - if available in your system.

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 02:38:47 pm
content: Ok chaps, thanks for the info.At 100ohms I am still seeing high heat generation.I am going to go ahead and use a mosfet driver.Would I need drive/gate resistors in this case?Could you reccomend a small form driver (using 3.3 logic) and a small form (pref SO8) mosfet for driving this sort of thing (a approx 12ohm solenoid at 12v, which even with the hot mosfet the whole project inc solenoid running draws 700mA). I assume if I drive the current logic type mosfet I have with the 12v rail as I assume it would blow it?Regards,Matt

author: dannyf
author_rank: Super Contributor
timestamp: February 28, 2014, 03:47:47 pm
content: -100ohms I am still seeing high heat generation.-something else is at work here. Gate drive isn't likely the issue.

author: uwezi
author_rank: Unknown
timestamp: February 28, 2014, 03:54:22 pm
content: For a 1 A 12 V load you should not overlook the possibility to use an NPN bipolar transistor instead. At a modest current gain of 100 you would only need a base current of 10 mA from the µcontroller resulting in a drive power consumption of less than 8 mW plus an additional power loss for the VCE,satof perhaps 0.5 W at 1 A, which should be low enough for a SOT223 to handle.

author: georges80
author_rank: Frequent Contributor
timestamp: February 28, 2014, 03:58:42 pm
content: Turn the FET on 100% of the time and measure the voltage drain to source. Then you will know if it is fully turning on or not. I'm surprised that the datasheet for the FET you provided the link doesn't specify the gate capacitance - seems like an important parameter to leave off...The other important parameter is the current drive capability of your uC on the GPIO you have connected to your FET.If you want a great low Vgs FET I highly recommend looking at the TI CSD16340Q3. I've used them with excellent results from a 2.5V operated uC.cheers,george.

author: madires
author_rank: Super Contributor
timestamp: February 28, 2014, 04:00:44 pm
content: Maybe a silly question but have you placed the load between source and ground or drain and Vcc? Do you got a freewheeling diode for the solenoid?

author: lewis
author_rank: Frequent Contributor
timestamp: February 28, 2014, 04:04:59 pm
content: There's not enough voltage at the gate relative to the source, 3.3V from the MCU is not enough (assuming source grounded). The RDSon value in the datasheet is for a 4.5V gate voltage. The VGS(thresh) specification is for when the device BEGINS to turn on, you'll have lots of channel resistance at 3-3.3V hence the heat.You need a gate driver, ideally you want 7-12V between the gate and source to turn it on reliably.

author: uwezi
author_rank: Unknown
timestamp: February 28, 2014, 04:06:03 pm
content: Quote from: dannyf on February 28, 2014, 03:47:47 pmGate drive is not the issue, but rather the choice of MOSFET. This particular MOSFET is specified with its RDS,onat a gate voltage of 4.5 V. Yes, it is a "logic level" MOSFET, but for +5 V logic, not 3.3 V. According to the datasheet the threshold voltage can be as high as 3 V for the MOSFET used here.IRF has a parametric selector where you can select MOSFETs for their at different gate voltages of 2.5 V and 4.5 V. You need to choose a MOSFET with specified low on-resistance at a 2.5 V or apply a higher gate voltage by means of a separate driver.I just clicked in the table, not knowing anything about availability, but the IRLML6346 and IRLML2502 appear suitable for 3.3 V logic signals.

author: dannyf
author_rank: Super Contributor
timestamp: February 28, 2014, 04:58:38 pm
content: QuoteLikely the circuit or wiring, not the mosfet.Without the OP providing more specific information, no way to tell.

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 05:37:16 pm
content: Guys,Some really great info so far, but as requested, here is further info for what I am using.Source is grounded.Drain goes to the solenoid (12ohm inductive load), other side of solenoid to 12v.No protection diode (do mosfets also need this?)Driven currently by 100ohm from a Kinetis K20 3v3 MCU100K pull to ground on gate also.300Hz operation, 20-80%, 50% duty typicalDoing some looking into the recommended part numbers provided.I appreciate all the information so far, thanksMatt

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 05:44:17 pm
content: Quote from: georges80 on February 28, 2014, 03:58:42 pmGeorge,Have looked at this device and it seems very suitable. What drive resistor would you use with the Kinetis, assuming 20mA source, 3v3Regards,Matt

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 05:48:41 pm
content: Quote from: uwezi on February 28, 2014, 04:06:03 pmAgain good devices, cheap as well, what would be the usage schematic for this in my case do you think? (resistors etc) and is there a strict formula for calculating this?I assume you consider the gate a cap and want the lowest rise time as possible without maxing out the uP source current?Cheers,Matt

author: georges80
author_rank: Frequent Contributor
timestamp: February 28, 2014, 05:57:54 pm
content: Yes, you really should have a diode clamp for the back emf of the solenoid.Do you have a scope? That would make life a LOT easier since you could just probe the gate and see what kind of signal you are getting (rise time etc).No idea about your uC. I use Atmel AVR's and the ones I use have a symmetrical drive (high and low) and do just fine for direct drive of FET gates with no added series resistor since their GPIO's are current limited. I put a 100k pulldown to guarantee the FET is off when the uC is first 'booting up'.IRLML2502 works fine (nice compact FET and I've used them in many designs) and for your 1A application would be a good solution. The TI part I linked is obviously a much high current capable device with lower Rdson and much better thermal path - basically an overkill for only 1A.FET gate looks like a capacitor (sorta/kinda) and that is the main characteristic you need to consider when driving it especially at high speed. You're only doing a few hundred Hz so that is quite low speed. Vgs is possibly a problem but most likely the high gate charge/capacitance isn't helping with the switching speed. A scope would show you what is going on...cheers,george.

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 06:01:52 pm
content: George,Yes have scoped it we are getting 3.3v at the gate with a rise time of approx 17uS...I will see if this device is symetric and if it is. I dont believe the outputs on the Freescale Kinetis are current protected, will check into this also.Will be back in a mo with the info on thisMatt

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 06:04:55 pm
content: From the DS for the kinetis:digital I/O switching characteristics assume:1. output pins• have CL=30pF loads,• are configured for fast slew rate (PORTx_PCRn=0), and• are configured for high drive strength (PORTx_PCRn=1They are -25mA to 25mA max ratings....Unsure if they are limited as such, so reistance reccomendations?

author: StevenB
author_rank: Contributor
timestamp: February 28, 2014, 06:09:09 pm
content: You should also (as has been recommended) place a flyback diode from the drain (anode) to the supply (cathode connected to 12V) to make sure you aren't exceeding the breakdown voltage of the FET when switching off.

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 06:12:59 pm
content: Quote from: StevenB on February 28, 2014, 06:09:09 pmSteven,Yes, thinking of using an S1A for this, or should I go for a faster acting TVS (?) type?Matt

author: StevenB
author_rank: Contributor
timestamp: February 28, 2014, 06:34:35 pm
content: The S1A should probably be fine.

author: georges80
author_rank: Frequent Contributor
timestamp: February 28, 2014, 07:13:05 pm
content: 17us rise time is very slow. What's the fall time? the same? Likely you gate resistor is slowing things down - what's the signal look like at the uC side of the gate resistor? Make the gate resistor smaller (value) and see what happens to your rise/fall time. Consider you have a few thousand pF of gate capacitance to charge/discharge on each on/off transition.Have you turned the FET on 100% of the time and measured the source/drain voltage? Multiply that by your 1A current and you'll have an idea of static dissipation and know if you have and Vgs(th) issues.You just need a diode that can handle the collapsing current when the solenoid is de-energised, so most any silicon diode will be fine, even 1n4148cheers,george.

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 07:56:15 pm
content: Quote from: georges80 on February 28, 2014, 07:13:05 pmGeorge,I can get it down to 12uS with a 33ohm gate resistor, just checking the Volt drop accross it now, brb.Matt

author: mtechmatt
author_rank: Regular Contributor
timestamp: February 28, 2014, 08:04:18 pm
content: Ok, well I am dropping 0.05volts accross the FET wide open 100%, and of course, no heat emittedSo its of course the transient.I have gone ahead and laid the shecmatic using the FET you recommended, if you can give me a drive resistor I am happy to use that, or is there a better way?Even with a direct short accross the gate resistor, I still get a crappy rise and fall time (and the heat that goes with it)Too big capacitance on the MOSFET for my application maybe?Matt

author: dfnr2
author_rank: Regular Contributor
timestamp: February 28, 2014, 08:26:10 pm
content: If your layout is good, you can try leaving out the gate resistor; you can add in a small value if you are having oscillations due to the parasitics. Keeping the trace short will help reduce inductance. You need to look at your turn off time as well. If you include a gate resistor, you can use a PNP to turn off the FET by shunting the gate to ground. If you are in doubt, you would do well to incorporate a dedicated MOSFET driver close to the MOSFET. As mentioned above, make sure you choose your FET to be appropriate to the drive levels. For this little power and this frequency, you should be able to run cool without fancy techniques that get employed in the MHZ+ range.BTW, this is one of those applications where you want to have the highest BW scope you are able to access, and active probes.Dave

author: georges80
author_rank: Frequent Contributor
timestamp: February 28, 2014, 09:14:30 pm
content: Quote from: mtechmatt on February 28, 2014, 08:04:18 pmOk, you've now got good evidence it's a gate drive issue (slow rise/fall time but good when 100% on). Search for a FET with the lowest gate charge or gate capacitance and it will help speed things up. Your uC pin drive current is what is causing the slow rise/fall time as it tries to charge/discharge the gate of your current FET.As above, with a clean layout you shouldn't need a gate series resistor or at most a few ohms if you have ringing issues. I'd leave the resistor footprint in the layout and you can then go to 0 ohms if gate signal integrity looks good on a 'decent' scope with appropriate probes and probing.cheers,george.

author: jmaja
author_rank: Frequent Contributor
timestamp: February 28, 2014, 09:25:49 pm
content: Can the uC slew rate be controlled? Do you have it at maximum? Have you tried lower frequencies or do you need to have 300 Hz? I had a similar problem with a solar panel PWM controller (50 W, 12 V) I made and it was solved by lowering the frequency. I didn't have the option to change the MOSFET. I started with a few hundred Hz and ended up using 78 Hz.

author: dfnr2
author_rank: Regular Contributor
timestamp: March 01, 2014, 12:49:32 am
content: Quote from: jmaja on February 28, 2014, 09:25:49 pmHmm. I misread the OP as 300kHz, but by golly, you're right--it's just 300 Hz. At such a low frequency, the on/off times for any normal circuit should not add up enough to cause much heating. Something is not working as you expect. The scope is your friend. If you have access to a good scope and active probes, use them. Also, put a small resistor in series with the output and use it to estimate get output current waveforms. Try to post some waveforms here.Dave

author: georges80
author_rank: Frequent Contributor
timestamp: March 01, 2014, 02:14:05 am
content: If you run through some numbers, I think you'll find that 17us rise and fall time at 300Hz is about 1% of the time being in the linear region of the FET.With 1A flowing through the solenoid (so about 12 ohms) that means the FET can be 1 - 2 - 3 ohms and still have ~1A flowing. I2R losses will add up.cheers,george.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: March 01, 2014, 02:50:13 am
content: Just trying to work this out. Correct me if I misunderstand.Are you driving a solenoid at 300 hz?If you are why? And if you are then you want a flyback diode across the coil.

author: uwezi
author_rank: Unknown
timestamp: March 01, 2014, 07:34:37 am
content: Quote from: georges80 on March 01, 2014, 02:14:05 amAt best - depending on the actual value of the threshold voltage for the particular MOSFET in the circuit - according to the datasheet the threshold voltage can lie between 1 V and 3 V!

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: March 01, 2014, 09:02:04 am
content: At 2.5volts the FET is well and truly on. At this point is has no more than 15mOhms resistance.

author: mtechmatt
author_rank: Regular Contributor
timestamp: March 01, 2014, 09:52:49 am
content: Ok chapsI will post up some scope images, I have a Rigol DS1052EIn terms of an end game solution I am going with georges MOSFET (IRLML2502) recommendation, which will be fully 'saturated' by 2.5V, with no gate resistor, but a pad for it just in case.Will order up a sample and dead bug it to see if it worksMattPS its driven at 300Hz as that is the stated operating frequency of the solenoid, it is for controlling fluid flow in a valve

author: mtechmatt
author_rank: Regular Contributor
timestamp: March 01, 2014, 11:19:25 am
content: Quote from: HackedFridgeMagnet on March 01, 2014, 09:02:04 amWhich FET are you reffering to? The current one or the proposed IRLML250 device?CheersMatt

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: March 01, 2014, 11:58:30 am
content: I was referring to the initial one,http://uk.farnell.com/international-rectifier/auirf7805q/mosfet-n-ch-30v-13a-so8/dp/1909590It seemed ok to me.I just looked at the Vgs vs Rds on graph and it showed that the FET was well and truly switch on at 2.5volts and your test confirmed itre:QuoteAssuming you were driving it a 3.3v.but what about the solenoid, do you have a data sheet on that?

author: jmaja
author_rank: Frequent Contributor
timestamp: March 01, 2014, 12:12:32 pm
content: Why don't you measure the voltage over the MOSFET with your scope? Then you could see how well it works. Maybe you could put a 1 ohm power resistor in place of the solenoid. Then you could easily calculate the current and power as well.

author: mtechmatt
author_rank: Regular Contributor
timestamp: March 01, 2014, 12:43:53 pm
content: Quote from: HackedFridgeMagnet on March 01, 2014, 11:58:30 amI see, so the issue must be in the transient states. Maybe better to just use a simple driver instead of changing the fet? Any reccomendations (prefer multichannel as I have 8 of these to drive in my final project), and am I safe to supply the driver (and then ultimately the mosfet gate) the 12-14v supply?No datasheet for it, just resistance meadures at around 12-15ohms, and that I am running it at 12-14vMatt

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: March 01, 2014, 01:13:36 pm
content: I still dont understand why you are driving it at 300hz.Quotethis statement worries me.That probably means you can switch it on and off at up to 300 hz if you want to. It that what you want? It doesn't mean you drive it with 300hz square wave.Normally relays and I guess solenoids have either an AC coil or a DC coil. The AC coil is slightly different in that it has a special phasing coil, they are designed to operate at mains frequencies, not 300hz. DC coils are just that, DC.Its probably DC so just turn on the GPIO for on and no square wave required.Also if it is a DC coil put a flyback diode across it.

author: mtechmatt
author_rank: Regular Contributor
timestamp: March 01, 2014, 01:55:09 pm
content: Hi,No we scoped it in its OEM application and it runs at 300Hz, the flow varies constantly. That is the how the OEM controller runs it.CheersMatt

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: March 01, 2014, 11:14:32 pm
content: Ok I think I have it now, the duty cycle controls the valve position.

author: mtechmatt
author_rank: Regular Contributor
timestamp: March 02, 2014, 02:07:00 pm
content: You got itReally these little IRMLM SOT23's can handle 3Amps??? And be driven by a 3.3 uC?http://uk.farnell.com/jsp/search/productdetail.jsp?sku=1857300I just cant see it... maybe thats me being used to clucnky old TO220s!Matt

author: uwezi
author_rank: Unknown
timestamp: March 02, 2014, 02:20:24 pm
content: Quote from: mtechmatt on March 02, 2014, 02:07:00 pmIt's mostly a matter of RDS,onfor a given gate voltage. By being able to reduce the threshold voltage and obtaining an RDS,onof 80 mohm the transistor will only have a static dissipation of 240 mW while transporting 3 A. If you then compare the package to a standard 1/4 W resistor it is not so surprising anymore.But you have to be aware of the fact that the dissipated power can be much higher during the transition between ON and OFF and possibly exceed the safe operating area of the transistor.

author: megajocke
author_rank: Regular Contributor
timestamp: March 02, 2014, 04:30:26 pm
content: It has been mentioned multiple times already, but there has been no indication of the current state of this matter:Is there an appropriate freewheeling diode installed across the load?Without it the transistor will need to dissipate every cycle all the energy stored in the load inductance and then some.Appropriate decoupling of the power supply is also needed or else the supply wiring inductance will cause high voltage spikes unless switching transistions are made slow on purpose - which is probably a reasonable way to design the circuit at 300 Hz switching frequency.Quote from: HackedFridgeMagnet on March 01, 2014, 11:58:30 amYes, but it's not guaranteed. It's thetypcialcurve. You are not guaranteed more current flow than 250 µA even at 3 V of Vgs. If there is a need to produce more units it has to be redesigned or else transistors need to be screened for Vgs before using.

author: uwezi
author_rank: Unknown
timestamp: March 02, 2014, 05:10:15 pm
content: Quote from: megajocke on March 02, 2014, 04:30:26 pmExactly my point from the start. The datasheet only guarantees behavior for VGS=4.5 V i.e. the transistor is designed for +5 V logic signals. The graph in the datasheet is taken for a typical device, corresponding to a threshold VGSof about 2-2.5 V. But also according to the datasheet the actual threshold VGSof the transistors which are produced can vary between 1 V and 3 V.And at the threshold VGSthe device is only guaranteed to conduct 250 µA.Remember that the graphs in datasheets almost always only show typical devices. In order to estimate the spread of the manufactured devices you always need to look into the tables in the datasheet as well.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: March 02, 2014, 10:24:56 pm
content: Ok I take you point that the FET is designed for 4.5v signals.But the OPs question was about this particular device.QuoteIt seems to me that the FET is well and truly on at 3.3v.

author: uwezi
author_rank: Unknown
timestamp: March 02, 2014, 10:31:21 pm
content: Quote from: HackedFridgeMagnet on March 02, 2014, 10:24:56 pmYes, it obviously is - under static conditions. But it is not guaranteed that the same will be true for the next MOSFET of the same type used under the same conditions in the same circuit.Also in a PWM design the MOSFET will spend a significant amount of time somewhere between on-state and off-state - the closer the threshold voltage is to the steady-state gate voltage, the worse this will be.Just on the same topic: you can use a standard MOSFET, specified for a VGSof 12 V with standard 5 V TTL- or CMOS outputs, since the gate threshold voltage of these devices is normally around 3-4 V. I very often do so for my 1-off designs. But be prepared to find MOSFETs which are still within their specs, but with a too high threshold voltage to be fully on.

author: mtechmatt
author_rank: Regular Contributor
timestamp: March 03, 2014, 04:58:54 pm
content: Interesting stuff. My design doesent currently have a freewheeling diode but as of tomorrow I will have these new smaller as recommended mosfets in my hands and will also run a FW diode, and report my findings in both cases.Certainly getting somewhere nowMatt

author: mtechmatt
author_rank: Regular Contributor
timestamp: March 05, 2014, 04:11:06 pm
content: A little ypdate.. it was flyback...Added a diode and on the original mosfet now running stone cold!Thanks for the help everyone, on what was probably a school boy error!Matt

author: StevenB
author_rank: Contributor
timestamp: March 05, 2014, 06:02:09 pm
content: Thanks for the update. I was waiting on the flyback addition. Been there, done that.