Why does the current keep increasing when using an N-mosfet ? - Page 1
Forum section: electronics / beginners

author: DuncanSteel
author_rank: Contributor
timestamp: October 22, 2016, 02:14:16 pm
content: HiI watched the Dave make the dummy load & made my own, now the problem is that the current keeps increasing with time, even tho I am not increasing the voltage with potentiometer. Why is this happening?Another question i have is that if I apply 0.5V to the n-mos source & replace the resistor with 0.2 Ohm value, I should be getting 2,5 A. In reality Im getting only barely an Amp. How comes?

author: CJay
author_rank: Super Contributor
timestamp: October 22, 2016, 02:30:08 pm
content: Because your MOSFET isn't turning on, it won't be fully turned on until the gate is around 10V, you need a logic level MOSFET as Dave very clearly mentions right at the start of the video, those should be fully turned on at 5V.

author: DuncanSteel
author_rank: Contributor
timestamp: October 22, 2016, 02:39:23 pm
content: I am a little confused, I thought that Gate Threshold voltage means that the mosfet will turn fully on at this voltage typical 3V for my IRF540N? what kind of parameter should I be looking at in the datasheet?IRF540N Datasheet

author: bktemp
author_rank: Super Contributor
timestamp: October 22, 2016, 02:53:48 pm
content: Quote from: DuncanSteel on October 22, 2016, 02:39:23 pmIt is called threshold, because it is the threshold value were the mosfet starts to turn on.Note the test condition: ID = 250uA.FIGURE 7. TRANSFER CHARACTERISTICS shows current vs. gate voltage.IRF540 needs at least 5V to be almost fully on.NE5532 also does not like a low operating voltage: It can't drive neither to negative nor positive rail.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 22, 2016, 03:05:01 pm
content: The NE5532 is not really happy with the 0/5 V supply. It is not a single supply type. So it does not work right with a voltage below about 1 V (the datasheet even wants more than 2 V, worst case even 3 V). Also the output will go to only 3.5 to maybe 4 V. So this 3,5-4 V might be just enough for 1 A , depending on the specific FET sample. There is no need to fully turn on the MOSFET, so no need for 10 V but something like 5-6 V or a MOSFET with lower threshold would be a good idea.So using a more suitable OP (e.g. LM358 or TLC272 - single supply, but not very accurate) would be the first step. Still the output voltage is rather low. For higher output voltage a Rail-Rail OP like MCP6002 would be better.The current is expected to increase as the FET gets warmer.

author: DuncanSteel
author_rank: Contributor
timestamp: October 22, 2016, 03:12:53 pm
content: Quote from: bktemp on October 22, 2016, 02:53:48 pmSo they let through 250uA from drain to source at typical 3V & mosfet will start letting opening?How do you know its 5V it needs to be fully open? I cant see it to be written anywhere. From figure 7 i see that at 5V from gate to source the output is 30A, but all I need is 2Amps. So how comes 3V is not enough? (Rather I dont know where to look for it in the datasheet.)How do you know the NE5532 also does not like a low operating voltage: It can't drive neither to negative nor positive rail. ?? where is this written?

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 22, 2016, 03:14:28 pm
content: http://www.ti.com/lit/ds/symlink/ne5532a.pdfoutput swing 26Vpp from 30Vpp supply, meaning it cannot get any closer than 2V from either rail. you asked the 5532 to output 1.2V which is 1.2V from lower rail (gnd) which is a fail...

author: DuncanSteel
author_rank: Contributor
timestamp: October 22, 2016, 03:17:28 pm
content: Quote from: Kleinstein on October 22, 2016, 03:05:01 pmBut this is a problem, lets assume I make the led dimmer & drive it with the mos, the leds will just burn out as the current will increase & the mosfet gets hotter.Dave also made the led dimmer with 555 timer & a mosfet, how comes his leds didnt burn?About logic lvl mosfet, so I should be looking for a mosfet that is fully turned on at 3V (or If I use an railtorail opamp 5V), but how is this characteristic called in the datasheet?So basically I need an op amp that can output say from 0V to 5V and a mosfet that is completely turned on at 3V-5V ?

