# Power source from battery and PSU.

Status
Not open for further replies.

#### maniac84

##### Full Member level 6
Hi guys,
I'm just thinking. Is there anyway we can build a circuit that can support both 9V battery and a 9V PSU? I mean like, if the user got battery, he can use the 9V battery. And when the battery finish, he can plug in the 9V power supply unit. I'm thinking if we put 9V battery and the 9V PSU to on together, if the battery is a nonchargeable type, isn't it will explode? We have to separate it right?
I'm thinking of using a switch. When the user use battery, the switch will switch to battery and when the user use PSU, the switch will switch to PSU. But I think that will be very troublesome to a user. How do we design the circuit that can separate 9V battery and 9V PSU?

#### keith1200rs

##### Super Moderator
Staff member
The simplest way is to use two diodes - one in series with each power source. Ideally the power supply voltage would be higher than the battery voltage so when the power supply is plugged in the battery is not used.

An equally easy alternative is a DC power socket with built in switch. They are very common and switch over automatically when the plug is inserted.

Keith

#### maniac84

##### Full Member level 6
The simplest way is to use two diodes - one in series with each power source. Ideally the power supply voltage would be higher than the battery voltage so when the power supply is plugged in the battery is not used.

An equally easy alternative is a DC power socket with built in switch. They are very common and switch over automatically when the plug is inserted.

Keith

Is it something like below?

What diode part number do you recommend? How about 1N4001?
You mention that 'the power supply voltage would be higher than the battery voltage'. Does this mean I can power on my 9V PSU while the battery is on too?

Last edited:

#### keith1200rs

##### Super Moderator
Staff member
Yes, that is the circuit. It depends on whether your circuit can tolerate the voltage drop of the diodes. You need the power supply voltage to be higher than the battery voltage to stop the battery from draining when using the power supply. It depends on whether the circuit is tolerant of a wide range of voltage. It is quite common for 9V battery circuits to use 12V power supplies.

1N4001 would be fine although if you use a Schottky diode you will lose 0.3V rather than 0.7V.

The other alternative is one of these: https://uk.farnell.com/switchcraft/rapc722bk/connector-dc-power-socket-5a/dp/1617206 They have a physical switch built in. Most DC power adaptors have plug to mate with that type of socket.

Keith.

#### keith1200rs

##### Super Moderator
Staff member
It has a physical switch built in - hence the third terminal. You would wire it so when you push the connector in it disconnects the battery from your circuit.

Keith.

#### maniac84

##### Full Member level 6
It has a physical switch built in - hence the third terminal. You would wire it so when you push the connector in it disconnects the battery from your circuit.

Keith.

Do you have a schematic for this socket? Just wan to know how does it connect to battery.

#### keith1200rs

##### Super Moderator
Staff member
It is shown here https://www.lumberg.com/Produkte/PDFs/1613_05.pdf

On the lower left hand side their is an electrical drawing of the connector with the 3 pins, 1,2,3. When the plug is inserted, 2 and 3 are broken. 3 is therefore the connection to the circuit, 2 is the connection for the batteries and 1 is the other circuit/battery connection.

Keith.

maniac84

### maniac84

Points: 2

#### FoxyRick

This is the type of socket Keith means. Most power supplies have the centre contact positive (a few stupid ones are reversed, just to try to blow up people's kit). The outer contact is switched, as can be seen in the schematic. Pin A is the centre contact, B is the outer contact, and C is the switched pin in the socket.

With no plug inserted, pin C is connected to pin B. when a plug is inserted, pin C is disconnected and the outer contact goes to pin B.

So, if you connect the battery positive to A, and the negative to C, then without a plug, C->B and you have battery power. With a plug, the battery (C) is not connected and the plug supplies negative to B.

I've added a diode to protect from those stupid, reversed PSU's.

maniac84

### maniac84

Points: 2

#### maniac84

##### Full Member level 6
Thanks guys. Good idea!

Status
Not open for further replies.