Automotive Human switching and power management

Project:
To use an Arduino to control automotive lighting in as flexible a manner as possible. The initial implementation will be as a turn signal flasher replacement, and it will eventually be usable to manage headlights and other lighting fixtures in an automotive environment.

A previous topic dealt with using an Arduino to control p-channel power MOSFETs using PWM rates from 980 to 2500Hz.

This topic will deal with the human switching and power management bits.

Goals for this topic:

  • Human switch management (2 switches: 1 provides power; 1 goes to ground)

  • Power management (manage plus/minus 5-120V down to plus 10-18V at up to 20A)
    Tasks:

  • Mitigate voltage spikes

  • Manage (hopefully eliminate) voltage transients above 16V

  • Prevent reverse polarity

  • Disallow less than 10V

  • Switching logic to manage a +12V switch and a ground switch to enable power
    Proposed circuit:

02_pmtest_01.gif

Description:

  • Everything to the left of JP1 through JP6 is inaccessible; nothing can be changed here. (Nope; nothing. Don’t even think about it.)
  • C1 mitigates voltage spikes
  • TVS1 (3KP16CA) manages (redirects?) voltage transients above 16V
  • Q1 (IRF4905) prevents reverse polarity.
  • Note*: C1, TVS1 and Q1 will be repeated just to the right of JP1.
  • D3a (1N4740A) passes anything above 10V; turns Q2 off (allows Q4 to turn on)
  • S1 turns Q3 off (allows Q4 to turn on)
    Logic: We must have more than 10V and S1 must be closed for Q4 to turn on.
  • Ra and Sa1/Sa2 are place-holders for the Arduino’s power management, the Arduino, and the PMOSFETs it uses to manage Ra1/Ra2.
  • S2 is supposed to have the same effect (allow Q4 to turn on). See question below.
  • Ra1 and Ra2 represent the loads I’m trying to manage with this project. Current draw is going to be anywhere between 20 and 150 watts each.
    EDIT (2017-03-02) I was not clear on the logic required to turn power on using this circuit. Here is the logic table:
  10V   S1       S2       Q4
  ---   ------   ------   ---
  no    [i]any      any[/i]      OFF
  yes   open     open     OFF
  yes   open     closed   [b]ON[/b]
  yes   closed   open     [b]ON[/b]
  yes   closed   closed   [b]ON[/b]

Concerns/questions:

  • What needs to be done to have S2 behave the same way - have the same result - as S1? There is likely a very simple answer to this one, but I appear to have hit a brick wall. :confused:

  • Can the zener (D3a) be used the way I have it?

  • Q1 and Q4 are going to need to be able to manage up to 20A. At an RDS(on) of .02 Ohms, this means they’ll dissipate about 8 watts. This will require heat sinks. I have exactly zero experience with heat sinks; I have no idea how large these need to be. I do have some like this:
    02_MOSFET_heatsink.jpg
    Would these be sufficient? If not, descriptions and pics of something would be helpful.

  • Are D2 and D3b even needed?

  • I’m a little concerned about quiescent power consumption - the amount of power consumed when S1 and S2 are both open. This needs to be minimized as much as possible.

  • I’ve been reading up on TVS diodes. I still cannot figure out their practical applicability. For example, Littelfuse’s 3KP16CA’s specs are VR of 15, VBR of 16.7 to 18.5, and VC of 26. What is the max voltage I’ll see at Q1’s drain?
    To be done/added:

  • The Arduino needs to know the state of S2. I’ve been thinking an optocoupler as the primary interface, but there’s little point in pursuing this until I figure out how to get S2 to function.

  • It may be worthwhile to let the Arduino know the state of S1 also.

  • The wire runs from JP5/6 to Ra1/2 are highly variable and could be up to 3 metres. It has been suggested that I employ a snubber or a catch diode. I don’t (yet) know enough about either to determine if they can be added here. Note though that whatever is employed, it has to occur within this circuit. I.e. It has to occur before the longish wire runs and the (possibly inductive) loads.
    NB There was a tendency in my previous topic on PWM control of PMOSFETs for some to suggest the use of n-channel MOSFETs. While they wound up not being included there, I was hoping there might be opportunities to use them in this topic. If anyone has suggestions on how to incorporate them here (providing parts count is not higher than any p-channel solutions), I’m all ears.

