# Auto switch the power from 5V adapter to 9V battery when the adapter is failure.

#### Arjune

Joined Jan 6, 2018
141
Will this circuit switch to battery with a power failure. I plan to power my clock. Would D1 overload the base of Q1? The battery is 9v and the power supply is 5v.

The circuit should cut off the common cathode display with a power failure to conserve battery

#### AlbertHall

Joined Jun 4, 2014
11,382
It will switch the cathode supply correctly but Q1 and Q2 will do nothing.
The base of Q3 will be about 0.7V with power and 0V without. To switch on Q2 fully its base needs to be near the battery voltage and there's nowhere that can come from.

#### ScottWang

Joined Aug 23, 2012
7,046
1. How's the draw current of the Clock?
2. Are you sure that the Clock can be supply up to 9V?
3. The circuit used Schottky diode to reduce the voltage drop to 0.3~0.4V.
4. The Output current setup to around 50mA, R2 and R5 use 2K then the output current will be about 20mA.
5. Q1 used for cutoff the base current of Q2 when the city power is apply to the adapter and output 5V.
6. If you have try this circuit then you can adjust the R4 more higher to try does the Q1 could turn on to cut off the base of Q2, because it will draw the current from battery when Q2 doesn't turn on, so you can make R3 and R4 as higher as you can.

#### crutschow

Joined Mar 14, 2008
27,394
How much current does the clock require from the 5V and 9V supplies?

#### sghioto

Joined Dec 31, 2017
2,369
Here's a different version to eliminate any battery drain when the supply is active. C1 may or not be needed depending on the capacitance in the clock Vcc circuit.
SG

#### crutschow

Joined Mar 14, 2008
27,394
Will the Schottky diode drop of about 0.5V for the 5V supply be a problem for your circuit?

#### ScottWang

Joined Aug 23, 2012
7,046
Considering don't waste the current of battery for useless and make the circuit more easier, so if use the 5V reed relay then the circuit will be more simple.

#### BobaMosfet

Joined Jul 1, 2009
1,819
There's a much better way to do this. Use a 9V wallwart power-supply into a 5V regulator. Connect your 9V battery in parallel with power from the wallwart, using a 1N5818 diode to prevent mains from driving power backwards through the battery. The diode also acts as a slight voltage drop between the battery hot and the wallwart hot, so that as long as wallwart provides power, the battery cannot power the regulator. But if mains disconnects for any reasons, the battery will instantly supply power to the regulator.

#### ScottWang

Joined Aug 23, 2012
7,046

#### Arjune

Joined Jan 6, 2018
141
1. How's the draw current of the Clock?
2. Are you sure that the Clock can be supply up to 9V?
3. The circuit used Schottky diode to reduce the voltage drop to 0.3~0.4V.
4. The Output current setup to around 50mA, R2 and R5 use 2K then the output current will be about 20mA.
5. Q1 used for cutoff the base current of Q2 when the city power is apply to the adapter and output 5V.
6. If you have try this circuit then you can adjust the R4 more higher to try does the Q1 could turn on to cut off the base of Q2, because it will draw the current from battery when Q2 doesn't turn on, so you can make R3 and R4 as higher as you can.

View attachment 162510
I'm guessing the clock uses about a hundred milliamp although it has six 7 segment displays and I'm sure the clock can handle up to 10v safety since it uses CMOS ICs. It seems to be a phenomenon that the clock would use less than a hundred milliamp considering the use of the 6 displays for Hour, minutes, and seconds but anyway this would be irrelevant with the main power off and the clock pulse source uses about 20 milliamps with a transistor inverter and diode OR gate using about another 25 milliamps along with a couple of 7555 timers in monostable mode used for increased pulse width because there was some clocking problems. I'm guessing on battery the clock will use about 50 milliamps max. Sorry I don't have a completed schematic to post. I like your circuit but it's a little too complicated for me.

#### crutschow

Joined Mar 14, 2008
27,394
My preference of the circuits posted is the one in post #5 by sghioto.
It's relatively simple, requires no relays, and draws no significant current from the battery when the 5V is available.
Below is the LTspice simulation.

#### Arjune

Joined Jan 6, 2018
141
No.
Will the Schottky diode drop of about 0.5V for the 5V supply be a problem for your circuit?
I'm not sure what a Schottky diode does but I am sure the Clock will safely operate up to 10v. 4.5v might be too low.

#### Arjune

Joined Jan 6, 2018
141
If use 5V DPDT relay type then no needs the transistor.

View attachment 162580
I fear that switch over to battery reaction time would be too slow with a relay although I could probably put a 470 microfarad capacitor from the clock power to ground to cater for the switch over time. Thank you for your effort.

#### Arjune

Joined Jan 6, 2018
141
Will this circuit switch to battery with a power failure. I plan to power my clock. Would D1 overload the base of Q1? The battery is 9v and the power supply is 5v.

View attachment 162498

The circuit should cut off the common cathode display with a power failure to conserve battery
I attached another circuit which is much simpler for me.

#### ScottWang

Joined Aug 23, 2012
7,046
The circuit should be ok.
But when the current is exceed hundred mA, you should be considering the diode voltage drop maybe will exceed 0.7V then Vf=0.7V*6=4.2V, the Vout of battery will be less than 5V then you might just in series with 5 diodes, and if the current is exceed 200 mA then you can use 1N4001~4007 to replace 1N941, and the Q1 could use logical level N MOSFET to replace 2N3904, the N MOSFET can be choose the Vgs>15V, Ids>3A, Rds(on)<=20mΩ, the R1 is no needed and connects a 10K from Vg to Ground as Rgs, that is to avoid when the circuit lose the power from adapter and then the Vg will become a floating or unpredictable status.

#### crutschow

Joined Mar 14, 2008
27,394
Instead of using a 9V battery, why not use four AAA batteries or two 3V lithium cells (such as CR2032) to give you 6V.
That way you don't need so many diodes to drop the voltage for your diode isolation scheme.

Last edited:

#### MisterBill2

Joined Jan 23, 2018
8,990
Instead of using a 9V battery, why not use four AAA batteries or two 3V lithium cells (such as CR2032) to give you 6V.
That way you don't need so many diodes to drop the voltage for your diode isolation scheme.
I was just going to suggest that!! CrutsChow is brilliant indeed.
But now we still don't know if this is a CMOS clock that draws 5Ma or a much older TTL logic clock with 27 ICs that draws over 300 Ma. So how ling will the backup actually last??? Another option is to have a 10F supercapacitor supply the logic and supply the driver circuit with non-backed up power. But there might be an issue with feeding input signals to unpowered IC devices. So it may have a problem with that.

#### ArakelTheDragon

Joined Nov 18, 2016
1,353
I did not read all the posts, sorry is someone suggested this or if I am making a mistake, but I think "Q1" on the original circuit will not be switching. On a bipolar PNP transistor, the base needs to be more negative than the emitter with "0.6VDC". When your power supply is ON, the "Q3" transistor will conduct. But when its off, how do you expect any voltage on the "Q1" emitter? The upper "Q2" base current flows towards the "Q2" emitter.

#### Arjune

Joined Jan 6, 2018
141
I attached another circuit which is much simpler for me.

View attachment 162594
I used 4 diodes with 0.8v drop each and a 9v battery giving 8v. Adapter out was 6.6v and the clock power out was 5.7v. With a used alkaline battery at 8v the clock power out is 5v. Good, but the count was sporadic as I interrupted battery power by applying the adapter power of a prototype mod 60 counter as a test. I think I need a 5v regulator to regulate adapter power and battery. I think the 7805 regulator has low power loss at no load (5mA?)