 # Trying to understand a transistor Datasheet

Hi guys,

Datasheet:

So I have a 5vdc relay that I’m trying to control using my SIPO shift register. According to the relay Datasheet, it needs 5vdc and 71.4mA to operate, the relay has a coil resistance of 70ohms, so if I divide 5vdc and 70ohms, I get actually 71.4mA, which satisfies the operation requirement.

Then, I realize this is a saturation condition because all of the 5vdc is dropped across the relay and Vce = 0, if this is the case, what should I set my current at the base?

Looking at the transistor Datasheet, one way I can get these is knowing the DC current gain, but there are multiple Hfe values per different conditions, which one do I choose?

THank you

Vce, per the datasheet, is about 0.2V, it's the "VCE(sat)" line on page 2. Then, on the same line, on the left, it shows you the base current and collector current at saturation. So you use that ratio to calculate your base current.

Then you take your LS1 voltage, subtract the base-emitter Vf (about 0.65V), and divide by the current you just calculated to get the base resistor value.

supercheungchinyau:
Then, I realize this is a saturation condition because all of the 5vdc is dropped across the relay and Vce = 0, if this is the case, what should I set my current at the base?

Also, that is not the way to interpret this. What determines saturation are the base and collector currents. When an increase in base current doesn't result in an increase in collector current (or very little...see the graphs in the datasheet) that is what defines saturation.

For a 5v controller, try a 150-220-390-470 Ω base resistor.

When the relay is energized, measure the voltage collector to emitter.

What were the results ?

When the transistror is tuurned ON there is still some voltage across collector-emitter.
The harder the tr is turned on the lower that voltage.

Fig 17 shows for Ic = 50mA VCES is 0.2V If Ic = 10 Ib; so you need a base current of at least 5mA.

The voltage remaining for the relay is 5.0 - 0.2 = 4.8V.

However the pull-in voltage is 5V * 75% = 3.75V so it will still work fine.

The 328 data sheet gives VOH (digital output voltage when high) as 4.2V at 20mA ; and vbe for the transistor is around 0.7V

so your resistor needs to be (4.2 - 0.7) volts / 5mA = 680 ohms (or 470, 560)

Hi guys, I had some trouble with my account and couldn’t login, it is working now.
Thank you and I appreciate the thoughtful replies.

So, when designing the base and collector resistance and determining the base current, me as a design need to know if the transistor needs to be a switch or an amplifier.

In this case, since I am using it as a switch, therefore I need to look at the saturation characteristics of the transistor.

By looking at the collector-emitter saturation voltage on page 2, the beta value will be 100 for both conditions. But, as a designer, if my requirement is 71.4mA, do I still assume the beta is 100? if so, when will this assumption break down?

thank you

Always assume the lowest gain.

2N2222
Collector−Emitter Saturation Voltage (IC = 150 mAdc, IB = 15 mAdc) = .3v

We will use 15mA.

Note: an Arduino output pin can safely supply 20mA.

Vbe(sat) = .6v therefore V(base resistor) is 5v - .6v = 4.4v

R(base resistor) = 4.4v ÷ 15mA = 293 Ω

As an experiment:

While measuring Vce and with the relay picked in software, try 150-220-390-470-560 Ω as a base resistor.

Pick the 2nd largest value the gives <= .3v Vce.

No. Hfe is the small signal current gain. Typically with Vcc/2 across collector-emitter, NOT for saturation conditions.

For switching you need the tr to saturate so that the voltage across it is small - reducing the ohmic heating.

Look at the curve for your 2N3903 in Fig 16 for IC =30mA.

For Ib = 3mA (Ic/10) Vce=150mV B=10
for Ib = 1ma (Ic/30) Vce = 200mV B=30

These could be described as saturation.

For Ib = 0.3mA Vce > 1V - normal operation. (B = 100)

where B is beta = Ic/Ib

https://www.electronics-notes.com/articles/electronic_components/transistor/current-gain-hfe-beta.php

For your circuit you have Ic=70mA (approx) so you need Ib >5mA for VCES < 0.4V.

The 328 data sheet gives VOH (digital output voltage when high) as 4.2V at 20mA ; and vbe for the transistor is around 0.7V

so your resistor needs to be (4.2 - 0.7) volts / 5mA = 680 ohms (or 470, 560)

You can see from the data sheet VCES changes little between 5 & 10mA Ib so we can use currents even up to 20mA - but the base current * Vbe WILL add a little to the heating of the transistor.

Pd = Vces IC + Vbes Ib so Pd =700.4 + 50.7 = 28+3.5 = 32mW so tr should stay cool.

wingsuncheung2609:
By looking at the collector-emitter saturation voltage on page 2, the beta value will be 100 for both conditions. But, as a designer, if my requirement is 71.4mA, do I still assume the beta is 100? if so, when will this assumption break down?

The datasheet is showing the saturation beta as 10. Not 100.

@LarryD

Collector−Emitter Saturation Voltage (IC = 150 mAdc, IB = 15 mAdc) = .3v

We will use 15mA.

But, if my relay is only rated at 71.4mA, the 150mA fry the relay? The thing I am really confused about is I know my transistor needs to behave like a switch, therefore, it must behave in the saturated state. However, the datasheet only provides to conditions, where I am hanged is what if your condition is OUTSIDE of what is stated in the datasheet?

If I place a 293ohm resistor in the base, current will be 150mA, frying my relay, am I correct on this?

@johnerrinton

When the transistror is tuurned ON there is still some voltage across collector-emitter.
The harder the tr is turned on the lower that voltage.

