Automotive PWM control of p-channel MOSFET (IRF4905) as high side switch

There is a solution to your problem and it is very simple ( though the description is a bit long winded).

Lets assume you are using an N channel Mosfet. In order to minimize power dissipation, you correctly assume that you must switch the FET on and off as fast as you can. As well as that you must select a device with a very low on resistance 1 to 2 milli ohms would be ideal. A high voltage FET is not required 30 to 40 V is adequate.

The switching frequency of 500Hz is probably adequate as the process relies on the thermal inertia of incandescent lamps.

To ensure that your FET is fully enhanced (switched hard on) with a 12V supply, a Logic level device is preferable. These are designed to be fully enhanced with the Gate / Source junction at 5V and will most certainly be so at the 10 - 12V you are likely to achieve.
I had a rummage on the Farnell web site and came up with an IRLB3034 which is a 40V N channel part rated at 195A and 1.4 milli ohm

The Gate / Source junction of a MOSFET is essentially capacitive and to switch the device on quickly this capacitance must be charged up quickly. To achieve this, resistors / resistance are you enemy.
It is worth noting that whilst charging the Gate / Source capacitance requires a substantial current it is only a very narrow pulse. I measured it in simulation at 300mA.

The accepted way of switching MOSFETS quickly is with a 2 transistor totem pole arrangement which will alternately charge and discharge the Gate / Source capacitor very quickly. The method is applicable to both N and P devices. Hopefully my picture will be attached (this is my first attempt, and if not perhaps someone will explain how) and will show the simple arrangement of totem pole Q1 and Q2 driving Mosfet Q3. The voltage source is the output of your Arduino.
I have used this circuit many times and have just designed a 15A buck converter (using a P channel device) running at 280KHz and no problems with stability. The transistors I use are rated at 45V will switch 800mA have a gain of 170 and fT (where gain reduces to unity) of 100MHz.

To keep the whole thing stable, the output of the totem pole must be connected directly to the gate of your device with the bottom end of it connected directly to the source. Don't be tempted to put a resistor in the gate connection. One of the main reasons for instability of these types of circuit is the inductance of wiring and long PCB tracks plus inadequate de-coupling of power supplies. You should also connect a large capacitor 100uF or so at the PSU input and connect others at supply pins for other devices.
Also, and very important, you must connect all the high current ground parts of your circuit including the PSU ground at a single point, do not daisy chain.

A further requirement for keeping the circuit stable is to keep all the wires as short as practicable and keeping the output wiring away from the drive circuit of the FET to avoid inductive or capacitive coupling.

To summarise. Whilst the rise fall time of the FET gate drive will have some effect on power dissipation these periods are relatively small compared to the on period. The bulk of the power dissipation is a result of the on resistance of your FET so you must ensure that your selected part is fully enhanced.

Hope this helps!

Totem pole.pdf (10.4 KB)

NOSUM:
There is a solution to your problem and it is very simple ( though the description is a bit long winded).