author: DuncanSteel
author_rank: Contributor
timestamp: October 22, 2016, 03:25:19 pm
content: Quote from: Mechatrommer on October 22, 2016, 03:14:28 pmCan you explain peak-to-peak output-voltage swing please?I do understand the peak to peak part, but if it can input +-15V how can it output between 24 to 26V ?

author: rob77
author_rank: Super Contributor
timestamp: October 22, 2016, 03:30:14 pm
content: Quote from: DuncanSteel on October 22, 2016, 03:25:19 pm+-15V is 30V ...

author: DuncanSteel
author_rank: Contributor
timestamp: October 22, 2016, 03:32:39 pm
content: Quote from: rob77 on October 22, 2016, 03:30:14 pmAnd if I ask it to output 1.2V then its within +-15V isnt it? even if I ground the - port?

author: rob77
author_rank: Super Contributor
timestamp: October 22, 2016, 03:42:36 pm
content: Quote from: DuncanSteel on October 22, 2016, 03:32:39 pmin your schematic you have 0V and +5V so 1.2V is not at least 2V above 0V.+-15V means you have -15V : 0V : 15V where 0V is ground -15V is 15V below ground and +15V is 15V above ground so the +-15V supply gives you a total potential diference of 30V. in that case if you substract the 2V from top and bootom - you will get -13V : 0 : 13V interval for output signal - gives you the 26V.in your schematic with the 0V : 5V sypply you have a total potential differentce of 5V - substract 2V from top and bottom and you will get an interval of 2V : 3V so output voltages between 2V and 3V are possible.if you use a rail-to-rail opamp then you will lose just some milivolts on the output - not the 2V like with the NE5532.you can use the NE5532 but you have to increase the supply voltage and add a negative supply as well, you can use asymetric supply like +12V on positive rail and -5V on negative rail (or even -2V - just enough to overcome the output's limitation).

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 22, 2016, 03:47:40 pm
content: Quote from: DuncanSteel on October 22, 2016, 03:25:19 pmit means, if you power 5532 from ±15V, +15V on Vcc+ pin and -15V on Vcc- pin, that is called 30Vpp power supply. if you supplying the 5532 from 30Vpp, it onyl capable at outputting 26Vpp that is ±13V. meaning it can only go to +13V from +15V rail, that is 2V lower. same thing on the other side, it only can go -13V from -15V rail, that is 2V higher, however voltage you give the 5532 at the input pins. in your case, you are powering the 5532 from 5V and GND, that is 5Vpp, it only can output 2 to 3 volt, however the input voltages are. in order to command nfet to switch off completely when the nfet source pin at 1.2V, the 5532 must be able to command the nfet gate 1.2V, give or take, which is out of its range from 2-3V.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 22, 2016, 04:01:26 pm
content: and then on the nfet side, since it cannot completely off, it generate heat as current flowing through it, as it heated up, more and more current will flow until it possibly smoked. notice the diagram left side from the datasheet how current will rise as temp rise to 175degC.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 22, 2016, 06:31:18 pm
content: If the input would be in the valid range the NE5532 still has a chance to turn off the MOSFET at something like 2 V gat voltage.Thermal runaway can be a problem with MOSFETs, if used in linear operation like for a current sink. Especially at higher voltages this can be a problem inside the chip as well, especially with modern types.

author: Zero999
author_rank: Super Contributor
timestamp: October 22, 2016, 06:43:39 pm
content: Quote from: Mechatrommer on October 22, 2016, 03:14:28 pmActually I think the problem is more likely because the common mode range is being exceeded, rather than the output voltage swing. The NE5532 will behave unpredictably when the input is taken below 2V from either power supply rail.

author: rob77
author_rank: Super Contributor
timestamp: October 22, 2016, 06:53:17 pm
content: Quote from: Hero999 on October 22, 2016, 06:43:39 pmmight be, or both.. but in any of the cases, increasing the positive rail voltage and introducing a negative rail at least -2V (while keeping the sensing and input ground referenced) will solve the issue.

author: DuncanSteel
author_rank: Contributor
timestamp: October 22, 2016, 07:29:21 pm
content: Quote from: Mechatrommer on October 22, 2016, 04:01:26 pmThat was so much information that it made me confused, lets just do 1 step at the time. Starting with n-mos.1) I understand now when my IRF540N starts opening VGS(TH) = from 2V to 4V. (Gate to Source Threshold Voltage) correct ?2) How do i know when its fully open, which parameter should I look up in the datasheet?IRF540N Datasheet

