0
\$\begingroup\$

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. enter image description here

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?

\$\endgroup\$
1
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Nov 22, 2019 at 19:17

2 Answers 2

2
\$\begingroup\$

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.

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

(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.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ 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. \$\endgroup\$ Commented Nov 22, 2019 at 19:27
  • \$\begingroup\$ 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 \$\endgroup\$
    – Neo
    Commented Nov 22, 2019 at 19:31
  • 2
    \$\begingroup\$ 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. \$\endgroup\$ Commented Nov 22, 2019 at 19:44
  • 1
    \$\begingroup\$ Once again, you are right. I'll try to use your approach next time i need to select a mosfet. \$\endgroup\$
    – Neo
    Commented Nov 22, 2019 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.