Like in other topics, I’m very much looking forward to learning from the amazing crew here. :slight_smile:

Cheers!
Dirk

And, already I see a mistake: both Q2 and Q3 are backwards. :o

Q2 gate is floating when S1 is open.

A Zener is a terrible way to have a voltage threshold like that. It does not "conduct anything above 10V", it acts as a constant voltage load. You will need to apply 10V + enough gate voltage to turn the MOSFET on. Use a comparator and a voltage reference.

If the power and switch conditions are being ANDed, the FETs should be in series not parallel.

Just wire S2 in parallel in S1.

You can't connect diodes to a gate like that (D2, D3b), current has to flow both ways, into and out of the gate to switch it. Are you using diode-resistor logic without the resistor perhaps?

Protection for the gate is a zener between gate and source, 13V would be reasonable in an automotive environment (so long as there is a resistor somewhere to limit the zener current)

The TVS1 between gate and drain is going to simply blow the gate oxide on a transient. TVS between drain and source, or between gate and source is fine (although a zener does that fine).

MarkT: Protection for the gate is a zener between gate and source, 13V would be reasonable in an automotive environment (so long as there is a resistor somewhere to limit the zener current)

13V would suck, since alternators put out more than 14V when the engine is running.

Thank you for your comments, Jiggy-Ninja.

Jiggy-Ninja:
Q2 gate is floating when S1 is open.

Of course. Got it.

Jiggy-Ninja:
A Zener is a terrible way to have a voltage threshold like that. It does not “conduct anything above 10V”, it acts as a constant voltage load. You will need to apply 10V + enough gate voltage to turn the MOSFET on. Use a comparator and a voltage reference.

I am completely out of my depth on this one. The goal here is to ensure none of the PMOSFETs see less than 5V at their gates. I was thinking that a 10V zener would “break down” to allow 10V through to the gate of a PMOSFET - turning it off. I’ve searched and have not found a - to me - reasonable way to do this with a minimal parts/pin count. Could you suggest a circuit to accomplish this?

I’m starting to wonder if this under-voltage protection is in the wrong place; does it protect Q1 sufficiently where I’ve placed it? (And, note that there will be a second reverse-protection PMOSFET off of JP1 that will also be similarly affected.)

Jiggy-Ninja:
If the power and switch conditions are being ANDed, the FETs should be in series not parallel.

Q4 is ON by default; we want (to turn) it OFF when: S1 is open OR we have less than 10V.

Jiggy-Ninja:
Just wire S2 in parallel in S1.

S1 is OR’d with S2. Logic is: 10V AND [S1 OR S2]. Here is the complete logic table (I’ve added this to my original post as well):

 10V   S1       S2       Q4
  ---   ------   ------   ---
  no    [i]any      any[/i]      OFF
  yes   open     open     OFF
  yes   open     closed   [b]ON[/b]
  yes   closed   open     [b]ON[/b]
  yes   closed   closed   [b]ON[/b]

Mark, thank you for your comments. I don’t understand everything you’ve said, but for now:

MarkT:
You can’t connect diodes to a gate like that (D2, D3b), current has to flow both ways, into and out of the gate to switch it. Are you using diode-resistor logic without the resistor perhaps?