author: rob77
author_rank: Super Contributor
timestamp: October 22, 2016, 07:43:07 pm
content: Quote from: DuncanSteel on October 22, 2016, 07:29:21 pmit's not defined, the only clue is the Rdson - in the datasheet you can find at what gate voltage they guarantee the lowest Rdson. for example your mosfet has 40miliohm (0,040 ohm) Rdson at 10V Ugs.. it says if you apply 10V to gate (relative to source) the mosfet will be fully open with a resistance of 40miliohm maximum. but th emosfet might be open at lower gate voltage already (but the resistance might be higher yet)

author: DuncanSteel
author_rank: Contributor
timestamp: October 22, 2016, 09:53:25 pm
content: Quote from: rob77 on October 22, 2016, 07:43:07 pmI see. Now my goal was to make a current load that is constant & will not change. So, nowI found this n-mosBSR802Nthat will start opening at typical (0,55V) & will be completely open at 2.5V.So If I understand this correctly now I need to use an op amp that can deliver more than 2,5V. And inputs of this op amp must be in range of lets say 0V-0,021V so I can use the pot to adjust from 0V to 0,021V so I can use the 10 mOhm resistor as load & be able to send 2.1 Amps through the gate.Is my understanding correct?

author: rob77
author_rank: Super Contributor
timestamp: October 22, 2016, 10:07:01 pm
content: correct, the opamps common-mode input voltage must reach to 0V. and as you're going to use a very small shunt and having only 21mV full-scale signal, it has to have a VERY low input offset voltage as well. a typical generic opamp has upto 3-5mV input offset, that would mean 25% error in your case. so you need one with a very low input offset voltage or you could also use a 100miliohm shunt and have a 210mV full-scale signal.

author: JS
author_rank: Frequent Contributor
timestamp: October 22, 2016, 10:09:12 pm
content: You have to consider closely the opamp you are using, you should look some that would allow inputs beyond ground from a single supply, you just need to work at ground but too close to it so better allow beyond. There are quite a few that can go 0.3V or so below ground, that's what you are looking for.Working with 1? resistance makes higher the dissipation in the resistor of course but bit lower on the transistor, and also makes the working range much more usable. As you are usually drawing some power with this you expect to have a decent voltage across it, so "burden voltage" isn't a problem other than the power at the resistor. The drift with self heating of the resistors might be a consideration if going too crazy in the expected precision. I don't know what usable range you are expecting from it. Noise might become an issue as well working with a resistor too low for the expected currents.I'm just saying, check your options and consider the best value for this resistor, it will define the behavior of the device and is quite easy to miss the point, but also easy and cheap to correct if you get it wrong the first time.JS

author: Audioguru
author_rank: Super Contributor
timestamp: October 23, 2016, 02:28:08 am
content: The graphs on the datasheet for a Mosfet are for a "typical" device that you cannot buy. You get whatever they have and yours might have minimum or maximum spec's.Yours might have a threshold voltage of 4V when it conducts only 0.25mA. The output of the NE5532 opamp might go as high as only 3V with a 5V supply which is not be enough.

