Arduino Forum

Using Arduino => General Electronics => Topic started by: jasonandkids on Mar 03, 2014, 02:58 pm

Title: Battery and wall wart connection
Post by: jasonandkids on Mar 03, 2014, 02:58 pm
Hello,
Is it possible to connect both positives from a battery and wall wart, then connect both negatives to a nc/no switch? 
I am trying to power my project with either battery or a wall wart.
Thank you,
Jason
Title: Re: Battery and wall wart connection
Post by: CrossRoads on Mar 03, 2014, 03:01 pm
Connect the Gnds together and to the Arduino.
Connect one positive each to NC and NO, and the Common to the Arduino.
Title: Re: Battery and wall wart connection
Post by: Chagrin on Mar 03, 2014, 07:19 pm
See also http://www.ti.com.cn/cn/lit/ds/symlink/lm1117-n.pdf figure 37 for ideas.
Title: Re: Battery and wall wart connection
Post by: jasonandkids on Mar 04, 2014, 12:58 pm

See also http://www.ti.com.cn/cn/lit/ds/symlink/lm1117-n.pdf figure 37 for ideas.


I am new to electronics, and am confused by your post.  How would any of those devices help me?  Do I need to have another device for my project, or will my NO/NC switch work by itself?
Thanks
Title: Re: Battery and wall wart connection
Post by: Chagrin on Mar 04, 2014, 04:45 pm
Your switch will work by itself. The advantage of the type of circuit I linked above is that it will automatically fail over between the wall power and battery when either is removed -- no switching required.
Title: Re: Battery and wall wart connection
Post by: jasonandkids on Mar 24, 2014, 01:31 pm
What would the best way to automatically switch between battery and wall wart?  Could I use a PNP?
I would like the battery to be used if the wall wart is not plugged in.
Thanks,
Jason
Title: Re: Battery and wall wart connection
Post by: mirith on Mar 24, 2014, 01:51 pm

See also http://www.ti.com.cn/cn/lit/ds/symlink/lm1117-n.pdf figure 37 for ideas.

I'd possibly look at figure 37 as suggested before?
Title: Re: Battery and wall wart connection
Post by: jasonandkids on Mar 24, 2014, 04:56 pm
I am a little confused by figure 37.  I am new to electronics, and do not understand the schematic.  Do you know of another site that might explain it further?

Is it not possible to use a PNP (or something similar)?  If I connected the wall supply to the base of the PNP and connect the battery to the Collector, wouldn't that switch off the battery supply, whenever the wall supply is added?   Attached is a crude drawing of what I was referring to.

Thank you,
Jason


Title: Re: Battery and wall wart connection
Post by: mirith on Mar 24, 2014, 05:27 pm
Your described circuit probably won't work, but you could probably do something with a relay.  Basically when plugged into the wall, you'd need to disconnect the battery and connect the supply.
Title: Re: Battery and wall wart connection
Post by: jasonandkids on Mar 24, 2014, 06:53 pm
What about it wouldn't work?
Should I be looking at the LM117?
What if I added 2 diodes like attached?
Thanks,
Jason
Title: Re: Battery and wall wart connection
Post by: mirith on Mar 24, 2014, 08:12 pm
Actually, that might work.  I didn't have time to think closer about your original circuit, but this later one makes a lot more sense with the diodes.  I would just make sure to use low voltage drop diodes, and make sure both will supply enough voltage to drive your regulator after you drop the voltage cross the diode (and the transistor, but that should be less significant).  Don't forget the resistor to the base of the transistor, or you'll release the magic smoke.