Thank you for taking the time to explain all this, NOSUM. With only minor differences (you don't show the PWM source and show a n-channel variant), your sample circuit is the same as my latest iteration. Within your explanation, I noted:

NOSUM:
To keep the whole thing stable, the output of the totem pole must be connected directly to the gate of your device with the bottom end of it connected directly to the source. Don't be tempted to put a resistor in the gate connection.

A couple of notes on this:

  • In this project's case, I need an "inverted totem pole"; Q2 and Q3 appear to be backward, but that's because I need Q2 to be on by default, and turning on Q1 flips Q2 and Q3. I'm aware there's a brief short circuit while Q2 and Q3 are on at the same time while they switch places; I'm thinking R5/R6 are sufficient to mitigate that.

  • I have seen a lot of discussion about ringing at the gate when trying to switch fast and hard, and the solution has (nearly invariably) been to add a small resistor immediately before the gate. Yours is the first comment I've seen that says otherwise. I'd be more than happy to leave such a resistor out (lower part count and all). At the moment, my tendency would be to leave it out and perhaps revisit this if things go seriously pear-shaped.
    As for MOSFET selection:

  • This is an automotive project; a low-side switch is not an option here. This project will use a p-channel MOSFET - specifically, I harp on using the IRF4905 as I have several on-hand, but would not be adverse to subbing in something faster and more efficient (like the AOTF4185).

  • Logic-level is not required here (there is more than the required 10V available for fully charging non-logic level MOSFETs' gates).

  • From your comments and specifically the example you gave of the buck converter you just designed, I think I'll start testing with the 2N3906/2N3904 for the Q2/Q3 pair. If I get too much heat at the MOSFET, I'll bump them to something which can flow a bit more current.

NOSUM:
To summarise. Whilst the rise fall time of the FET gate drive will have some effect on power dissipation these periods are relatively small compared to the on period. The bulk of the power dissipation is a result of the on resistance of your FET so you must ensure that your selected part is fully enhanced.

Selection of the IRF4905 was due to its 20mOhm RDS(on) and its 74A current carrying. I don't expect to ever see more than 10A, and from everything I've been able to determine, the majority of the power dissipated by this part of the project will come from transitions while switching the MOSFET, hence my focus on ensuring these occur as quickly as practicable (while also keeping an eye on inefficiencies of the driving circuit). Your contention that switching will dissipate less power than the on period provides me with additional hope that I can get this to work without requiring a heat sink on the MOSFET. :smiley:

Again, thank you NOSUM for your contribution. I appreciate the further opportunities to learn.

Cheers!
Dirk

Hi again. You don't need to invert the totem pole. What you have is two emmitor followers connected in series. It will work in the same manner for N or P channel without any modification.
The bulk of the power dissipation is caused as stated by the on resistance of the FET. A simple sum shows this. Power is Current squared * R (resistance). Therefore 10A * 10A =100 which is then multiplied by the on resistance of the FET which for you device I think is 20 milli ohms which works out at 2 Watts. If you sub your device for the one I found which has 1.4 milli ohms on resistance it comes to 140 milli watts. If you must have a high side device I suggest that you find another with a much lower on resistance I would suggest a BUK952R8-60E which has an on resistance of 2.2 milli ohm or perhaps a PSMN2R5-60PL with 2 miili ohms on resistance or maybe
As previously stated, the bulk of the dissipation is in the on resistance in the FET. The contribution of the switching periods is negligible.

The ringing you refer to is caused by the inductance of the connection between the drive transistors and the gate as well as the inductance of connection to the source. As previously stated keeping the wiring very very very short helps reduce it.

The output from your Arduino goes directly to the coupled bases of the totem pole with no resistor in between.

Referring to my diagram, the Arduino is represented by the signal source connect to the bases of Q1 and Q2.

I am by the way a retired electronics engineer and spent over 40 years doing this sort of thing.

Why is a low side switch not an option?

Why in your circuit do you need Q2 to be on by default?

I suggest that you download a circuit simulator called SIMETRIX which is used by professionals. You can get a free version. Learn to use it and then you can make all your mistakes in the virtual world at nil cost.

I adhere to the KISS principle.

Hi,
Have you actually prototyped any of this or is it just theory?

If not, then I would say, get some of the components, get your DMM out, set the circuits up and see what the results are.
Use a current limited supply, or one with a fuse in the power line and get dirty and experiment.

There is a term "over thinking".

Tom..... :slight_smile:

NOSUM:
Why is a low side switch not an option?
[...]
If you must have a high side device I suggest that you find another with a much lower on resistance I would suggest a BUK952R8-60E which has an on resistance of 2.2 milli ohm or perhaps a PSMN2R5-60PL[...]

This is an automotive project; it's not feasible to insert anything on the ground side of the load. High-side only for this project, and both of your suggested MOSFETs are n-channel. I'm aware that there may be driver/n-channel solutions that could be applied here, but I've come this far, and have been learning so much, I'd like to stay with a p-channel solution. Also, once you see the number of MOSFETs used by the whole project, you may better understand my penchant for p-channels. (I may re-do things in the future with n-channels.) I've looked for p-channels with lower RDS(on) and have found only one alternative which can comfortably carry the required 10A - the aforementioned AOTF4185 (16mOhms vs the IRF4905's 20). If I can get the IRF4905 working reasonably well, subbing in the AOTF4185 should be plug'n'play. 8)