Um, D2 and D3a are attached to the drain of Q2 and Q3 (after orienting them correctly). I was trying to ensure current from one doesn’t “backflow”(?! I know; right?) into the other. This may well be another of those transistor (MOSFET?) quirks with which I’m not yet familiar… My intent here is to ensure that Q4 turns on when Q2 and Q3 are off. (Also, “diode-resistor logic”(?) would still work; the resistor is there (R2a and R3 in the schematic here) - though maybe they should occur after the drains of Q2/Q3? One of my questions was “Are D2 and D3b even needed?” I’m still not sure they are.

MarkT:
Protection for the gate is a zener between gate and source, 13V would be reasonable in an automotive environment (so long as there is a resistor somewhere to limit the zener current)

I think I understand some of that. My intention with the zener was to turn on Q3 whenever we have more than 10V. The simpler this is done, the better. I’ve removed all of the under-voltage stuff for the moment; see my question to Jiggy-Ninja above.

Of note: When someone says “so long as there is a resistor somewhere” to a noob like me, said noob’s brain explodes. :o Just sayin’.

MarkT:
The TVS1 between gate and drain is going to simply blow the gate oxide on a transient. TVS between drain and source, or between gate and source is fine (although a zener does that fine).

Uh oh. Too much info at once; my brain hurts. :confused: I’m trying to avoid diodes for reverse protection (too much voltage drop), though can go back to them if parts/pin count otherwise gets too high. I’ve moved TVS1 to go between gate and source, though I’m wondering if Q1 will then survive transients (as high as 120V) that could occur. I’ve been trying to figure out the differences between TVS and zener diodes; from what I’ve been able to digest so far, a zener would require a resistor in series with the entire circuit equivalent to the entire load of the circuit - a TVS doesn’t. Also, wouldn’t a zener here have to be pretty hefty to manage the anticipated max of 300 watts?

I’ve fixed (some of) and re-arranged the schematic slightly:

02_pmtest_02.gif

  • Fixed orientation of Q2 and Q3

  • Separated the feed into Q2 and Q3 (not necessary, but makes it easier to read)

  • Added a pull-down for Q2 (likely will need one for Q3 as well)

  • Replaced the zener with a placeholder

  • Moved TVS1 to go between Q1’s gate and source
    All, two things:

  • I’d be happy to start over completely on this one. There are three things that must occur: 1) nothing can be touched to the left of JP1 through JP6; 2) the logic table; and 3) power available where Q4’s drain currently is must be 10-18 volts at 20A.

  • At the moment, I’m most concerned about the over-voltage stuff. Specifically, with what I have there in C1/Q1/TVS1, what’s the max voltage I’ll be seeing at Q4? Depending on the answer, I’ll either have to start protecting a whole bunch of PMOSFET gates (7 of them at last count), or re-think/design the over-voltage stuff.
    Already learning lots (thank you, everyone), and looking forward to learning tons more. :smiley:

Cheers!
Dirk

Your battery is marked as 5 - 120v. Where can I buy one? Or what voltage do you really mean?

Allan

Hi,
Won’t Q1 conduct all the time through the internal drain-source diode?

Can you label the D G and S connections on each of your MOSFETs please.
02_pmtest_02.jpg
Thanks… Tom… :slight_smile:

hi, If Q2 and Q3 are not conducting, the gate of Q4 is floating. When Q2 or Q3 conduct they connect Q4 gate to Q4 source via 47K, so Q4 is switched OFF.

Tom... :)

TomGeorge:
Won’t Q1 conduct all the time through the internal drain-source diode?

It’s supposed to. It’s purpose is to protect against reverse polarity (happens seldom, but should be dealt with). As I said, I was originally using diodes for this, but the voltage drop across them is significantly higher than a reversed MOSFET.

TomGeorge:
Can you label the D G and S connections on each of your MOSFETs please.
Thanks… Tom… :slight_smile:

Won’t promise, but I’ll try to remember. :wink:

TomGeorge:
If Q2 and Q3 are not conducting, the gate of Q4 is floating.

Yep, thought that might be the case. I’ll add a pull-down for it.

TomGeorge:
When Q2 or Q3 conduct they connect Q4 gate to Q4 source via 47K, so Q4 is switched OFF.

Yep, that’s the idea. Q4 should conduct only when S1 is closed and we have more than 10V.

Cheers!
Dirk

allanhurst: Your battery is marked as 5 - 120v. Where can I buy one? Or what voltage do you really mean?

Good question, Allan. This project is going into an automotive environment. Typical voltage is 12 (car not running) and 14.5V (car running). Voltage drops to 5 can arise during cranking; voltage spikes of up to 120V (or even higher in extreme cases) have been seen. Reverse polarity can also occur. Sure, most of these extremes occur relatively seldom, but without taking them into account, anything attached to an automotive electrical system will have its, um, effectiveness curtailed at the first occurrence of any of them.

