A priorized voltage source switch

This is a circuit that supplies a consumer from a voltage source and when that voltage source drops below a specified voltage than consumer will be supplied from a backup source.

Schematics of the priorized voltage source switch

Input voltages

  • Uprm: The primary voltage source
  • Vref: The reference voltage that the voltage of the primary voltage source is compared to
  • Ubck: The backup voltage that is to be used when the voltage of the primary voltage source dropped below the reference voltage
  • GND: The common ground all voltage sources share.

Output voltages

The consumer is connected to the output voltage Uout and Ground.

Description

The comparator compares the two input voltages Uprm and Vref. When Uprm is higher than Vref the comparator outputs Uprm, to the Gate of the N-MOSFET T1, which switches on and all current flows from Uprm to Uout.

As soon as the voltage outputted by Uprm drops at or below Vref T1 is switched off, blocking the current flow from Uprm. Instead the NPN transistor T2 is switching on and pumps current from Ubck to the consumer.

T2 works as a voltage regulator and so the voltage supplied to the consumer is stabilized, when Uprm is switched. This stabilzed voltage roughly equals Vref. It is slightly lower because of the Base-Emitter voltage of T2 and the voltage drop at the resistor R1.

The diodes ensure that no back flow occurs between the two voltage sources if their voltages differ from each other.
R2 is a pull up resistor for the comparator. It ensures that the comparator output is at the correct voltage level.

Dimensioning R1

R1 should equal the minimum inner resistance of the consumer to keep the stabilized voltage as near to the Vref as possible.
The inner resistance of the consumer can be calculated using the formula:

R1 = Uout / Iout

Where Uout is the voltage supplied to the consumer and Iout is the maximum current the consumer can draw at that voltage.

T2 base current in normal condition

In normal condition, where the voltage of Ubck is at or above Vref, T2 also draws some small base current from Vref when the primary source is switched off. The base current of T2 can be calculated with this formula:

Ibe = Iout / hFE

Ibe is the base current flowing through T2, Iout is the current flowing through the consumer and hFE is the amplification factor of the transistor. You should use a transistor with a high hFE as that reduces the current draw from Vref under normal conditions while Uprm is lower than Vref.

T2 base current in hazard condition

The hazard condition is when the primary source is switched off and the voltage of Ubck is below the hazard threshold voltage, which can be calculated like this:

Uhz = (Vref + Vbe)

Where Uhz is the hazard threshold voltage and Vbe is the Base-Emitter voltage of the transistor T2.

In this condition a high base current flows through T2 that possibly could destroy your transistor if no additional counter measures are in place.

To calculate the current flow through the base of T2 in the hazard condition at a certain Ubck voltage you can use the formula:

UR1max = (Vref – Vbe) / 2

UR1 = clamp(Uhz – Ubck, UR1max)

Ibe = UR1 / R1

The formula calculates the upper limits, so although it is not precise when the difference of Vref and Vbck is smaller thant the Base-Emitter voltage, you can use the result of the formula for dimensioning the transistor.

UR1 is the voltage drop on the resistor R1 at a given Ubck voltage, Ibe is the base current that flows through T2 at that voltage. Vbe is be Base-Emitter voltage of the transistor. The maximum value of UR1 is the value of UR1max. If the difference of Uhz and Ubck is bigger than UR1max, the voltage UR1 will equal to UR1max. Ibe is the Base-Emitter voltage of T2.

Avoiding the hazard condition

A way to avoid the hazard condition is by binding the Vref to Vbck. For example you could create Vref by using a voltage divider consisting of a Zener diode with a breakdown voltage equal to the required Vref voltage and a resistor that connects to Ubck:

Voltage divider for creating a stabilzed Vref using a Zener diode

The Zener diode limits Vref to its own Break-Down voltage while the resistor Rz limits the current flow through the Zener diode. Rz can be calculated like following:

Rz = (Ubck – Uz) / Iz

Uz is the Break-Down voltage of the Zener diode, Iz is the maximum allowed current through the Zener diode at Ubck. If Ubck is variable, calculate with the maximum allowed voltage.