MOSFET Datasheet vs. measurements - where am I slipping up? - Page 1
Forum section: electronics / beginners

author: dvh
author_rank: Contributor
timestamp: March 09, 2024, 06:20:06 pm
content: Hello folks!I'm testing my understanding of MOSFETS. I picked one that I had, BS170 enhancement type MOSFET.I designed an experiment where I'm trying to determine what VGSI need to ID=150mA @ 5V. I hooked up a pot to an arduino, where based on the voltage @ the pot, I change the duty cycle of an analog pin. That pin is hooked up to the gate of the MOSFET via a 5K resistor. (Please see the simulation).On the simluation, I can read that I need about 3.7V on the gate to get 150mA current to flow on the drain. On the datasheet, I read something similar.In measurement, I saw something completely different. I only took 4 measurements but it should give you an idea why I'm confused. (I measured the current with a multimeter and VGSwith an OScope - VGSis the mean of multiple PWM cycles where PP is 0-VCC)My first surprise is that the MOSFET starts conducting way below 2V, which I saw in the datasheet. Why could that be?

author: Zero999
author_rank: Super Contributor
timestamp: March 09, 2024, 06:41:48 pm
content: That doesn't look right. The minimum threshold is 0.8V with a drain current of 1mA. There must me an error in your measurement or the device is bad or fake.Have you checked the drain and source connections aren't reversed?Does the drain current drop to near zero, when the gate is shorted to the source?

author: wraper
author_rank: Unknown
timestamp: March 09, 2024, 06:47:32 pm
content: Quote from: dvh on March 09, 2024, 06:20:06 pmThen it's literally not analog and you are just switching the mosfet on/off and VGSis either 0V or 5V. Thus threshold voltage spec and transfer characteristics become irrelevant to your measurements.

author: dvh
author_rank: Contributor
timestamp: March 09, 2024, 06:57:25 pm
content: Quote from: wraper on March 09, 2024, 06:47:32 pmExactly what happened! Ran another simulation with a square wave to see if that changes anything. Please see this screenshot of measurements and simulation values.Basically, with the PWM, I jump between 0 and 5V. @5V, naturally, the MOSFET conducts but only for the +duty. If I smooth out the PWM signal I might see what I want - the FET starts conducting around 2V.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 09, 2024, 07:03:39 pm
content: Yes, you can turn the PWM output into a pretty nice low-cost DAC by adding an RC filter. C needs to be large because of the crappy 1st order characteristic to get rid of the PWM carrier frequency (you'd also want to use the highest possible PWM frequency setting which still delivers just enough resolution), but when speed does not matter (i.e. settling time in seconds range is acceptable) it's a simple circuit.

author: Zero999
author_rank: Super Contributor
timestamp: March 09, 2024, 07:11:47 pm
content: I'm confused. Are you purely talking about simulation or real life? A SPICE simulator will just use the model given to it. If it's bad, then it'll produce incorrect results.Going from the plot, it looks like you have a depletion mode MOSFET. I do remember seeing some devices designed both for enhancement as well as depletion mode. They have a gate threshold of somewhere around 0V. Unfortunately I can't remember the part numbers and have no idea if they're still made.Check the part number. Failing that, it's possible you have a fake, recycled part i.e. a depletion mode MOSFET, with the part number changed to BS170. It would be weird since small depletion mode MOSFETs tend to be more expensive and tricky to get hold of nowadays, but someone stripping parts off old boards, to resell as new will just want to make a profit and will use part numbers they know will sell.

author: MarkT
author_rank: Frequent Contributor
timestamp: March 11, 2024, 08:21:38 am
content: Also note real MOSFETs have considerable variation in threshold voltage due to trapped charge/ions in the gate oxide - this can vary over time due to applied field too, so don't expect threshold voltage to be particularly well defined or constant over time. Older devices were worse, but its still an issue. For power MOSFETs you typically see a +/-1V specification for Vthr for instance.

author: Circlotron
author_rank: Super Contributor
timestamp: March 11, 2024, 09:49:21 am
content: Quote from: dvh on March 09, 2024, 06:20:06 pmWhy not just connect the pot to the mosfet gate directly via the 5K resistor??? No Arduino needed.

author: dvh
author_rank: Contributor
timestamp: March 12, 2024, 09:44:37 pm
content: Yup! What I did. 10uF was enough to get things rolling. There is tiny variation in output voltage around 50% duty cycle but that is more than tolerable. I could do a capacitor multiplier circuit to get rid of that ripple but meh... Good enough! I ended up using prescaler 8 on an ATMega328p to achieve 25KHz to go above audible range. Hundreds of KHz would be quite possible but this seem to work out just fine.Quote from: Zero999 on March 09, 2024, 07:11:47 pmThankfully it is a BS170, everything worked as I saw in the datasheet once the input PWM signal at the gate was smoothed.Quote from: Circlotron on March 11, 2024, 09:49:21 amI want to control a tiny DC motor with it. That means I have to deal with inrush current. It was easier for me to design a circuit around a microcontroller which gradually applies increases duty cycle than solve it with discrete components. Not even sure how I'd go about it.

author: Zero999
author_rank: Super Contributor
timestamp: March 12, 2024, 10:52:34 pm
content: Quote from: dvh on March 12, 2024, 09:44:37 pmNo capacitor is required. In fact it's counterproductive, as it will result in slow switching and the MOSFET neither fully on nor off.The whole point of PWM is the MOSFET is either on or off. The gate voltage needs to be high enough to ensure it turns on with a low on resistance and negligible voltage drop.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 13, 2024, 02:38:52 pm
content: Very small DC motors (tens of W, inefficient) --> PWM into generously dimensioned MOSFET.Larger motors --> add fast current sense (e.g. low-side sense resistor + amplifier) and pulse-by-pulse current limiting (PWM cycle termination)In either case, freewheeling diode (schottky), tight layout and DC link capacitance are important.

author: pcprogrammer
author_rank: Super Contributor
timestamp: March 13, 2024, 03:19:04 pm
content: Or just use a dedicated motor driver IC. They are not very expensive, can have build in current limiting, makes it easy to reverse the motor if needed, deals with the back EMF, etc.Thesefor example can deal with a lot of current and also limits it with pulse width modulation of its own. Very good when starting up a motor that draws a lot of current initially.But there are many motor drivers to be found also in combination with Arduino's, like the MX1508 modules.