Fig 17 shows for Ic = 50mA VCES is 0.2V If Ic = 10 Ib; so you need a base current of at least 5mA.

The voltage remaining for the relay is 5.0 - 0.2 = 4.8V.

Why focus on 50mA? the relay needs 71.4mA, am I missing something here?

Can someone please take me through the thought process the situation at hand? if you were me, where do you start analyzing? from the posts, I'am getting two different values of the 680 and 293 ohms (larryD and johnerrington),

“ But, if my relay is only rated at 71.4mA, the 150mA fry the relay?”

If the applied voltage is within the relay’s rating, the relay only takes what it needs, no more than that.

150mA is the maximum for the calculated base resistor, it will be no more than 150mA but it can be less ;).

“If I place a 293ohm resistor in the base, current will be 150mA, frying my relay, am I correct on this?“

No you are wrong.

The 293 Ω base will allow 150mA but the relays internal resistance will only allow 71mA to flow (the assumption is the applied voltage to the relay is correct i.e. 5V, and the gain of the transistor is as stated).

When you try the different resistors mentioned, what’s important is taking the voltage measurement between the collector to emitter to see if the transistor has reached saturation @ ~.3 volts.

If you try 220 ohms and the Vce is 1v the resistor needs to be smaller.
If you try 220 Ω and the Vce is .3v the resistor is okay but it might be good with 680 Ω.
If you try 680 Ω and the Vce is 1v the resistor needs to be smaller.

We always use test equipment to prove out our assumptions, calculations and the data sheet values !

wing the datasheet doesnt show a curve for 71.3mA; only 10,50,100 etc.

look larry d is right but working from a different data sheet 2n2222.

the resistor is not critical; dont panic just use a 470 ohm or therabouts. it will work

we are giving you explanations based on ohms law, cant make it any simpler;

but your question about the relay shows youre not 100% with that.

we are trying, but cant teach you 2 years of electronics in 1 question.

And never cross post again !

Thank you guys, I know it is frustrating but I'm that type of guy that needs to know everything and can't receive an answer without me absolutely understand it, it bugs until the cows come home.

Do you guys have any books you recommend? right now I have the practical electronics for inventors.

Thank you for taking time and "talking" to me

You are reading too much into it.
You want to drive 20, 25mA into the transistor to turn it fully on to act as a switch.
You are not switching the relay on and off at MHz speeds, so you don’t need to worry about turning the transistor on too hard.
Much more than 20, 25mA and the Arduino output drops in voltage; the output MOSFET transistor have a Rds (Resistance from drain to source), current flowing across a resistor creates a voltage. So with more than 20, 25mA that voltage starts to show up more.
If you figure Vbe is 0.7V (looks yours up) and Arduino Vcc = 5V, then current will be
(Vcc - Vbe)/.02A = current limit resistor
(5V - 0.7V)/.02A = 215 ohm. So try a 220, try a 200.
(The output voltage is guaranteed to be at least 4.2V at 20mA, and will drop more due to Rds with more current flow as described above).

On the output side, you want the transistor to act as a switch.
If you put 5V and Gnd on the relay coils, it will turn on, and ~70mA will flow.
If you put (5V - Vce) and Gnd on the relay coils, it will turn on and a little less than ~70mA will flow.
The coils are self limiting for current, so you don’t have to worry about them.

If you want the transistor to act as much like an on/off switch or a piece of wire, then use an N-Channel MOSFET.

I use AOD514
https://www.digikey.com/product-detail/en/alpha-omega-semiconductor-inc/AOD514/785-1357-1-ND/3060919
for boards, it turns on full with 4.5V and just uAs of current - and when it is on it has just 0.012 ohm of resistance.
V = IR, so V = 0.07A x 0.012ohm = 0.00084Volts, so power is not being wasted across the transistor, and the coil can develop all the current it needs to turn full on.

Sorry Crossroads I must disagree on two counts:

You want to drive 20, 25mA into the transistor to turn it fully on to act as a switch.

Kinda depends on the transistor and the load?

Thats fine for a low gain power transistor but the OP is using a 2N3903 small signal transistor and the data sheet (Fig 17) only shows Vces for Ic/Ib = 10.

Fig 16 Vces vs Ib curves only go to Ic/Ib=10 because there is little (DC) benefit in going further.

TL:DR; yes, in extreme cases turn-on time is reduced for more base drive; but then you need negative base bias to extract carriers and turn the tr OFF quickly.

At 70mA Ic (7mA Ib) Vces is shown as 0.3V which is fine.

Secondly - and I see this a lot -

The coils are self limiting for current, so you don’t have to worry about them.

Sorry, its nonsense; what Terry Pratchett calls “lies to children”.

The coil current is governed by ohms law.

The relay spec gives the coil resistance as 70 ohms +_10%.
So when operating at 5V it will draw 5/70 = “71.4” (but really between 65 & 78 mA)

Wing - that explains where the “71.4mA” comes from.

The pull-in voltage is shown as 75% ie 3.75V so it will operate quite happily with Vcc=5V and Vces=0.3V leaving 4.7V for the relay coil.

But … I must agree with you about MOSFETS. They do make MUCH better switches in most arduino applications -provided they are correctly chosen to operate from the low arduino logic levels, particularly the 3.3v versions.

When the transistor first turns on the relay inductance will result in the full 5v across it then going down to 4.7v (Vce(sat) being .3v).

In the old days we would use a voltage on solenoids and some relays that was higher than they were rated for.

A resistor was placed in series with the coil to take up the extra voltage after energizing.

The result was a snappier action well faster operation and more power at pick time.

The coil got all the voltage then degraded down to the final voltage after the time constant . . .