author: JS
author_rank: Frequent Contributor
timestamp: October 23, 2016, 04:06:26 am
content: Why are we discussing NE5532 here, that opamp doesn't make sense for this application...JS

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 23, 2016, 04:43:59 am
content: Quote from: DuncanSteel on October 22, 2016, 07:29:21 pmQuote from: rob77 on October 22, 2016, 07:43:07 pmthe threshold voltage and Rdson is only for nfet working in saturation mode. i'm not an expert of nfet in linear mode, but i'm suspecting you are running the nfet in linear mode based on your circuit setup similar to bjt high side emitter follower. so Vg (linear) doesnt have to take full Vgth to be working in lieanr mode and Rds (linear) will be much much greater than Rdson.if you look at the diagram below. Vgth is only to overcome the "capacitance charge resistance" (or somesort of term) of the gate (horizontal line), once you get passed that threshold, nfet will be in full saturation mode, or very close to it... since you havent passed that threshold, i suspect you are working in fet linear mode. you'll be blessed if mosfet datasheet provides greater details about linear mode working condition, just as how bjt's datasheets have. but as usual, IRF540's nmosfet datasheet doesnt.edit: its ok with your emitter follower circuit, except you are using n-mosfet for it instead of a npn power bjt. your circuit is intended to be working in linear mode anyway, so yeah, as far as the nmosfet linear mode and the datasheet is concerned? the specification of your circuit is basically.... "undefined".and as Hero999 suggested, 5532 may go into unpredictable output when given not the right input (beyond common mode range of the working condition) such as phase reversal. i'm not sure 5532 if it has phase reversal problem i forgot, but opamp with phase reversal is something that i want to get rid of in anything, or else great care must be taken on its inputs.http://www.analog.com/media/en/training-seminars/tutorials/MT-036.pdf

author: rob77
author_rank: Super Contributor
timestamp: October 23, 2016, 08:52:47 am
content: Quote from: Mechatrommer on October 23, 2016, 04:43:59 amthat diagram is a "Typical Gate Charge vs. Gate-to-Source Voltage" tells very little about Vgs relation to Rdson, you can see where it enters saturation mode but you can't tell anything about the lowest Rds from it (fully ON state). the OPs question was at what voltage the mosfet if "fully on". to answer that question you would need a Vgs vs. Rdson diagram and that's not in the datasheet.and could you please elaborate on your statement ?Quotewhat did you mean by it's "ONLY for nfet in saturation mode" ? pfets have Rdson and thershold voltage too ! do not discriminate pfetsbasically we could describe the mosfet's Vgs to Rds this way: as the Vgs is increased from 0, at the threshold voltage the Rds start to drop (mosftet start "opening") and in fact the mosfet is in the linear region, Rds drops in somewhat linear(-ish) fashion at some rate. as you increase the Vgs further at some point the Rds drop "flattens out" but is still decreasing, the mosfet enters it's saturation mode. further increase of Vgs will give you a small drop in Rdson till the point of lowest Rds and further increase of Vgs toward max allowed Vgs will do nothing. so the answer to "at what Vgs the mosfet is fully ON" is exactly the point when minimal Rdson is reached - but that parameter is not defined in the datasheet, it indicates only the Vgs where the lowest RDson is guaranteed, not a voltage when it's reached.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 23, 2016, 09:25:53 am
content: because OP is using nfet, so i specifically explain to n-type without going to complicate things explaining pfet, which is just no more special than nfet symetry (except poorer spec). and why would the OP want saturation mode? which he wont be able to get to from his circuit. if there is saturation mode, there will be near 5V across the 0.2ohm (+0.077ohm Rdson) = 18A current flow, give or take.

author: DuncanSteel
author_rank: Contributor
timestamp: October 23, 2016, 11:06:07 am
content: So now is the time to choose the op-amp.I have couple questions regarding calculation.As an example lets use theNE5532My power supply will be +5V& since I dont have a negative power supply I will use the same op-amp in inverting op-amp config to obtain negative voltage on the negative supply pin.1) First how do I know how much voltage can I apply to the positive & negative input pins?

author: bktemp
author_rank: Super Contributor
timestamp: October 23, 2016, 11:29:24 am
content: Input: Look at the common mode range. Here it says typ. +/-13V for +/-15V and guaranteed +/-12V for +/-15V. So it will work down to typical 2V (worst case 3V) above negative rail up to typical 2V (worst case 3V) below positive rail.At 0V/5V supply voltage it will therefore probably operate from 2 to 3V input voltage or worst case it won't work at all.For the output voltage the given Output voltage swing is the same as the input voltage for the NE5532. But this voltage also depends on the load current (in this case >600ohms to ground (=0V =(positive+negative supply voltage)/2). Since a mosfet is a high impedance load, it may be higher, but it is not specified.Rail2Rail opamps have a common mode voltage of slightly below negative rail to slightly above positive rail and an output voltage range of a couple of mV near the supply rails for low output currents.