Cheers! Dirk

dephwyggl:

  • Q1 and Q4 are going to need to be able to manage up to 20A. At an RDS(on) of .02 Ohms, this means they’ll dissipate about 8 watts. This will require heat sinks. I have exactly zero experience with heat sinks; I have no idea how large these need to be. I do have some like this:
    02_MOSFET_heatsink.jpg
    Would these be sufficient? If not, descriptions and pics of something would be helpful.

Heatsinks always have a degrees-per-watt figure in their datasheet. Those little ones might be 40ºC/W which means they’ll heat up 320º above ambient temperature with an 8W input. It’s just a simple multiplication.

You should also look at the thermal resistance of the device itself. It will let you calculate how much hotter the actual silicon junction is than the outside case. The temperature limits of most devices are given for the junction, not the case.

Hi,
What is S2 connected too?
What is the purpose of Q3?
What turns Q3 ON and OFF?

If S2 is connected to the gate of Q3, you will short the battery.

A circuit update please, with resistor to stop Q4 from floating as pointed out in post #8.

Thanks… Tom… :slight_smile:

MorganS: Heatsinks always have a degrees-per-watt figure in their datasheet. Those little ones might be 40ºC/W which means they'll heat up 320º above ambient temperature with an 8W input. It's just a simple multiplication.

You should also look at the thermal resistance of the device itself. It will let you calculate how much hotter the actual silicon junction is than the outside case. The temperature limits of most devices are given for the junction, not the case.

Thank you, Morgan. I didn't get a data sheet with these, but I'm sure I can find some. I've done a little digging and have been perusing MOSFET specs for this info. You're quite right; should be simple. Just needed someone with more experience to point out the stuff that's important. :)

Cheers! Dirk

I am completely out of my depth on this one. The goal here is to ensure none of the PMOSFETs see less than 5V at their gates. I was thinking that a 10V zener would "break down" to allow 10V through to the gate of a PMOSFET - turning it off. I've searched and have not found a - to me - reasonable way to do this with a minimal parts/pin count. Could you suggest a circuit to accomplish this?

I said use a comparator. Zener breakdown doesn't work like that.

Uh oh. Too much info at once; my brain hurts. :confused: I'm trying to avoid diodes for reverse protection (too much voltage drop), though can go back to them if parts/pin count otherwise gets too high. I've moved TVS1 to go between gate and source, though I'm wondering if Q1 will then survive transients (as high as 120V) that could occur.

I'm not sure why Mark suggested that, because it looks wrong to me. The TVS should be the second thing the power touches after it comes onto the board.

I said it should be the second thing because the first thing it goes through should be a fuse. Right now you have no protection if something downstream shorts out, or if a persistent overvoltage over the TVSes breakdown level is applied. The TVS will burn open and then the rest of your circuit will be exposed to the overvolt.

When I worked at an automotive supplier, one of the many tests the electrical lab would perform is 28V power, which is supposed to represent an incorrectly wired jump start (so the parts get double voltage).

I've been trying to figure out the differences between TVS and zener diodes; from what I've been able to digest so far, a zener would require a resistor in series with the entire circuit equivalent to the entire load of the circuit - a TVS doesn't. Also, wouldn't a zener here have to be pretty hefty to manage the anticipated max of 300 watts?

There's actually no difference in how they work. Many TVS diodes are actually Zeners, they're just designed for a different use. The "Zener" classification only refers to a particular mode of operation (called Zener breakdown) that they are designed for. Regular diodes break very easily when their reverse breakdown voltage is exceeded, but Zener's can survive it.

Zener breakdown can be applied to a couple of different circumstances. One is to keep the terminal voltage stable even when the current varies. This is commonly used for voltage references or as a super-cheap low current inefficient power regulator. This is probably what you're mistakenly thinking of.

The other use is to protect against overvoltage. When a voltage exceeding breakdown is supplied, the Zener shunts current through it to clamp the voltage down to a reasonable level. Obviously it cannot do this continuously, or the diode will overheat. They are only meant to withstand brief surges. This is why diodes used for this purpose are called [u]transient voltage suppressors[/u].

