Switched Dual Power Source - Page 1
Forum section: electronics / projects

author: MobileWill
author_rank: Regular Contributor
timestamp: October 09, 2016, 03:18:13 am
content: I came up with a design to try and switch between two power sources using 2 MOSFET's. One P-channel and one N-channel. I wanted to get some feedback if this will work in practice. This is the simple version. I will post up the 2nd version after I get this checked.Power source is either 5-20V VIN or 5V from USB connector. Using the P-Channel the VIN is on by default. If 5V is applied to the USB connector then that will switch on the N-channel which will turn off the P-channel.Will this work or am I totally missing something?

author: ebclr
author_rank: Super Contributor
timestamp: October 09, 2016, 03:56:24 am
content: This way will be easierhttp://www.linear.com/product/LTC4089-3

author: MobileWill
author_rank: Regular Contributor
timestamp: October 09, 2016, 04:15:53 am
content: Quote from: ebclr on October 09, 2016, 03:56:24 amNice IC but looks like it needs an inductor which I don't think I have the room for. But it might help to switch on 5v for Otg mode which is my other problem.Still want to see if my design would work.

author: Kalvin
author_rank: Super Contributor
timestamp: October 09, 2016, 11:43:43 am
content: If you look carefully at the Q2, its bodydiode will be conducting even if the mosfet itself is not conducting. The P-MOSFET Q2 will be conducting when you pull its gate to GND, so the circuit will not work as you have described.

author: Kalvin
author_rank: Super Contributor
timestamp: October 09, 2016, 12:20:55 pm
content: You could try something like shown below. You may want to tweak the resistor and zener values for your needs. The zeners are to protect the MOSFETs' gates from overvoltages.

author: MobileWill
author_rank: Regular Contributor
timestamp: October 09, 2016, 06:31:51 pm
content: Thanks! So if I understand correctly the 12V Zener would need to match the max voltage of the P-MOSFET? I need to support about 20V.Now I wanted to add OTG support but I couldn't figure out a way to get it to work. I found some PMIC's but they don't support HV and OTG. My original design was to use a 5.6V Zener in reverse bias to only switch in the 5V regulator when the voltage is high enough but I couldn't figure out how to get the reverse voltage to supply the USB for OTG power without triggering the P-MOSFET that turns off VIN. I may drop the OTG option but it would be a really good added feature. I would only want to trigger turning off the P-MOSFET when current flows one direction on the VUSB and not the other. I would need a 5.6V Zener than can handle 2.5W max or so just in case.That being said I think I found a solution while writing this up. If I use a OTG cable with power injector that would power everything without having to worry about 5V and reverse power, plus it would turn off VIN. All I need to do is pull up the ID pin and let the uC know when that is pulled down for OTG mode.Any thoughts before I try this?Edit:I think I could do OTG mode with 2 MOSFETS? When ID pin is low one turns on to allow reverse flow to VCC and the other to off to stop VIN from turning off. The only thing is, is switching in the 5V only when needed without too much heat. The other problem is space for all this. Hmm...

author: Kalvin
author_rank: Super Contributor
timestamp: October 10, 2016, 07:26:18 am
content: Quote from: MobileWill on October 09, 2016, 06:31:51 pmThe 12V zener is there to limit the maximum gate voltage difference between the gate and the source to 12V (see the P-MOSFET datasheet for the maximum gate to source voltage limit). The P-MOSFET will be fully conducting when the gate voltage is 12V less than the source voltage. Actually, you could replace the zener to be 5V1 zener if you will as the P-MOSFET should be totally conducting when the gate voltage is 5V below the source voltage (see the datasheet and the Vth parameter). You can use VIN in range 5V - 20V even if you use 5V1 zener.

author: ajb
author_rank: Super Contributor
timestamp: October 10, 2016, 06:03:18 pm
content: Unless you're planning to provide 20V on the USB port for OTG, why wouldn't an off-the-shelf USB port management IC work? You'd need some sort of converter (presumably switching) to provide the 5V OTG supply from your batteries or whatever anyway, so treat the 20V input as separate from the USB section.You might get better advice if you mention things like wanting OTG support up front, along with some idea of what sort of loads you need to supply. Information like that may have a big impact on what solutions are available to you.

author: MobileWill
author_rank: Regular Contributor
timestamp: October 12, 2016, 03:09:32 am
content: Quote from: ajb on October 10, 2016, 06:03:18 pmIts a bit more complicated since both the USB 5V and the 20V input can be connected at the same time. The OTG thing was something I decided on after, its more more a bonus if I can get it designed in. I am working with a very limited space and trying to avoid double sided components. Loads should be less than 100mA.I think using the USB power injector cable would be the easiest solution and least space but not the best from a user standpoint.

author: ajb
author_rank: Super Contributor
timestamp: October 12, 2016, 04:27:31 pm
content: Given that you only need 100mA, a simple pair of diodes could be a reasonable solution, especially since you're planning to burn up the better part of 2W in your 3v3 regulator. I hope you were planning on using the enhanced SO8 version of the AP2204 with a big copper area, since that's the only way you have any hope of keeping the regulator under Tjmax!

author: MobileWill
author_rank: Regular Contributor
timestamp: October 12, 2016, 05:34:02 pm
content: Quote from: ajb on October 12, 2016, 04:27:31 pmI was thinking maybe with a 5.2V zener I could switch in a 5V regulator but the zener would probably get too hot. Plus the room for it all.But the 20v input won't always be 20v it can be 5v and probably will be most of the time.Sent from my SAMSUNG-SM-N920A using Tapatalk

author: MobileWill
author_rank: Regular Contributor
timestamp: October 23, 2016, 12:12:43 am
content: I updated my schematic, how does it look? Ignore the 3.3v regulator as I am going to try and fit in a switched mode converter in there, hopefully. I think I am going to get this made and test it before I make it part of my design with the uC.

author: NiHaoMike
author_rank: Super Contributor
timestamp: October 23, 2016, 03:33:01 am
content: Why is is it preferable to use USB power if both USB and external power are available?Your design looks good but I suggest adding 10k resistors from base to emitter on the transistors to make the circuit less sensitive to leakage.

author: MobileWill
author_rank: Regular Contributor
timestamp: October 23, 2016, 03:45:18 am
content: Quote from: NiHaoMike on October 23, 2016, 03:33:01 amThere are cases when external power won't be available and only USB is. Like during programming.Wouldn't putting a resistor on base to emitter on Q1 cause higher voltage to the base? The base to emitter is only 6VWhen USB power is off is Q1 base floating right?

author: NiHaoMike
author_rank: Super Contributor
timestamp: October 23, 2016, 05:21:17 am
content: If you don't care which input powers the device as long as the device gets powered, you can simplify your circuit to two diodes.

author: MobileWill
author_rank: Regular Contributor
timestamp: October 23, 2016, 05:26:03 am
content: Quote from: NiHaoMike on October 23, 2016, 05:21:17 amHow does that work with two different voltages? I assume a diode on each input?Sent from my SAMSUNG-SM-N920A using Tapatalk