# Current through relay

I want to control AC power switch 230vAC, I used this relay type Relay OJE series SPST. According to the datasheet, it can drive V=5v and the resistance through the coil is 125 ohm I calculated to get the current through the coil by applying ohm's law and I have I= 0.04A. However, I have this diagram below: so from MCU the voltage is 3.3V and in series with 1k2 to get an Ib= 3.3-0.7/1k2 = 0.00216A.

My question is how do I know this current can switch the relay? does that mean Ib is flowing to the relay current coil? or in other words, Is this relay type suitable?

• It will work perfectly if the transistor beta is 》 Ic/Ib = 0.04/0.002 = 20. BTW "the relay coil is driven by 5 V"... not "it can drive 5 V". It can drive much higher voltage. Commented Nov 22, 2019 at 19:17

However, I have this diagram below: so from MCU the voltage is 3.3V and in series with 1k2 to get an Ib= 3.3-0.7/1k2 = 0.00216A. ... how do I know this current can switch the relay?

This depends on the BJT you choose.

To get 40 mA collector current with 2 mA base current you need a $$\\beta\$$ value of at least 20. This should be pretty easy to find.

But, in this circuit you generally want to operate your BJT well saturated, say with a saturated $$\I_c/I_b\$$ ratio of 10 or so. So you might rather reduce your base resistor value to get in the neighborhood of 4 mA into the base.

does that mean Ib is flowing to the relay current coil? or in other words, Is this relay type suitable?

No, the whole point of the BJT (as used here) is that it provides current gain between the base and the collector. The ratio $$\I_c/I_b\$$ in the linear operating region is sometimes called $$\\beta\$$ and sometimes $$\h_{fe}\$$, and will be specified on the BJT datasheet. Numbers from 40 - 400 are pretty typical for this parameter.

As mentioned above, in this circuit you actually don't want to operate in the linear region, but in saturation. In this mode, the $$\I_c/I_b\$$ ratio drops, but you can still plan around a gain of 10 or so.

If your micro really can't provide more than 2 mA from its GPIO pin, you can probably make this circuit work as you drew it, but you will want to choose a BJT with a $$\\beta\$$ spec of 100 or more, rather than one on the lower end with only 40.

• Common BJT such as 2SC1815, 2SC945, CS9013 are acceptable options for this circuit to work in saturation region. Commented Nov 23, 2019 at 1:59

(I don't have enough reputation to comment someone's else answer yet...)

I completely agree with The Photon (+1). However, another option would be to use a n mosfet with a low threshold voltage (below 3V for example). You should make sure that you can actually turn the mosfet on with your MCU output.

The mosfet should be ready to handle more than 0,04 A.

• Threshold voltage is not the number you should be looking at- the Id is only guaranteed to be a small current (eg. 250uA) at Vt. Commented Nov 22, 2019 at 19:27
• You are right. I should have said that the maximum threshold voltage should be below 3V (giving some reasonable margin) A mosfet that would actually fit the specs : eu.mouser.com/datasheet/2/308/BSS138LT1-D-1522521.pdf
– Neo
Commented Nov 22, 2019 at 19:31
• It's better to pick a MOSFET that has a guaranteed Rds(on) at the nominal 3.3V or less, and add some margin for increase with temperature (as much as +50%) and supply tolerance. The one you linked to is <10$\Omega$ at 2.75V 85°C so it will drop about 400mV max, which is not as good as an MMBT4401. Commented Nov 22, 2019 at 19:44
• Once again, you are right. I'll try to use your approach next time i need to select a mosfet.
– Neo
Commented Nov 22, 2019 at 19:47