TomGeorge:
What is S2 connected too?
What is the purpose of Q3?

  • S2 is connected to the vehicle’s ground. Nothing (yet) on my circuit’s side. (Hence my questions…)
  • Q3 was there to apply power to Q4’s gate when less than 10V is available via JP2. (I’ve replaced all the under-voltage stuff with a place-holder until I can figure out how to accomplish this.)

TomGeorge:
A circuit update please, with resistor to stop Q4 from floating as pointed out in post #8.

Here you go:

02_pmtest_03.gif

(I also added a fuse (thanks, Jiggy-Ninja for reminding me), place-holders and descriptions for what they’re for, and moved TVS1 back to before Q1. Mark? TVS1/2 are bi-directional; doesn’t that mitigate your concern about their position?)

At the moment, I’m still stuck on:

  • how to replicate S1’s functionality using S2; and
  • how to stop Q4 from conducting when there is less than 10V available via JP2
    Note that the logic table as noted previously must be followed (i.e. for Q4 to conduct, S1 OR S2 (or both) must be closed, AND there must be more than 10V available via JP2).

Cheers!
Dirk

Jiggy-Ninja: I said use a comparator. Zener breakdown doesn't work like that.

Um, I've been poking around but haven't yet been able to figure out a decent way to do that; "use a comparator" isn't enough info for a noob like myself. :confused:

Jiggy-Ninja: I'm not sure why Mark suggested that, because it looks wrong to me. The TVS should be the second thing the power touches after it comes onto the board.

See my previous post in response to Tom. I agree; I wasn't happy with Mark's placement of the TVS either (though I am no where near as sure as you as to why), and hopefully its bi-directional-ness mitigates his concerns?

Jiggy-Ninja: I said it should be the second thing because the first thing it goes through should be a fuse.

Added. See previous post. (The type of fuse will be a typical automotive blade type. Its value will vary depending on into which circuit it's inserted.)

Jiggy-Ninja: When I worked at an automotive supplier, one of the many tests the electrical lab would perform is 28V power, which is supposed to represent an incorrectly wired jump start (so the parts get double voltage).There's actually no difference in how they work. Many TVS diodes are actually Zeners, they're just designed for a different use. The "Zener" classification only refers to a particular mode of operation (called Zener breakdown) that they are designed for. Regular diodes break very easily when their reverse breakdown voltage is exceeded, but Zener's can survive it.

Thank you for this and your further clarifications. I'm working on digesting it all. ???

Cheers! Dirk

I'm not going to criticise your circuit in detail- others have made various comments.

Most automotive loads are on/off and are traditionally controlled directly via switches or relays.

Some vehicles have CANbus to acheive what you'd like - for which the manufacturers have solutions.

Why re-invent the wheel?

Allan

Hi, S2 [u]FUNCTION[/u] is ORed with S1 [u]FUNCTION[/u] .

R2a may need to be much lower in value to turn Q4 ON. Say 470R. R4 make it 10K. Place a 0.1uF in parallel with C1.

Use S2 through an Opto Coupler to bias Q4 ON. In fact would it be easier and lower component count to get S1 through another Opto to bias Q4 ON as well?

Tom... :)

allanhurst: I'm not going to criticise your circuit in detail- others have made various comments.

The more, the merrier. :) I would love to have more of your input, Allan.

allanhurst: Most automotive loads are on/off and are traditionally controlled directly via switches or relays.

Yep. I'm using what my car has available (everything to the left of JP#).

allanhurst: Some vehicles have CANbus to acheive what you'd like - for which the manufacturers have solutions.

Yep, some cars do have CANbus. I'm making this project purposefully generic enough to be able to be used in cars which don't have CANbus - at least for the functions at which this project is aimed.

allanhurst: Why re-invent the wheel?

4 reasons:

  • because I can
  • because I'm having a blast learning from y'all :D
  • because I haven't been able to find anything that addresses all my goals for this project
  • because I can (Maybe reason 2 most of all.)

Cheers! Dirk