author: DuncanSteel
author_rank: Contributor
timestamp: October 23, 2016, 12:27:00 pm
content: Quote from: bktemp on October 23, 2016, 11:29:24 amHow do you calculate this for +5V/0V supply voltage?At +15V/-15V supply voltage it will work if input is between +/-13V & guaranteed to work if input is between +/-12V. correct?I don`t understand how did you get 2V offset from 5V. tried to do the ratio calculation, but the numbers don`t match up.15V-100 %12V-80 %5V-100 %2V-40 %

author: rob77
author_rank: Super Contributor
timestamp: October 23, 2016, 12:28:45 pm
content: Quote from: DuncanSteel on October 23, 2016, 12:27:00 pm2V above 0V is 2V and 2V below 5V is 3V probably ?

author: DuncanSteel
author_rank: Contributor
timestamp: October 23, 2016, 12:31:35 pm
content: Quote from: rob77 on October 23, 2016, 12:28:45 pmI understand that, but how did you get those 2V to begin with?simply 15V - 13V ?

author: rob77
author_rank: Super Contributor
timestamp: October 23, 2016, 12:40:03 pm
content: Quote from: DuncanSteel on October 23, 2016, 12:31:35 pmit's a property of the NE5532 opamp - it can't go closer than 2V to supply rails (both input and output).

author: bktemp
author_rank: Super Contributor
timestamp: October 23, 2016, 12:49:52 pm
content: Quote from: DuncanSteel on October 23, 2016, 12:31:35 pmYes.But this is only a very rough estimation, because the opamp is only specified at +/-15V. Therefore for any supply voltage other than +/-15V all the specifications are not guaranteed. Most of them won't change much, but you have to measure them yourself to be sure.Opamps designed for low voltage operation often have different specifications for different supply voltage ranges. TLC271 datasheet for example has specifications for 5V and 10V.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 23, 2016, 01:26:10 pm
content: Quote from: DuncanSteel on October 23, 2016, 11:06:07 amits not gonna work.for opamp to output negative voltage, it must have -ve power supply at Vcc- to begin with. you cannot create food from yourself, overunity doesnt work here. the device for that purpose is inverting buck or boost converter. with only 5V power supply, you have to work within 1Vpp common mode range that is 2V-3V, even in inverting config, opamp will not be able to output anything beyond that.

