Comments requested on MOSFET high-side driver

Incorrect. You never use the linear small signal beta to calculate saturation current.

Use more like 10 or 20. For a 2N3904, the datasheet says 10x.

Page 3, it rates saturation VCE for IC = 10mA when IB = 1mA, and IC = 50mA when IB = 5mA.
http://www.physics.csbsju.edu/~awhitten/phys358/reference/2N3904_4.pdf

So for 4.3mA, don't count on more than 43mA IC through Q2.

You should always get a resistor with a power rating at least 2x the power that will be dissipated.

It looks like you just took the power in R2 and used it to calculate heat in Q1.

Q1 power is the sum of power from the base and the collector currents and drops:
0.95 * 0.0043 + 0.2 * 0.026 = 9.285mW

In fact, from the datasheet 200mV drop VCE is maximum. It is usually less than that. But plan for the maximum.

I would have said "Power -in- R2".

OK just to make sure:

Q1 power is the sum of power from the base and the collector currents and drops:
0.95 * 0.0043 + 0.2 * 0.026 = 9.285mW

VBE(sat) = 0.95
5V (at pin) - VBE(sat) / 1k = (5 - 0.95) / 1000 = 0.00405 (4.05 mA)
VCE (sat) = 0.2
26 mA to sink through the resistor

Thus:

Power = 0.95 * 0.00405 + 0.2 * 0.026 = 0.0090475 (9.05 mW)

Heat gain = 0.0090475 * 200 = 1.81 °C

Does that sound right?

Whoops, forgot to correct the base current with the higher VBE. :-[

That looks right.

Changing R2 to 470 ohms seems to have reduced the rise time at the gate to 5.5 µS.

From 58uS to 5.5uS. Sounds about right.

One of the problems you run into with a MOSFET is drain to gate capacitance. So as the gate is discharging (going high), the drain is going low, and the capacitance between gate and drain slows the discharge of the gate by providing some charging current.

That is probably part of why a 20:1 change in resistance only resulted in an 11:1 change in Off switching time.

So it would be reasonable to suggest, other things being equal, that if we are doing PWM, to reduce the frequency, so that these "edge cases" happen less often? Obviously this problem goes away if we are switching infrequently, like turning garden lights on and off.

I have finished the tentative tutorial, which is at Gammon Forum : Electronics : Microprocessors : Driving motors, lights, etc. from an Arduino output pin.

There is more explanation in the tutorial than I had above, plus a low-side driver (to sink current). If you spot any mistakes please let me know.

@polymorph - I scaled R2 back to 1k, it seemed we were getting diminishing returns on low-value resistors, and that would keep the current drain on Q1 down. The switching time is now about 7.5 µS.

How is the MOSFET temperature with the new resistors?

I use MOVs when switching transformers and solenoids and believe you could get much greater speed improvement with your MOSFET high-side motor driver. The speed improvement comes from clamping higher than the 0.7V of a diode. I haven't used MOVs across a motor, but I wonder what speed improvements could be had with an MOV rated for 16V DC such as this:

Also check this post:
http://forum.arduino.cc/index.php?topic=294268.msg2064128#msg2064128

Good trade-off.

Yes, if the application is fine with a slower PWM, that saves switching losses and the other losses associated with it like driver current losses.

The 1N4001 is not a fast switching diode. It is a garden variety line frequency rectifier, but it switches On fast enough to absorb most inductive transients. What dlloyd is referring to is more of an issue with the speed of magnetic field collapse in a coil. This is an issue with relays as a low clamp voltage can cause contact burning as it slows release. In that case, adding a resistor in series with the clamping diode can speed that up.

For a motor, it is going to generate a voltage as it continues to turn, but it will be in the same polarity as the voltage applied and not spike up any higher. Well, except a motor is also made of inductors, so I'd still keep the diode.

For your MOSFET power calculations, I'd say 2^2 rather than 4. It is clearer, then, that the number is 2A squared.

I try, as a general rule, to keep device temperatures under 75C when possible. 150C may be a maximum, but by mentioning, you may be unintentionally giving people the impression that it doesn't really have any drawbacks.

Well, it still got up to around 32 °C, which I am not that impressed with, but I think my test conditions are not helping. With a fixed current from the lab supply it is dropping the voltage to around 3.6V which then means I think it is not properly switching on.

I think I'll retry with a lower current, thus allowing the voltage to rise.

For your MOSFET power calculations, I'd say 2^2 rather than 4. It is clearer, then, that the number is 2A squared.

Fixed.

Ach, make that a higher current, allowing the voltage to rise. But then the higher current heats the thing up more.

It's tricky setting up good test conditions.

Missed the fact that the traces were generated using a 2 ohm resistive load ... would be different with inductance included.

Ah, I thought that was a general recommendation. I haven't used MOVs before, would you just put it across the load like the diode? And what specs would apply in this case?

Yes, directly across the load is best. I've used them successfully for many applications - mainly transformers in AC circuits. Since a transformer and motor are closely related ... hence my suggestion. For sizing, the first spec. I look at is the working voltage. In a 120VAC circuit, I use MOVs rated for 150VAC continuous, the clamping voltage is higher. Then I look at the surge current rating and energy rating.

If the 12V supply is regulated, then any MOV with a continuous DC voltage a few volts higher than this would be OK. They're even simpler to use than a diode because polarity doesn't matter.

So as a working recommendation, the one you mentioned (B72210S1140K551) with:

Varistor Voltage (Min) 19.8V
Varistor Voltage (Typ) 22V
Varistor Voltage (Max) 24.2V
Current - Surge 500A

... would probably be OK for a 12V motor?

But what does this mean?

Maximum DC Volts 16VDC

Is that basically saying that it is basically open circuit up to 16V but then conducts (up to 500A) starting at 19.8V?

Yes, that's how I understand it ... it works like back to back 16V zener diodes with a bit of series resistance. There are some detailed graphs somewhere SIOV metal oxide varistors

back to back zener diodes

See Transorbs: