Pages: [1]   Go Down
Author Topic: Power supply connector  (Read 824 times)
0 Members and 1 Guest are viewing this topic.
Sistema solare - Terra
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone!

I'm designing a schematic to supply power to another PCB. It uses a LM317 to reduce the voltage to a fixed value.
I would like to use a 9V battery as main source, but considering that the device will also be used in a car, I would like to include also a connector for external power.

The connector I'll use on the PCB is a standard 2.1mm coaxial connector like this one: http://www.adafruit.com/adablog/wp-content/uploads/2011/05/21mmdcjackbbfront_LRG.jpg

Instead of using a separate switch I would like to use the third pin of the socket to detect when the connector is plugged in and automatically use external power, disconnecting the battery.

My problem is that I have no idea on how to do this smiley-grin Any help?

Thank you!
Logged

Chrono251 - Stefano

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The simplest way is to forget the third pin thing, and just use 2 diodes.

Code:
9v +---->|----\
                ----------+
12v +---->|----/
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17292
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well the way those 3 pin power connectors usually work is that the center pin is always the unswitched voltage and the other two pins form a switched 'ground connector' which is normally closed when there is no plug inserted into the connector. So usually the battery's positive terminal is wired to the center pin output pin of the boards connector and the battery's negaitive is wired to the normall closed contact or the connector and the common switch connector pin is wired to your board's ground system. So when you plug in an external plug the battery 'loses it's path to your board's ground bus but the external DC source is connected via the connectors positive terminal and common ground pin.

This drawing may help, it's of the pins on a typical board mounted DC power connector. Pin 1 is wired to your battery's positive terminal and also to the boards DC power bus. Pin 2 is wired to your boards ground bus, and pin 3 is wired to the battery's negative terminal only.
http://media.digikey.com/pdf/Catalog%20Drawings/Connectors/PJ-009B%20SCHEM.jpg

That make sense?

Lefty
Logged

Sistema solare - Terra
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the replies!
It's actually very basic, I was thinking too complicated!! I should have applied the KISS principle right away... smiley-grin

So basically, if I want to use the connector's pin to switch I would have to do something like the schematic attached, right?
I actually like the 2 diodes solution: there is no power interruption while the connector is being plugged in.


* pwr-connector.JPG (12.28 KB, 531x274 - viewed 23 times.)
Logged

Chrono251 - Stefano

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17292
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So basically, if I want to use the connector's pin to switch I would have to do something like the schematic attached, right?

Yes, that is basically right but the 'switchable' ground contact is not drawn quite as clearly as the linked drawing I showed. In this case there is no advantage of having that diode wired in series with the battery, as with the battery's negative terminal 'floating' when the external power is pulled in, there is no way for current to flow into or out of the battery, and the diode just causes permanent .6 vdc voltage drop when the battery is switch into service.

Lefty
Logged

Sistema solare - Terra
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah I used Paint and I should have drawn it better. smiley-grin

The reason why I placed it there is to avoid touching the battery connector with the battery held in the wrong way. I think I will move the diode to another place as actually it is more plausible to plug the external power with a wallwart and the connector in center-negative configuration. Is it ok to use a 1N5822 schottky barrier diode for this (Vf is around 0.5V)?

Before the LM317 I placed a 10uF capacitor for smoothing out voltage fluctuations: is this good also for "debouncing" the switch between the two power sources?

Is there a way to make sure that power is drawn from the battery until the external connector is properly plugged in? There is a small range while plugging in external power where the PCB is not powered at all.

Thanks again!
Logged

Chrono251 - Stefano

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a way to make sure that power is drawn from the battery until the external connector is properly plugged in? There is a small range while plugging in external power where the PCB is not powered at all.

Yes, don't use the switch but use the diodes instead.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Sistema solare - Terra
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a way to make sure that power is drawn from the battery until the external connector is properly plugged in? There is a small range while plugging in external power where the PCB is not powered at all.

Yes, don't use the switch but use the diodes instead.
Allright, I'll do it this way.
Thanks for your help!
Logged

Chrono251 - Stefano

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Agreed with the diode solution as the better option, but to answer the question for posterity... yes, that's what the capacitor is for.  As long as the time it takes the switched input to "break" the battery and "make" the power supply input is less than the time it takes to drain the cap below the minimum operating voltage of the circuit, you're good to go.
Logged

Pages: [1]   Go Up
Jump to: