Continue to Site

STM32 Driving a relay Schematic Review

newbie_hs

Full Member level 3
Full Member level 3
Joined
Mar 4, 2023
Messages
169
Helped
1
Reputation
2
Reaction score
2
Trophy points
18
Activity points
1,343
I am using this relay in my circuit. I am using SPDT 1C.The important specifications are below.

1743603234850.png


My design calculations are given below.

1743603292642.png


Rb = (Vin-Vbe)/15 = 287 Ohm.I have couple of questions .

1)May I know the coil current obtained is the maximum value or typical value?
2)The pickup voltage 7.8V is the minimum value required for the relay to get activated.Please correct me if I am wrong
3)May I know if coil current less than 150mA,will the relay get activated.Is this the minimum current.

Below is my Lt spice circuit and simulation results.

1743603416733.png


1743603465116.png


May I know this circuit is fine or not.
The simulation files are attached along with this.
 

Attachments

  • Relay_Sim.zip
    8.1 KB · Views: 26
Solution
My design calculations are given below.

1743603292642.png


Rb = (Vin-Vbe)/15 = 287 Ohm.I have couple of questions .

1)May I know the coil current obtained is the maximum value or typical value?
2)The pickup voltage 7.8V is the minimum value required for the relay to get activated.Please correct me if I am wrong
3)May I know if coil current less than 150mA,will the relay get activated .Is this the minimum current.
1. TYPICAL: Coil = 800 +/- 10% so the current tolerance is 10% typical added to your supply tolerance.

2. NO: It may pickup earlier than the Vmax= 7.8V . This is guaranteed in which case your transistor has more than 10x the current gain and not...
1)May I know the coil current obtained is the maximum value or typical value?
The given informations are quite clear in this. It says:
Ohm´s resistance "+/- 1%"

2)The pickup voltage 7.8V is the minimum value required for the relay to get activated.Please correct me if I am wrong
Yes. That´s what "pick up" means.

3)May I know if coil current less than 150mA,will the relay get activated.Is this the minimum current.
According Ohm´s law .. if you reduce the coil voltage down to the "max. pick up voltage"-> the current will be reduced, too.
The copper windings of the coil are fixed, they won´t change ... with applied coil voltage.

May I know this circuit is fine or not.
"Fine" means what?
If you focus on the BJT and it´s drive currents ...--> Yes, it is fine.

If you focus on the timing of the coil current .. --> No, it ignores that the relay coils consists of a rather huge series inductance. Also the 1ms of rise and fall times of a microcontroller port are far from realistic. (And will make a huge difference in coil voltage spike)

If you focus on the "worst case" value of the circuit, to find out if the circuit is designed correctly .. --> No. Due to the missing inductance, you don´t see the huge voltage spike when the BJT (and relay) switches OFF. You need a so called free wheeling diode across the relay coil.
Additionally you calculated with an "ideal" microcontroller output voltage. But microcontrolelrs are not ideal. When driving 15mA out of the port the voltage will be less than 5V. How much less depends on the microcontroller. Every microcontroller comes with a datasheet that usually shows you the port behaviour as numbers as well as charts.
Additionally you calculated the power supply of a microcontroller as ideal 5.000V. This is not the case. Supply voltage are not very accurate and additionally may drift with time, temperature, load current ...

One could go even deeper .. with drifting V_BE, resistor tolerances, temperature rise of the relay coil and it´s resulting resistance drift ...
It depends on what you focus on ...

Klaus
 
My design calculations are given below.

1743603292642.png


Rb = (Vin-Vbe)/15 = 287 Ohm.I have couple of questions .

1)May I know the coil current obtained is the maximum value or typical value?
2)The pickup voltage 7.8V is the minimum value required for the relay to get activated.Please correct me if I am wrong
3)May I know if coil current less than 150mA,will the relay get activated .Is this the minimum current.
1. TYPICAL: Coil = 800 +/- 10% so the current tolerance is 10% typical added to your supply tolerance.

2. NO: It may pickup earlier than the Vmax= 7.8V . This is guaranteed in which case your transistor has more than 10x the current gain and not Ic/Ib=10, so your base drive is overkill. Although the PN2222A has a maximum hFE of 300 @ 150mA 10V it has an hFE min = 50 @ Vce=1V Ic = 150 mA so you are guaranteed to switch the relay <= 7ms using a base current of 2% of Ic using the spec. guarantee of hFE min using >11V of the 12V applied and thus reducing the coil current <= 7.5% below typical and reducing base current from 15 mA to 2% min of 150 mA = 3mA. You could add margin and choose 3% to 5% of 150 mA for base current and still not affect reliability switching. Always consider your uC driver also has resistance Ro(max) = Vol (max)/Io, usually the same as |(Vdd-Voh(min))/Io| e.g. 22 to 66 Ohms.

3. NO: It is always typical with all nominal values 12V / 80 Ohms and depends on all tolerances of Vdd, 12V, Ro, Rb and Rcoil.
 
Last edited:
Solution
80 +/-10%

any questions?

You are overlooking many things in your question.

If your uC uses IO pins that are defined as inputs after reset, will that power up the transistor to activate the relay unintentionally? If so then you may want to prevent that such as using active low to control the relay switch.
1743650756298.png


Must you load use an isolated high-side relay switch if the supplies share a common ground? If not, then why not use a simple low side switch to your 100 ohm load @16V or use an active low input high side inverting common-base NPN to a PNP common -emitter switch?


1743650877718.png


SIM <= click the logic level "L" "H"
 
Last edited:


Write your reply...

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top