author: DuncanSteel
author_rank: Contributor
timestamp: October 23, 2016, 01:55:19 pm
content: I see, there is in this case 1 more thing I don`t fully understand. How big will be the output voltage if the supply voltage is +5V/0V and input voltage at pin (+) is say 2,5V.?Input Offset Voltage is 4mV, so 5V-0.004V= 4.996, but I measured the real time output & it was 3,6V. How comes?

author: Kalvin
author_rank: Super Contributor
timestamp: October 23, 2016, 03:14:48 pm
content: You can also think about your problem like this:- Let's say you want to have a maximum of 0.1V at the sense resistor at the full current.For a sake of example, let's say that you are designing the constant current load for a maximum of 2.5A load.- At the maximum current of 2.5A and 0.1V across the sense resistor, the sense resistor needs to be R = U / I = 0.1V / 2.5A = 0.04 ohms.- At the maximum current the power dissipated in the resistor is P = U * I = 0.1V * 2.5A = 0.25W, so you should select a 1W or 3W resistor.Let's say you will use the constant current load to the a 5V or 12V power supply or car battery.- At 5V the MOSFET will need to dissipate (5V - 0.1V) * 2.5A = 12.25W.- At 12V the MOSFET will need to dissipate (12V - 0.1V) * 2.5A = 29.75W.In order to the MOSFET pass the 2.5A current it is quite safe to assume that the Vgs has to be something like 4V more that the source voltage. In this particular example, the op amp is required to be able to drive its output ie. the MOSFET gate voltage to be at least 4V + 0.1V = 4.1V in order the MOSFET to pass the 2.5A current. If the Vgs needs to be more that 4.5V at 2.5A it is quite probable that you need to choose another MOSFET. You need to check the MOSFET datasheet for actual numbers.In order to make the MOSFET close completely in practical terms, the Vgs must be below the threshold voltage Vth. Let's assume the Vth is 2V for the MOSFET.What we have now found out is as follows:- The sense voltage across the sense resistor will be 0.1V at the maximum current.- The sense voltage across the sense resistor will be 0.01V at 250mA.- The sense voltage across the sense resistor will be 0.001V at 25mA.- The op amp driving the MOSFET gate needs to be able to drive its output up to 4.1V when the maximum 2.5A current is required.- The op amp driving the MSOFET gate needs to be able to drive its output below 2V in order to close the MOSFET completely.From the following facts we can say that we need an op amp that needs to be able to operate on input signals very close to the negative rail, its input offset voltage needs to be less than 1mV, and provide output signals that are quite close to the positive rail, and the minimum output voltage needs to be 2V of the negative power supply rail or less when the op amp is operated from 5V power supply.When you take a look at the datasheet of the NE5532 you may find out that some of the requirements are not satisfied**. So, you may want to check some other op amps that are targeted for a single supply operation, have low offset voltage and which have RRIO specification. You may also tweak the sense resistor value somewhat higher if the op amp's input voltage range cannot go close enough to the negative rail and you want to be able to adjust the current in milliampere range. If you want to have multiple ranges, you may want to consider something like this:http://electronicdesign.com/displays/resistive-dummy-load-draws-constant-current-12-50-vNotice also how the op amp is compensated as it is driving a MOSFET gate.To answer your original question: The probable cause is that the op amp cannot maintain the feedback loop so that the voltage across the sense resistor is constant. Either the op amp cannot drive the MOSFET gate high enough or the input of the op amp cannot measure the very small voltage close to the negative rail across the sense resistor. Or both.** From the NE5532 datasheet one can see that at +/- 15V power supply the Common-mode input-voltage range is typically +/- 13V. That means that the input signal needs to be 2V less than the positive operating voltage and 2V more than the negative operating voltage. In the +5V single supply case this means that NE5532's input signals needs to be in range (0V + 2V) ... (5V - 2V) ie. between 2V ... 3V. In a similar fashion one can see from the datasheet that the Maximum peak-to-peak output-voltage swing is 26V which means that the output will swing 2V less the positive operating voltage and output will stay 2V above the negative operating voltage. In a 5V single supply case that the NE5532's output will be able to swing typically only in range 2V ... 3V.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 23, 2016, 06:13:31 pm
content: Quote from: DuncanSteel on October 23, 2016, 01:55:19 pmyou dont provide enough information. please measure whats the reading on -ve input pin, ie the 0.2ohm/0.01ohm top side. are you refering to 0.2ohm? or 0.01ohm?

author: DuncanSteel
author_rank: Contributor
timestamp: October 23, 2016, 11:30:14 pm
content: Well i kind of understand now what I need, the problem is to understand the datasheet.Let me try. I found this Op-ampTS1005IJ5T, If I understood this correctly,1) The output of this Op-Amp can range fromMax0.8V+30mV = (0,83V)to5,5V-60mV = (5.44V), Correct?2) And input can range from (max 5mV?)0.8V+5mV=(0.805V)to5,5V-5mV=(5.495V), correct?

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 24, 2016, 12:14:02 am
content: Quote from: DuncanSteel on October 23, 2016, 11:30:14 pmif you are suplying the opamp with 0.8V at Vdd, max output is 0.8V-60mV = (0,74V)if you are suplying the opamp with 0.8V at Vss, min output is 0.8V+30mV = (0,83V)if you are suplying the opamp with 5.5V at Vdd, max output is 5,5V-60mV = (5.44V)if you are suplying the opamp with 5.5V at Vss, min output is 5,5V+30mV = (5.53V)Quote from: DuncanSteel on October 23, 2016, 11:30:14 pmhttps://en.wikipedia.org/wiki/Input_offset_voltage