NOSUM:
You don't need to invert the totem pole. What you have is two emmitor followers connected in series. It will work in the same manner for N or P channel without any modification.
[...]
Why in your circuit do you need Q2 to be on by default?
[...]
The output from your Arduino goes directly to the coupled bases of the totem pole with no resistor in between.

  • When everything is first powered up, Q4 needs to be off. The only way I figured that was possible is to have Q2 (on by default) where it is.
  • I wasn't sure if I could drive two BJTs (particularly if I sub in higher current carrying ones) with the 20ma usable from the Arduino. I'd rather stay on the safe side and leave in Q1 to drive the totem pole pair.
  • Yep, another calc I haven't figured out: how to determine base current required by a BJT. From what I can tell so far, this is dependent on all the circuitry around the BJT. Beyond me at the moment.
  • The Arduino's pins float by default, hence the pull-up, but maybe it'd work without the current limiting R1?

NOSUM:
The bulk of the power dissipation is caused as stated by the on resistance of the FET. A simple sum shows this. Power is Current squared * R (resistance). Therefore 10A * 10A =100 which is then multiplied by the on resistance of the FET which for you device I think is 20 milli ohms which works out at 2 Watts.

Ah. Thanks! I was trying to figure out an easy calc to determine ON current draw. (I've seen this calc before, but it apparently didn't stick.)

NOSUM:
As previously stated, the bulk of the dissipation is in the on resistance in the FET. The contribution of the switching periods is negligible.

I would love to have a simple calc (along with any assumptions that need to be made) I could use to determine - estimate? - heat contributed by switching times... :wink:

NOSUM:
The ringing you refer to is caused by the inductance of the connection between the drive transistors and the gate as well as the inductance of connection to the source. As previously stated keeping the wiring very very very short helps reduce it.

I'm trying to stuff everything for this project (the circuit in this topic occurs twice, plus power management and status LEDs) into a box about 1.5x1x1". Won't work though; at least one dimension needs to increase to about 1.75" (an Arduino Nano's length - though going to an ATTiny is not out of the question). No matter what, everything is being stuffed into as little real-estate as possible. :slight_smile:

NOSUM:
I suggest that you download a circuit simulator [...]

I've got LTSpice installed; beyond me (my patience?) at this time. I'd actually prefer to sort everything out theoretically, and maybe release a little - hopefully not too much - magic smoke while prototyping. ::slight_smile:

NOSUM:
I am by the way a retired electronics engineer and spent over 40 years doing this sort of thing.

I recognized right away that you have significant experience; I appreciate everything you're contributing here, NOSUM. Thank you.

Cheers!
Dirk

TomGeorge:
Have you actually prototyped any of this or is it just theory?

I've done some prototyping of earlier iterations.

TomGeorge:
If not, then I would say, get some of the components, get your DMM out, set the circuits up and see what the results are.
Use a current limited supply, or one with a fuse in the power line and get dirty and experiment.

I feel like I'm getting really close to that. :slight_smile: (For you Heinlein fans: I'm close to grokking all this.)

TomGeorge:
There is a term "over thinking".

Would you presume to call into question my raison d'être?! ??? ...and I think the proper term would be "anal". But, yeah, I do/am. :smiley:

Cheers!
Dirk

Hi again. I have tried LT Spice and it is not easy. Try Simetrix, it is a piece of cake it really is the bee's knees. When I first tried it, it honestly took me 10 minutes to figure it out and produce a simulation.
You can download a trial version which you may keep and run indefinitely. It comes with an instruction manual that will help enormously if you are not familiar with the protocols of these tools.
Go online to SIMETRIX.CO.UK.

Further. To calculate the base current you need to determine the current drive into the FET gate which in my simulation was 300mA. Then simply divide that by the gain of your chosen part. Example 300mA / gain of 170 (for transistors I suggested) gives a base current 1.76mA, well within the capability of your Arduino

