Can I drive a N-FET directly from a DAC ? - Page 1
Forum section: electronics / beginners

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 20, 2016, 11:18:45 pm
content: Like the title says, can I drive a N-FET (SSS7N60A, datasheet) directly from the output of a DAC, as long as I use a proper resistor?Specifically, the DAC I plan to use is the MAX539 (datasheet), which will in turn be controlled by a Atmega328. The MAX539`s datasheet states on page 8 that its output can drive a 2kOhm load. I figure that if I place a 2k (or 2k2) resistor between its output and the SSS7N60A`s gate then bob's my uncle.Is the above correct or should I use a rail-to-rail op amp configured as voltage follower between the DAC and the FET ?BTW, I'll be driving the FET with DC voltage, but I'll stay within its SOA.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: January 20, 2016, 11:41:15 pm
content: That DAC is buffered, meaning it already has an op-amp inside. So yes, you can directly drive the gate with it so long as you have a reasonable current limiting resistor.Some DACs are not buffered, those would need an external op-amp buffer in order to make them suitable for this application.

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 21, 2016, 12:10:00 am
content: Quote from: suicidaleggroll on January 20, 2016, 11:41:15 pmThank you! I looked at another DAC (Texas' DAC121C081, which is way cheaper!), and it also has a buffer opamp on the output, besides being rail-to-rail (5V). It fits me better for what I need.

author: Audioguru
author_rank: Super Contributor
timestamp: January 21, 2016, 01:15:25 am
content: I assume the max output from the DAC is +5V? Then you must use a Mosfet that is called "logic level" because most Mosfets need a gate drive of 10V.

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 21, 2016, 01:47:23 am
content: Quote from: Audioguru on January 21, 2016, 01:15:25 amThe SSS7N06A that I am using starts conducting at 3.5V. I linked its datasheet in the original post. Its VGSrange is not as low as the IRL540, but it will have to do (since the IRL5x0 devices are extremely hard to find in Brazil, and there are people selling remarked or fake IRL5x0 in our eBay equivalent). I suppose that with 12bits I have pretty good accuracy from 3.5 to 5 volts.

author: newbrain
author_rank: Super Contributor
timestamp: January 21, 2016, 11:56:58 am
content: Quote from: AlxDroidDev on January 21, 2016, 01:47:23 amIf I understand correctly from your other posts, the aim is to build a programmable load.You haven't (AFAIK) posted a schematic as yet, except the incomplete one inthis thread.Connecting the FET directly to the DAC is for sure possible, but don't expect any reasonable way to control the current in the load if a feedback loop is not in place (it will vary with Vds and temperature).Check other schematics on the net (e.g. from thisDave Jonesguy, you might have heard about him): they mostly use at least one op-amp and a sense resistor to stabilize the current with respect to a reference (pot or, in your case, DAC out).In your case even the lowly LM358 would do, as its common mode input include ground and the output need not go very close to ground, give the high Vth of the FET.You need to use an higher value than 5V for op-amp power supply, though, depending on the chosen sense resistor and the desired maximum current.E.g. (napkin calculation) Rsense=1ohm, max Ids 2A -> Vsense = 2V, Vgs(2A) ~=4.5 (FET), Vcc-Voh~=1.5V (LM358): at least 8V needed.Of course, if all this is already known to you, I apologize for stating the obvious!

author: tszaboo
author_rank: Super Contributor
timestamp: January 21, 2016, 12:03:34 pm
content: FET is capacitive laod, DACs hate that. FETs are non linear characteristic. And the Vgs changes rapidly with temperature.

author: ealex
author_rank: Frequent Contributor
timestamp: January 21, 2016, 03:22:05 pm
content: why not use the DAC to change the reference voltage and an op-amp to drive the mosfet ?the DAC will replace Vin from this picture:fromhttp://electronics.stackexchange.com/questions/188345/is-it-safe-to-use-pc-analog-output-card-as-current-sourceyour DAC will only need to output low voltages -> you can use most of it's range.the op-amp will take care to drive the mosfet so that the voltage across the sense resistor will match the output of your DAC.i could get something like 1KHz update rate with a very cheap op-amp and I2C 12 bit dac with some decent precision, etc.It did oscillate at first when i was using 2 mosfets in parallel without separate gate resistors. Applying a sequence of 0 - full range - 0 again got the mosfets oscillating at almost 100MHz. That was fixed by adding 100 ohm resistors on each gate.you need to limit the bandwidth, etc. so it does not oscillate.

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 21, 2016, 03:49:17 pm
content: Quote from: newbrain on January 21, 2016, 11:56:58 amThank you for your replies. You understood correctly, and that's exactly what I want to build. I am at this point trying to learn what I can and cannot do. I still don't have a full schematics yet, but what I have is attached to this post (please see below).QuoteI plan to control it with a INA219, and the Arduino will be responsible to control the FET's gate to keep the current at the adjusted level.My schematics still need a lot of work, specially the human interface part (IDK if I'll be using pots or buttons to input the values to the Arduino), but that's the easy part. Possibly I'll be using a Nokia 5110 display in this project.QuoteI've heard about that fellow! Nice guy!The FET will be screwed to a coooling rib. I am also thinking of placing a thermistor  near the FET so I can monitor its temperature and act accordingly if it gets too hot, like turning it off or turning on a small fan. If I choose the fan, I'll have to switch to another power source, like a 12V wall wart.

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 21, 2016, 03:52:23 pm
content: Quote from: NANDBlog on January 21, 2016, 12:03:34 pmQuote from: ealex on January 21, 2016, 03:22:05 pmThank you. I'll be using this approach in my project. I chose the JRC4558 simply because I have several of them lying around from when I used to build guitar pedals for me and my friends (clones of the famous Tube Screamer 808 and a few other).

