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:
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:
It is doing its job but it can not prevent this annoying spikes:
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:
The first question you should ask is "When does the NPN turn on?", which is practically immediately. There's a couple reasons for this:
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.
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:
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).