Hi again from NOSUM.

Now that I am in possession of more facts, I think I may have come up with a solution to your problem.

First: You must have a P channel MOSFET to do the load switching.

Second: You need an on delay presumably whilst things settle or could it be that you wish to gate the circuit on and off?

Referring the attached schematic ARDUINO 3.

Source V2 represents the output of your Arduino and is set to run at 1KHz at an amplitude of 12V.

Q4 is driven by potential divider R3 and R4 (you need these otherwise the base emitter junction of Q4 will clamp the O/P of your Arduino to 0.6V above ground).
Then Q4 in conjunction with pull up resistor R2 drives totem pole Q1 and Q2 which in turn drive the gate source junction of Q6 (Q6 is just the default part on the simulator I was to lazy to change it).

An on delay is provided by Q3 which clamps the base of Q4 to ground stopping it from running. At switch on, C2 pulls up R5 switching on Q3 which provides the clamp. As C2 charges up the voltage at Q3 base diminishes until it falls below 0.6V at which point Q3 turns off releasing the clamp. Q4 is now free to drive the FET circuit.

If want to gate the circuit on and off instead, just remove C2 and connect it an appropriate O/P on your Arduino or use a switch connected to 12V.

The values shown for R5, R6 and C2 give a delay of about 28ms. Doubling the value of C2 approximately doubles the delay etc.

This circuit configuration also has the effect of preserving the phasing of you Arduino O/P.

Note; Simulation, schematic and chart generated on SIMETRIX.

Hope this helps

ARDUINO 3.pdf (11.3 KB)

ARDUINO 3 graph 1.pdf (29.5 KB)

NOSUM again. Correction to my last post. I had set the source voltage to 12V when in fact it should be 5V meaning that the circuit would not function as is. Change R3 to 3K3 and all will be well.

Yikes! Thank you, NOSUM. Definitely giving me food for thought. A preamble before I get myself into significantly more hot water than that in which I find myself already:

I have very little background in electronics, and, as I'm discovering, I appear to have little inclination and/or patience for the significantly more than anticipated math required for Every. Little. Detail. ...though - as may be apparent already - I like to over-analyze stuff. I know; interesting contradiction, but hey, I gotta be me. :stuck_out_tongue:

I try to compartmentalize complex systems. In this project's case, this topic deals only with managing the switching of the MOSFET. I'm making assumptions to this end (in this case, "we have clean 11-15V") which will be (have been?) dealt with separately.

