Go Down

Topic: Power supply connector (Read 984 times) previous topic - next topic

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 :D Any help?

Thank you!
Chrono251 - Stefano

majenko

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

Code: [Select]

9v +---->|----\
                ----------+
12v +---->|----/

retrolefty

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

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

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.
Chrono251 - Stefano

retrolefty

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

Yeah I used Paint and I should have drawn it better. :D

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!
Chrono251 - Stefano

majenko


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.



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!
Chrono251 - Stefano

SirNickity

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.

Go Up