# Relay SFK-112DM + BJT STS9014 + Arduino

 Updated: 15-04-2020 Category: Arduino Projects
As it is known, the microcontroller for obvious reasons can control the electromagnetic relay only through a special driver and most often this driver is the simplest transistor switch. In this article I will calculate the transistor switch for the relay SFK-112DM (12V/20A250V). For the correct choice of the transistor, it is desirable to consider the so-called strength factor equal to 1.5 (Ic = 75mA*1.5 = 113mA) and for such a load current is quite suitable transistor STS9014 with a maximum collector current of 150mA which I have here are in stock.

► 1. The load of the transistor is a relay (SFK-112DM) with a coil resistance of 160 ohms (Rc). Calculate the collector current of the transistor (Ic):

Ic = Vcc/Rc = 12/160 = 0.075A = 75mA (Vce(sat) => 0)

► 2. The DC current gain (β) of the transistor (STS9014) is 100...1000, so I take the minimum value β = 100 and calculate the base current (Ib):

Ib = S*(Ic/β) = 4*(0.075/100) = 0.003A = 3mA (S = 4)

► 3. Calculating base resistor value (Rb):

Ib = Vr/Rb => Rb = Vr/Ib = (Vin-Vbe)/Ib = (5-0.7)/0.003 = 1433Ω = 1.4kΩ

The saturation coefficient of the transistor (S) for such transistor switches is recommended to be taken within 3...5, therefore, in step 2 of my calculation I took S = 4. This ensures a sufficient level of saturation of the transistor to bring one to the open state.

 // Relay testing (blink)  int relayPin = 4;  // Pin D4void setup () {  pinMode (relayPin, OUTPUT);}void loop () {  digitalWrite (relayPin, HIGH);  delay (1000);  digitalWrite (relayPin, LOW);  delay (1000);}  // Arduino IDE 1.8.4 To test this relay module, I used a standard sketch for blinking LED through the 13th pin with a time delay of 1 second, after changing the variable name for this pin and the number of this pin. Everything is very simple here and it does not need a special detailed explanation.

For visual control of the current state of the relay module (ON/OFF), I soldered parallel to the relay coil (12V) a LED with a resistor of 1 kilohm and this is not shown on the diagram (left).