# Controlling 12v circuit with 5v control with high side switch

#### Devin Dandurand

Joined Oct 13, 2017
12
I have a project that requires me to switch a 12v circuit with 5v control. Wondering if anyone could show me a schmatic and possibly how it explain works. And if it is possible. Ultimately i would like to control a 12v relay with a 5v signal on the high side with out additional 5v relays.

Devin

#### Devin Dandurand

Joined Oct 13, 2017
12
Thank you. Are we creating a voltage divider on the pnp base?

#### AlbertHall

Joined Jun 4, 2014
10,412
Yes, although the circuit would probably work well without the top resistor driving a relay. The emitter-base resistor on the top transistor is there to make sure the transistor can turn fully off. Even when off there will be some leakage current through the NPN transistor. The emitter-base resistor allows this current to flow, but not produce enough voltage to turn in the PNP transistor.

#### Devin Dandurand

Joined Oct 13, 2017
12
Any idea how i would calculate the values of the resistors needed? Sorry ive been tring to wrap my head around this for a few days

#### AlbertHall

Joined Jun 4, 2014
10,412
How much current does your relay coil need (or what resistance is the coil)?

#### Devin Dandurand

Joined Oct 13, 2017
12
I will have to get that information. This is a long distance project. And haven't had the relays in hand and it seems to be a not commonly used relay due to lack of a data sheet. I will get that information. Thank you again for all your help.

I am unable to switch the low side due to the relays always being connected to ground and being this is to retrofit an existing product. Bad part is i have to redisign the entire board. Lol

Last edited by a moderator:

#### AnalogKid

Joined Aug 1, 2013
8,608
Thank you. Are we creating a voltage divider on the pnp base?
Sort of. It is a voltage divider, but the intent is something else. The series resistor from the base to the input limits the base current to a value that is safe for both the transistor and the uC output. The resistor go GND is needed only if the uC output can not go low enough to guarantee that the transistor turns off. For a normal uC output pin like a PIC or Arduino, it is not needed. Typical values would be 1-10 K for the series resistor and 10-100 K for the shunt.

ak

#### Devin Dandurand

Joined Oct 13, 2017
12
Coil resistance is 80 ohms i found a data sheet

#### AlbertHall

Joined Jun 4, 2014
10,412
This should do the job. Note the diode is important to protect the PNP transistor.

#### Devin Dandurand

Joined Oct 13, 2017
12
You are the man. Albert thank you very much.

How did you determine correct resistor values?

Last edited by a moderator:

#### AlbertHall

Joined Jun 4, 2014
10,412
The relay needs 150mA, so to be sure the PNP fully saturates it needs a base current of 15mA. There will be about 11V across R3 and it needs to pass more than 15mA (733Ω - next lower standard value 680Ω). The NPN collector current is therefore 15mA and will need 1.5mA base current. There will be about 4.3V across R1 (2866Ω - next lower standard value 2.7k.
My general rule is to make the base-emitter resistor equal to the base drive resistor which gives the values of the other two resistors.

#### Devin Dandurand

Joined Oct 13, 2017
12
Thank you ive learned much from you.

#### philba

Joined Aug 17, 2017
960
out of curiosity, why the desire for a high side switch? Using a low side switch, it can be done with a lot fewer parts. (1 NPN or N-MOSFET, 2 resistors and a diode)