author: suicidaleggroll
author_rank: Super Contributor
timestamp: January 21, 2016, 04:07:40 pm
content: Yes for a dummy load you'll need (want) an op-amp, not to buffer the DAC, but as a feedback mechanism to keep the FET stable. You'd have to run your ADC and DAC VERY fast (likely faster than an Arduino is capable of) in order to keep the system stable if you were trying to drive it directly. Both approaches use a closed-loop feedback mechanism to set the FET's gate voltage, but analog/hardware feedback using an op-amp is going to be much easier to stabilize than digital/software feedback due to the significantly smaller loop delay.

author: newbrain
author_rank: Super Contributor
timestamp: January 21, 2016, 06:47:30 pm
content: Quote from: suicidaleggroll on January 21, 2016, 04:07:40 pmI agree with suicidaleggroll: it won't be easy to implement a digital control loop, stable but fast enough to keep the current steady with the DUT changes (and when I think 25 years ago I used to know all the math behind this...I should go back to studying).I'd rather use an analog one (as in Dave's load) and use the INA just to read back the actual value (albeit the Atmega ADC can be enough for the task).In that case, though, the jrc4558 will not do, due to the limited input range that does not include the negative rail (ground in this case).Another question: what is the purpose of the 1 ohm (5x5ohm) resistor?

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 21, 2016, 08:22:02 pm
content: Quote from: newbrain on January 21, 2016, 06:47:30 pmI think that approaching this project digitally is not a good way to go then. I am watching Dave's video on his electronic load (for the third time... and each time I learn something), and checking out other projects too. I'll just use a knob and those 2-in-1 LED ammeter+voltmeter.QuoteI thought that there needed to be an actual load - thus the resistors, isn't that so? The FET would only function as a "controlled door" that would control how much current would be allowed to flow through those resistors. Since you made the question, I think I am totally wrong and there is no need for the resistors.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: January 21, 2016, 09:01:52 pm
content: Quote from: AlxDroidDev on January 21, 2016, 08:22:02 pmNo need to abandon digital, just use the MCU and DAC to control the set point, not to control the FET gate voltage directly. By using an MCU to control the current your load can do more than just constant current. You can also do constant power, constant resistance, or you can step or ramp the current up or down, etc.Quote from: AlxDroidDev on January 21, 2016, 08:22:02 pmActually the FET itself is the load (well, the vast majority of it). The resistors are used as a shunt, to measure the current as part of the feedback loop. Though usually they're on the source side of the FET, not the drain side. I'm sure how they'd work up there.

author: dadler
author_rank: Unknown
timestamp: January 21, 2016, 09:08:30 pm
content: The mosfet is supposed to be the load. The resistor should likely be much lower value, and used to sample the current for the feedback loop. The resistor sizing depends on how much current you want your load to be able to sink.The current is proportional to the voltage drop across the resistor according to Ohm's law. This voltage is fed back into your analog control loop to regulate the current.I recommend something like a 20-100 mOhm resistor as a current sense resistor (on the source side of mosfet), to minimize dissipation and not push your source voltage up too high to the point that you cannot control the mosfet. This is what occurred in your other thread.With a 1 ohm resistor, you drop 1 volt for every amp of current, which will fight your Vgs.You can also put the sense resistor before the mosfet (drain side), as long as your instrumentation amplifier can handle the higher common mode voltage.

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 21, 2016, 10:30:29 pm
content: Quote from: newbrain on January 21, 2016, 06:47:30 pmEven if I supply the JRC4588 from the +9V source? I figure a rail-to-rail opamp would be better, right? I'll try and get a hold of a MAX492.Quote from: dadler on January 21, 2016, 09:08:30 pmI'll update the design, removing the 5R resistors, and keeping the 0R1 shunt resistor connected to the INA219 and connected to the high side of the DUT.Thank you for the time and knowledge you're sharing with me. You're all being very helpful.

author: dadler
author_rank: Unknown
timestamp: January 21, 2016, 11:00:09 pm
content: The INA219 is a digital current amplifier. You can use it (say to drive readback on your display), but you will still want an analog instrumentation amp (or equivalent op amp circuit) for analog feedback. In this case, low side current sensing (one side of the resistor to ground) can simplify things. If using an inst. amp, the sense common mode voltage is now closer to ground. In this case a regular op amp will likely suffice.

author: dadler
author_rank: Unknown
timestamp: January 22, 2016, 12:36:48 am
content: Here is an interesting circuit that addresses the high-side common mode voltage issue:http://www.intersil.com/content/dam/Intersil/collateral/en/cookbooks/st-091.pdf

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 22, 2016, 01:22:28 am
content: Quote from: suicidaleggroll on January 21, 2016, 09:01:52 pmIf I put the resistor on the source side of the N-FET, I'll fall in thesame problem I had before, won't I ?

author: dadler
author_rank: Unknown
timestamp: January 22, 2016, 02:24:22 am
content: Quote from: AlxDroidDev on January 22, 2016, 01:22:28 amIf the voltage drop across the resistor is low (low valued resistor), then it will still work. The absolute gate voltage will need to be a bit higher to compensate, but your analog feedback circuitry should handle this transparently.You ran into the problem before because of the high shunt resistance, non-logic level mosfet, and 5V limited control voltage. You could also drive the mosfet gate with a higher max voltage in general--say 12 or 15V.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: January 22, 2016, 03:01:07 am
content: Quote from: dadler on January 22, 2016, 02:24:22 am^ ThisWhile DACs are usually pretty limited in their output range (3.3v common, 5v the usual max), there are many every-day op-amps that will happily go to 30v and higher, as long as your V+ is up there. Give your op-amp a 12V rail to work with (as long as the op-amp is happy with a V+ - V- range of at least 12V) and it won't matter.As far as your load goes, if you're going to go the traditional route of placing your shunt resistor between the FET's source and ground, there are some basic rules you need to follow.The absolute first thing you need to do is decide on the maximum current rating for your load (let's call it Imax), and the minimum voltage at which this current can be achieved (let's call it Vmin). You can iterate on these parameters as necessary, but you need to have some numbers here to work with before you can proceed.Next, choose a shunt resistor (and possibly an instrumentation amp) for current monitoring. Make sure you choose a shunt resistor that can handle the power at Imax, and that Imax*Rshunt is well below Vmin.Next, choose a FET and maximum rail voltage - these two sort of go in tandem. You need a FET with an Rds(on) such that Imax*(Rds(on) + Rshunt) is below Vmin. Most FETs also don't hit their Rds(on) until at least 2x Vgs(th), so your rail needs to be high enough such that Vgs(th) < 0.5*(Vrail-(Imax*Rshunt)). That is, at full current, the gate can still be pulled at least 2x Vgs(th) above the source, which at full current will be equal to Imax*Rshunt.Now these values all assume a rail-to-rail op-amp. Whatever op-amp you use NEEDS to be able to push the output to V-, that's a basic requirement. It does not, however, need to push the output to V+, as long as it can push it to what I've called "Vrail" in the above equations, given your actual V+. That is if you calculate a "Vrail" of at least 12V using the above equations, and the op-amp you've chosen can swing the output to ground but can only swing the output up to (V+ - 1V), then you need a V+ of at least 13V.Does any of that make sense?

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 24, 2016, 11:31:16 pm
content: Hello again, fellows.After carefully reading and trying to make sense of all you wrote, I found a circuit online that has lots of similarities to what I want and I tested it. First I simulated it on Multisim 14 (schematics and numbers below) then I breadboarded it with 100% success.As it is on the breadboard right now, it is already good enough for most of what I want, but I want more. This is the list of features that I'll implement on my electronic load:- up to 4A using SSS7N60A- LM35 (in TO-92) attached to the FET to monitor its temperature- old CPU heatsink + fan, with speed controlled by the Arduino- 1Mbit EEPROM memory to save data points: elapsed time, load (A), voltage, temperature- interval at which data points are saved and if they are saved is user-defined- relay to turn load on/off- a few LEDs (what is a tech device without LEDs)? How do you guys feel about blue LEDs @ 20mA ?- ability to pulse the load (at 968 Hz, user-defined duty cycle)- 3 operation modes: constant current, constant voltage, constant power- fuse (4A)- Nokia 5110 display to show everything- output of data through the USB/Serial connection (can be turned on/off)- ability to import the EEPROM data to the computer through the USB/serialI might create a topic to post progress on the build and to post the Arduino sketch and schematics (it's the least I can do to return the huge help).Again, thank you very much for your valuable help.