Automatic power switching between two DC inputs - Page 1
Forum section: electronics / projects

author: cowana
author_rank: Frequent Contributor
timestamp: November 12, 2015, 12:09:47 pm
content: I'm developing a project that can be powered by two seperate inputs - either a 5V USB connector, or a nominal 12V DC jack. The project must be capable of being powered by either input - alternativly if both are present, it should draw power from the 12V DC jack. The current draw is around 1A max.I need a circuit that can switch between these, as well as offering reverse polarity protection for the DC jack. I had originally designed a circuit using the LTC4412 - however this is an expensive chip (this product may be made in some volume) - and it seems overkill for my application. I do not need to always switch to the highest voltage source - it is sufficient to just power from the DC jack if it is being fed with power.Attached are several ideas I have had - the pros and cons are listed below:Circuit 1 (Series diodes)ProsLow cost, low component countAutomatically switches to the highest voltage supplyConsSignificant voltage drop (~0.5v) on both railsHigh current diodes are quite large (eg SMA package)Circuit 2 (P channel FET switching of USB)ProsVoltage drop on USB is very smallSwitches when V_AUX > (V_USB - VT)ConsStill significant voltage drop on aux inputStill one large diodeCircuit 3 (P channel FET switching of both line)ProsVoltage drop on both lines is very smallAll components available in small SMD packagesConsUndetermined switch point. USB will switch off when V_AUX > (V_USB - VT_Q2), however AUX will switch on at a much lower voltage (VT_Q1)Leading to instability if V_AUX is around 5V?Need to be careful with FET V_GS max ratings (V_AUX could spike to 15v or so)Circuit 4 (using LTC4412 ideal diode OR setup)ProsRobust, solid designSwitches to highest input voltage with 20mV resolutionSimple circuit, minimum componentsConsCost! Very expensive chip, relying on one manufacturerOf these, circuit 1 can be discarded due to the voltage drop on the USB rail, and circuit 4 can be discarded due to the high cost (~5x the cost of the other solutions). A varient on circuit 3 feels like the best solution - but I'm not sure I'm quite there regarding at which exact point the switch over happens.My DC socket does have a 'mechanically inserted' contact I could use to trigger the switchover - but this solution does mean that power will be lost if an external source is plugged in but not powered, so I'd like to avoid that solution.Does anyone have any experiences with power switching circuitry like this? I'd appricate any thoughts, comments or links to similar circuits I could learn from. I'm aiming for a very simple, low cost, low component count solution, switching cleanly whenever the DC jack is being powered.

author: Fungus
author_rank: Super Contributor
timestamp: November 12, 2015, 12:17:57 pm
content: Take a look at the schematic for the Arduino.The Arduino does power switching and it's been tried/tested by millions of clueless newbies.

author: cowana
author_rank: Frequent Contributor
timestamp: November 12, 2015, 01:41:51 pm
content: The arduino uses a scheme which is roughly equivalent to my'Circuit 2'- although with a comparator to determine the exact switch point. In my circuit, the USB will start switching off as soon as the wall adapter crosses about 4.8v (so about 4.4v after the diode) - this means there will be a slight dip in the output voltage. However this shouldn't be a problem for me.The neatest solution for me would be finding a SOT23 buffer/comparator with two open drain outputs - one inverted and one non-inverted. However, after drawling several manufacturer's sites this doesn't seem to be a thing - buffers or comparators seem to either have differentialoropen drain outputs.

author: cowana
author_rank: Frequent Contributor
timestamp: November 12, 2015, 02:08:17 pm
content: A slightly refined circuit attached.Assuming logic level FETs, are used, they will start switching on with a Vgs of a few hundred millivolts.Operation:Just USB power:Floating 12V rail is pulled to GND by R2Q2 gate is therefore at GND - so switched on hard and Vout is poweredJust AUX power:12v rail is at 12vQ4 gate is at ~8v, so Q4 is switched onQ3 gate is at GND, so Q3 is switched on hard and Vout is poweredBoth VUSB and AUX powered:12V rail is at 12v (as Vaux supplied)Q2 gate is at 12v, so Q2 is switched offAs before, Q3 is on and power supplied to outputQ2's switch point (turning off the USB power) happens when V_AUX is around 4.8vQ3's switch point (turning on the AUX power) happens when V_AUX is around 4.5vEdit: the MOSFET I was looking at using (IRLML6401) has a V_GS max of ±8.0v - not enough for this scheme. Either I could use a different FET (although that would likely have a higher threshold voltage), or just use zeners to clamp the gate voltage. Trying to keep the component count low though!

author: 2bluesc
author_rank: Contributor
timestamp: December 16, 2015, 04:23:26 am
content: Quote from: cowana on November 12, 2015, 12:09:47 pmI'm trying to solve a very similar problem and the LTC4412 does exactly what I want, but the cost is a little extreme.I stumbled on this anEDN articlethat uses opamps in place of the LTC4412 in the same principal. I'm still only playing around with it in the simulator now, but it appears to work.Initial thoughts vs LTC4412:+ Cheaper (LM358s are almost free, but may be too slow?)+ More versatile- Slightly higher part count for resistors and what not, matters when I'm hand assemblyingSee attached image from the article.

author: ajb
author_rank: Super Contributor
timestamp: December 16, 2015, 04:59:25 am
content: Quote from: cowana on November 12, 2015, 01:41:51 pmWindow comparator like the TPS3700? Tie the INA+ and INB- together with a suitable divider to the barrel jack, OUTA to the USB PFET, OUTB to the barrel jack FET.