Power Switching Circuit - Page 1
Forum section: electronics / beginners

author: unknowndomain
author_rank: Regular Contributor
timestamp: March 07, 2014, 10:38:11 pm
content: I am working on a project where I want, like the Arduino to be able to switch between two different power supplies, one will be a 9V wall wart, and the other a 9V battery. I would prefer to be able to do this without using a mechanical switch.I looked into it and most of the stuff I find is about battery charging which I don't need. I found somewhere that you might need a Power MOSFET but I don't really understand the theory of operation.Any hints would be appreciated!

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 07, 2014, 11:06:27 pm
content: Get two power fets rated for 20-50% higher than the current you need and appropriate voltage. Try and get one with a logic level gate. Otherwise you may need another transistor to drive it.Connect the source of one to your first power source, and the source of the other fet to your other power source. Connect the drains together, with a fairly large capacitor. Connect the gates (through another transistor if necessary) to your Arduino. Turn one off, then turn the other on <1ms later.

author: Rerouter
author_rank: Super Contributor
timestamp: March 07, 2014, 11:08:24 pm
content: Do you want to switch to the plugpack as soon as its connected, or in software choose between the 2?if the first then you can look into a power OR'ing controller (a little IC that is made for this purpose)if the second, using an analog switch with a logic level input, there are plenty out there with normally open and normally closed positions, though an optoisolated one / pair may be more practical as not many analog switches like there inputs higher than there supply voltage,

author: unknowndomain
author_rank: Regular Contributor
timestamp: March 08, 2014, 09:57:56 pm
content: @rerouter I want it to switch automatically between the two with preference to the plugpack.@phaedrusWould theST STP36NF06Lbe suitable?What rating of capacitor would you have, and what do you mean through another transistor?Finally, I've drawn a circuit below does this look right?

author: ecat
author_rank: Frequent Contributor
timestamp: March 08, 2014, 10:17:05 pm
content: Many power sockets have a inbuilt switch arrangement which is open when a power plug is plugged in and closed when the power plug is removed, hence the socket has three terminals.If you are happy to have the battery disconnect whenever the power plug is inserted, arrange the battery supply to feed through this switch and Bob's your uncle.A more complex solution is only necessary if you need the battery to take over when the power pack is off but the plug is still inserted. In this case a single FET is needed ? (I suck at electronics)

author: unknowndomain
author_rank: Regular Contributor
timestamp: March 08, 2014, 10:19:22 pm
content: @ecat you are right, but its on the outter, which means I would have to have centre negative, which isn't standard. I'd prefer to do something electronic.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 09, 2014, 03:55:11 am
content: Quote from: unknowndomain on March 08, 2014, 09:57:56 pmNot quite. I'll draw it for you.

author: unknowndomain
author_rank: Regular Contributor
timestamp: March 09, 2014, 04:27:41 am
content: Quote from: Phaedrus on March 09, 2014, 03:55:11 amThat would be nice, thanks!

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 09, 2014, 04:49:36 am
content: This is assuming your MOSFETs have logic-level gates. If they don't you'll need another pair of NPN or PNP transistors to drive the gates fully.Maybe 16V or 25V 2200uF for the cap. The cap will give you a bit of "hold-up time" to stop you from losing power during the switch-over. As long as you switch in less than 1ms and it's less than, I'd say 25mA.

author: electronics man
author_rank: Frequent Contributor
timestamp: March 09, 2014, 12:44:30 pm
content: why dont you just use a relay with a mosfet to drive it.

author: unknowndomain
author_rank: Regular Contributor
timestamp: March 09, 2014, 03:11:29 pm
content: @phaedrus I don't understand the drawing entirely... what is are the two IO things on the right hand side?

author: madires
author_rank: Super Contributor
timestamp: March 09, 2014, 03:44:56 pm
content: If you don't mind a small voltage drop you could try the solution with two diodes, or-ing the power inputs.

author: Phaedrus
author_rank: Frequent Contributor
timestamp: March 09, 2014, 04:35:21 pm
content: Those would be IO (input/output) pins on your Arduino or other MCU, which you would program so that the one controlling the Vbatt mosfet is high when you want to run on battery; then when you want to switch to the adapter you pull the Vbatt mosfet low, turning it off, and within about 1ms drive the Vcc mosfet high, allowing power from your adapter to power your chip.Diodes would be simpler, but the 0.6V drop is inefficient. Relays are also a viable solution, but in this circuit would work similarly to mosfets, so it's kind of moot.I'm getting the impression that you don't know much about electronics.

author: lapm
author_rank: Frequent Contributor
timestamp: March 09, 2014, 04:46:22 pm
content: Personally i would got with two schotky diode solution and not worry about witch one is used. Unless there is some special circumstance we need to know about.