I'm also extremely visual; I build pictures in my mind which represent solutions to goals. All the math in the world does exactly zero for this. (I used the word "grok" earlier; I meant that in all of Heinlein's expressed intent.) With this recent foray of mine into electronics, it appears that I build pictures of components. These have described (and spec'd) behaviours; if I can understand those behaviours and get an idea of how they could combine into possible solutions, I'm happy to have others do the nit-picky stuff of actually getting such compilations to produce real-world results. In other words, I'm pretty good at visualizing solutions, and have perhaps less-than ideal (for others?) mechanisms to actually implement them. I appreciate everyones' - particularly yours - patience with this approach.

(I'm aware that I may alienate (have already alienated?) some of the other truly amazing contributors here with this approach. That's sad, but, as I said earlier to TomGeorge, I get anal about - and love to nit-pick - theory.)

Onwards:

NOSUM:
First: You must have a P channel MOSFET to do the load switching.

Second: You need an on delay presumably whilst things settle or could it be that you wish to gate the circuit on and off?

"Yes", to the p-channel; and, "not sure" to why I'd need a delay. Power applied to this circuit will be on/off; I don't (yet) see any real reason for any delay (to me, doing so appears to add complexity where it isn't needed).

I have thought about what happens when the circuit is first powered up; consider there to be an on/off switch immediately between +11-15V and the rest of the circuit: when it is turned "on", the MOSFET must immediately be driven to turn off. There shouldn't be anything "stray" that interferes with this. Everything else is secondary and can wait until the Arduino has initialized (without a bootloader, this shouldn't be more than about 2ms). This is why I flipped the totem pole so the PNP is on "top" and the resistors added before and after the totem pole - nominally there to manage current draw through it - mitigate any concerns about shorting that path to ground.

NOSUM:
Referring the attached schematic ARDUINO 3.

Thank you for providing a different schematic representation; it helps me with understanding when I have to work at interpreting a different approach.

From what I can tell, your latest suggested circuit does not provide for charging the MOSFET's gate to turn it "off" by default. This is contrary to a basic requirement for this part of this project: the MOSFET must be "off" by default.

NOSUM:
Source V2 represents the output of your Arduino and is set to run at 1KHz at an amplitude of 12V.

5V, as you corrected already, and, though PWM will actually be 980Hz, 1KHz is a small step towards the 2.5KHz I'd like to use. (Once we're done here and I have something actually breadboarded, I'll bump to 2.5KHz and see if I can make soup with the resulting heat. Love me some Campbells(r).)

NOSUM:
Q4 is driven by potential divider R3 and R4 (you need these otherwise the base emitter junction of Q4 will clamp the O/P of your Arduino to 0.6V above ground).
Then Q4 in conjunction with pull up resistor R2 drives totem pole Q1 and Q2 which in turn drive the gate source junction of Q6 (Q6 is just the default part on the simulator I was to lazy to change it).

Ack! Lost me there. After discounting the (to me) unnecessary delay bits, I don't understand your comments about "clamping" the Arduino's output. The approach I've taken seems to be in very wide-spread use - though I'm not saying those are correct or the best way to do this. Every other approach I've seen to driving a small-signal BJT is to have a small (usually 1k) resistor between the Arduino and its base. Maybe your comments address the pull-up I have (now had) in there. Thank you for this; it appears that driven Arduino outputs do not require this - and may exhibit the problem you're outlining. It has been removed from all future iterations.

NOSUM:
If want to gate the circuit on and off instead, just remove C2 and connect it an appropriate O/P on your Arduino or use a switch connected to 12V.

Again, lost me a bit there. The assumption for this topic is that the "PWM" indicator in my schematics means an Arduino output pin (abstracted here, and in this case, pins 5 or 6) that is programmed to generate a PWM signal in the 980-2500Hz range at the Arduino's 5V, max 20mA.

From your earlier post:

NOSUM:
Further. To calculate the base current you need to determine the current drive into the FET gate which in my simulation was 300mA. Then simply divide that by the gain of your chosen part. Example 300mA / gain of 170 (for transistors I suggested) gives a base current 1.76mA, well within the capability of your Arduino

Thanks! Exactly what I was looking for. Unfortunately, I immediately ran into a "spec interpretation" problem. Maybe you can help with this: The 2N3904 shows that hFE depends on VCE (spec'd only at 1V) and varies depending on IC - which I'm assuming is the current draw through CE. If so, then I can expect the 2N3904 - at 1V and 100mA (hFE of 30) through CE - to require about 3.3mA. Is this correct? What I don't know is what happens if CE is actually the 11-15V this project will have here?

NOSUM:
Note; Simulation, schematic and chart generated on SIMETRIX.

I'll take a look at this some time soon. Thank you.

Cheers!
Dirk

Here's my latest take on this:

Description:

  • Power supply is now 10-22V. This reflects the power management that will be used.
  • PWM is available only after the 10-22V is available (the Arduino is powered by a DC-DC switching regulator which gets its power from the same 10-22V).
  • I've switched to using the BD140/BD139 transistors as they can carry up to 1.5A (plus I have a few on-hand). I've selected R3 and R4 so they carry a max of 1A at 22V.
  • With the BD140/139 pair, I've calculated (hopefully close to correctly) their base current requirements to be at least 33mA. This means that they cannot be reasonably driven directly from the Arduino, hence the inclusion of the 2N3904 to drive them.
  • The 1N4746A is there to ensure the IRF4905's gate never sees more than about 18V.
    Comments, suggestions, et al are very welcome.

Cheers!
Dirk

dephwyggl:
Comments, suggestions, et al are very welcome.

There's way too much power dissipation in that zener when running at 22V. The peak power is over 3 Watts, it will cook. Those little zeners are good for about 1W, but they run really hot at that. For reliable operation try to keep it down about half a watt.

You've basically got three choices.

  1. Use a big 5W zener and waste a bit of power there (it will still get HOT).

  2. Use a much larger driving resistance (currently 22 ohms) and get the worst case zener power down well under a watt. This will slow your edges down, but not enough to really cause a loss problem, given the relatively low switching frequency. Actually it might be a good thing as far as EMI/RFI is concerned.

  3. Rethink your powers supply arrangement.

I don't see why you want to persist with the Q2/Q3 arrangement that allows shoot-through. Sure you've got the resistors there to limit the shoot-through, but why not just use the class-B (common emitter push-pull) stage as previously suggested. Then you only need the one current limiting gate drive resistor.

If you really want to do it with discrete components and want it as simple as possible I would have suggested something like the following.

BTW. You can increase that 15 ohm resistor quite a bit at the relative low switching speeds you're using. You may need to go up to about 150 ohms if you want to keep zener power under control now that you want to run it at 22 volts.

In case anyone is wondering about the diode in the above circuit. It simply replaces the pnp (pull down transistor) in the class-B push-pull output stage (diode A-K replaces the pnp E-B junction). You can do this because no further current gain is required for the pull down, as first stage (lower npn) driver can already sink 400 to 500 mA without any problems.

Actually you save almost nothing in terms of cost or component count by using the diode instead of say a bc327 pnp, they're both worth just a few cents in quantity (diode is 2 cents cheaper). I only do it because I can, and the axial diode is just easier to wire up, especially in a prototype or breadboard.

One final comment. The BD139/140 in your most recent circuit are completely unnecessary. At under 500 mA peak current, and that only for a microsecond or two every millisecond, the 3 cent bc337/327 can do it ridiculously easily.

stuart0:
There's way too much power dissipation in that zener when running at 22V. The peak power is over 3 Watts, it will cook. Those little zeners are good for about 1W, but they run really hot at that. For reliable operation try to keep it down about half a watt.

Ouch. Two steps forward, one step back. :frowning: But, that's why we're here; extra eyes to spot silly missteps. :slight_smile:

I haven't finalized power management yet, but I'll certainly keep in mind that I'd like to see this part of the project without that zener (i.e. keep max voltage under 20). As mentioned, this is an automotive application and typical voltages will be more like 11-15 (most commonly around 14.5), but transients can occur and need to be managed.

stuart0:

  1. Use a big 5W zener and waste a bit of power there (it will still get HOT).

  2. Use a much larger driving resistance (currently 22 ohms) and get the worst case zener power down well under a watt. This will slow your edges down, but not enough to really cause a loss problem, given the relatively low switching frequency. Actually it might be a good thing as far as EMI/RFI is concerned.

  3. Rethink your powers supply arrangement.

  1. This doesn't strike me as a good solution.

  2. This is definitely worth considering. Some previous iterations used 2N3906/3904 pairs in the totem pole. These were set to drive the MOSFET at 100mA. Maybe more palatable for that poor, overworked zener. I'm starting to think that the trade-offs made to go to lower power BJTs may be worth it.

  3. Power management has not been finalized, but at the moment I'm anticipating using a bidirectional TVS rectifier to limit voltage, a cap to handle spikes, and a reversed p-channel IRF4905 to eliminate reverse polarity instances. (More on this in a separate topic once we're done here.)

stuart0:
Also regarding your previous circuit. While it's a big improvement on your earlier efforts (NOSUM has helped you a lot), I don't see why you want to persist with the Q2/Q3 arrangement that allows shoot-through. Sure you've got the resistors there to limit the shoot-through, but why not just use the class-B (common emitter push-pull) stage as previously suggested.

NOSUM certainly has helped. :slight_smile:

I'm all for simple, but I don't seem to be able to see how the basic requirement of the p-channel MOSFET being driven to OFF by default is accomplished (efficiently) except with a PNP on the "high" side of the totem pole. (Consider my latest circuit as though the Arduino doesn't exist, the MOSFET must be off, and minimal power is being consumed.) As far as I've been able to understand to this point, this totem pole arrangement is also rather more efficient than other discreet arrangements I've seen; the majority of power it consumes is during switching of the MOSFET (it consumes very little power during the MOSFET's actual on/off times). Yeah, there's some shoot-through, but I'm thinking this trade-off is worth it.

stuart0:
You can increase that 15 ohm resistor quite a bit at the relative low switching speeds you're using. You may need to go up to about 200 ohms if you want to keep zener power under control now that you want to run it at 22 volts.

We'll see about the 22V, but yeah, I'm starting to understand switching speeds a little better and driving the IRF4905 at more than 100mA may not be necessary.

stuart0:
The BD139/140 in your most recent circuit are completely unnecessary. At under 500 mA peak current, and that only for a microsecond or two every millisecond, the 3 cent bc337/327 can do it ridiculously easily.

I used these only because I have a few on-hand, and apparently I'm prone to way over-engineering everything. :stuck_out_tongue: I have lots of 2N3904/6s on-hand, too. I'll likely start with these and see where the MOSFET's temps get to. If too high, I also have some 2N5401s and 2N5551s (they could triple the drive current - again punishing the zener). I don't (yet) have any BC327s.

Thank you for all your comments, Stuart. Keep 'em coming; progress is occurring. :smiley:

Cheers!
Dirk

Further to this:

stuart0:
There's way too much power dissipation in that zener when running at 22V. The peak power is over 3 Watts, it will cook. Those little zeners are good for about 1W, but they run really hot at that. For reliable operation try to keep it down about half a watt.

Would inserting a, say, 1k resistor just before or just after the zener work? Or would that still allow too much voltage at the MOSFET's gate?

dephwyggl:
Further to this:

Would inserting a, say, 1k resistor just before or just after the zener work? Or would that still allow too much voltage at the MOSFET's gate?

Yes but you don't need to go that high, 150 ohms limits the power to about 0.5 Watts at the maximum 22 volt supply.

As mentioned, this is an automotive application and typical voltages will be more like 11-15 (most commonly around 14.5), but transients can occur and need to be managed.

Ok, this is quite a different thing to the "Power supply is now 10-22V" that you said before. That COMPLETELY changes my assessment which was done for steady 22V operation.

Do you really expect 22 volt transients in a 12V automotive system to persist for the many seconds that it would take to burn out that zener? It isn't going to happen. If the 22V max is truly just for transients then the rating of the Zener that you're using is perfectly fine.

dephwyggl:
I'm all for simple, but I don't seem to be able to see how the basic requirement of the p-channel MOSFET being driven to OFF by default is accomplished (efficiently) except with a PNP on the "high" side of the totem pole. (Consider my latest circuit as though the Arduino doesn't exist, the MOSFET must be off, and minimal power is being consumed.)

You don't seem to understand how a p-channel mosfet works. The truth is the precise opposite of what you've said above. Your most recent circuit turns the mosfet ON (see note*) when no input is connected.

Note*. Actually your circuit hardly works at all, with both Q2 and Q3 fighting each other, when the input is either low (as an output) or high impedance (as an input). That is as close as your circuit ever comes to turning on the mosfet however. You need to completely forget about that circuit.

THE P-CHANNEL MOSFET IS TURNED OFF WHEN THE GATE VOLTAGE IS HIGH (That is, when it's close to the source voltage, which is at the +ive supply voltage in this example).

The simple circuit that I posted (reply #32) however leaves the mosfet OFF when no input (or a high impedance) is supplied from the Arduino. So if you drive it with any pin that is not used by the bootloader then it will safely keep the mosfet off until your program chooses to initialize it as an output and start controlling it.

In my circuit:

  • High at the input gives mosfet on.
  • Low (or high impedance) at the input gives mosfet off.

Hi again.

I will try to deal with your comments / questions one at a time.

Keeping your FET turned off with nothing happening.

In order for this to happen, your Arduino must be in stasis (no output) and with its output low (ground).
In this condition Q4 is not conducting and R2 on the base of Q1 and Q2 keeps Q1 turned on providing a low impedance path to 12V for the gate of Q6 which keeps it turned off. If you really feel that you need extra security to keep your FET turned off you could place a large value resistor of 100K or so across the gate source connections.

It may be worth noting here that FET's are voltage driven devices unlike BJT's which are current driven.
Therefore when the gate does not have a varying voltage applied, it draws no current apart from the gate source leakage which will be in the low microamp region or less.

Power on settling time for you Arduino.

That is precisely what the delay circuit is for and will prevent the FET from being switched on until your Arduino has had time to boot and settle. If the delay as shown is to long then C2 can be reduced in value for a shorter period.

Transistors for the Totem pole.

I have had a quick look at the spec sheet for the 2n3904 /6 that you have been using. Their collector current capability is not up the task in hand and do not have enough gain. It is not mandatory that you use these devices. I have been using the BC327 / 337 combination for many years for this sort of thing and they work very well. You do not want devices with a lower current capability. I don't understand your reasoning there.

My comment about "The base emmiter junction of Q4 clamping the output of your Ardunio".

I shall attempt to explain:

The base emmiter junction of a BJT is analogous to a forward biased diode. It will turn on at approximately 0.6V (the precise voltage is dependent on many factors which I won't go into here). Before the conduction point is reached, the junction resistance is relatively high. When the b /e junction starts conducting, the dynamic impedance drops dramatically. This means that a further small increase in voltage will cause a much larger increase in current through the junction. The process is exponential.
Persisting with trying to increase the b / e voltage in this circumstance will inevitably lead to the destruction of the transistor.
So, the upshot of all this is that if just connect the O/P of your Arduino directly to the base of Q4 it will clamped to one diode drop (0.6V) above ground and draw lots of current which will do your Arduino no good at all.
Placing resistors R3 and R4 as shown in the schematic negates this scenario. Just using one resistor between the Arduino O/P and the base of Q4 is not good practice and is something that I never do.

As I said in an earlier post, when trying to switch FET's quickly, resistance is your enemy. Try to avoid using them in the gate drive circuit.

Hope you can get your head around that lot. If not then come back and I will try to illuminate.

NOSUM

Wow. I definitely have gotten myself into more hot water than I anticipated.

Stuart, NOSUM, thank you both; your time and efforts are very much appreciated.

It seems that I've been less than clear on some things, and also that I don't understand some basic electronics. So. Back to fundamentals.

This project's goal: It is my intent to be able to switch one or more PMOSFETs (which control various types of LEDs, halogens, incandescents) with an Arduino. The Arduino and the PMOSFETs derive power from the same source. The PMOSFETs must be OFF when power is applied. They must stay OFF when the Arduino has initialized. I'd like all this to occur as efficiently as possible (though a car's battery does have some reserve, I'm loathe to waste any of it).

My understanding of transistors: Both p-channel MOSFETs and PNP BJTs are ON when there is no current/voltage at their gate/base when in a circuit, and turn OFF when their gate/base is provided with (sufficient) current/voltage; n-channel MOSFETs and NPN BJTs behave exactly the opposite. (I understand the difference of using current vs voltage to "switch" them off/on.)

The above characteristics of p-channel/PNP transistors is why I (wanted to) use a PNP to turn the PMOSFET OFF by default. I was hoping that the inverted totem pole would get me a way to turn the PMOSFET ON by providing power simultaneously to ("turning on") a complimentary PNP/NPN pair - while staying aware that there's a brief moment during this process when the PNP and NPN are both ON at the same time.

I am also trying to take advantage of the fact that MOSFETs consume very little power at their gates when they are either ON or OFF; I'm trying to minimize power consumption by (reasonably) minimizing transition times.

Here is an abstracted schematic of how I thought this would work:

  • Ra/Rb/Sa stands for the Arduino

  • Sa stands for an Arduino's output pin
    Required behaviour:

  • When S1 is closed, Q4 must be OFF.

  • When S1 is closed and Sa is closed, Q4 should turn ON.
    Does this (in abstraction) work? What am I misunderstanding?

Cheers!
Dirk