Electrical – How to get rid of voltage spikes in this supply voltage switcher circuit

analogpower electronicsprotection

In my mainboard there are two main supply.
One is 12V and other one is 5V.

5V is always ON but there is a risk of 12V crashing and disappearing. So, I want something like this, when presence of 12V main supply always has to be 12V but when it is gone main supply must be 5V which is always ON. The crudial thing here is main supply must never be below 4.8V.

I used to get this done by this simple structure:

schematic

simulate this circuit – Schematic created using CircuitLab

But my client does not want that. Diodes get hot and there is a certain voltage drop. So I thought of this soltion:

enter image description here

It is doing its job but it can not prevent this annoying spikes:
enter image description here

You see, when both rising and falling of 12V, it leads a spike and it causes to voltage drop below 5V. I want to understand why does it happen? And is there any circuit that can do the job with high efficiency?

Best Answer

Your output voltage is dipping because the power PFET is shorting the output node to the 12V supply that is at a lower voltage. Your threshold for turning on the PFET is much lower than 5V, effectively less than 1V.

I went ahead and remade your schematic in LTSpice:

Really, I'm just doing this to have pretty waveforms

The first question you should ask is "When does the NPN turn on?", which is practically immediately. There's a couple reasons for this:

  1. Your NPN, a 2N3055, is a big, power NPN (15 A!!). You need maybe 1-3mA at most to turn on the PFET with the R3-R4 resistor divider.
  2. Because Q1 is so large, it really doesn't take much to turn it on a little bit. LTSpice has that transistor turning on at about 0.27V, which is probably less than you assumed.
  3. I think you have your R1 and R2 values backwards. Even assuming a target VBE of 0.6V, your NPN would be on when the 12V rail was at 0.73V. The other way around, and it turns on at 3.43V or so (but probably lower).

Taking those things into account, we can see the voltages of the 12V rail (red), the NPN VBE (green), and the MOSFET gate voltage (blue). We can see the MOSFET turns on almost instantly.

enter image description here

For more fun, here's a look at the DC sweep of V2 (the 12V supply) when V1 (the 5V supply) is held at 5.0V:

enter image description here

The current through D1 and M1 spikes to 27A, but really that's just what the diode model is limiting it to - the diode would probably blow up if the 12V supply was really an ideal source. The diode is only rated for about 1A.

I'll admit, I'm not very fond of this topology, and I would probably look for a power management IC, or maybe some "ideal" diode ICs to handle the switching in a controlled manner. A comparator would be another solution. Keeping the 5V rail from back-feeding the 12V rail will be a bit tricky.

To tweak this topology, swap the 2N3055 for a 2N3904. Adjust the R1/R2 ratio to turn on Q1 when the 12V rail is above 5V. I'm pretty sure you don't need R4. The problem you will run into is that the behavior will be fairly sensitive to device variation (bad for products).