# Calculate base resistor, for transistor

#### tigerapna

Joined Dec 14, 2011
73
How do I calculate the base resistor value?

I saw a formula:

Rb = (V(ic supply) x hFE) / (5 x I(load))

and also I saw

Ic/Ib = hFE

and I heard:

Ib should be a tenth of Ic but if the gain is 100 than it should be a hundredth?

I'm very confused.

I have attached the schematic.

My output to the transistor base is a quad AND gate IC which will operate a 24VDC relay.

#### Attachments

• 55.9 KB Views: 77

#### #12

Joined Nov 30, 2010
18,224

V fromMM74 will be a bit below 5 volts and the transistor base to emitter will use up about .65 volts. The current to the base should be one tenth of the load current to get a nice saturation of the transistor.

(4.5v - .65V)/1.67 ma = 2310 ohms.

#### tigerapna

Joined Dec 14, 2011
73

V fromMM74 will be a bit below 5 volts and the transistor base to emitter will use up about .65 volts. The current to the base should be one tenth of the load current to get a nice saturation of the transistor.

(4.5v - .65V)/1.67 ma = 2310 ohms.
Thank you for clearing that up!

Can I add a resistor and LED to the output of the 74hc08n? to indicate the transistor is on?

#### #12

Joined Nov 30, 2010
18,224
There's only about .003 amps left in the chip. That would make a dim LED. Better to put the LED and resistor in parallel with the relay coil. That would have the .01 to .02 amps needed for a bright LED and actually indicate that the transistor is on instead of indicating that the chip is telling the transistor to be on.

#### tigerapna

Joined Dec 14, 2011
73
There's only about .003 amps left in the chip. That would make a dim LED. Better to put the LED and resistor in parallel with the relay coil. That would have the .01 to .02 amps needed for a bright LED and actually indicate that the transistor is on instead of indicating that the chip is telling the transistor to be on.
Thank you for your assistance #12, everything worked like a charm.

One last question:

If I hookup 110VAC through the 8A relay contacts, will it effect any of my low voltage logic circuit? Or is it completely isolated?

#### #12

Joined Nov 30, 2010
18,224
It's isolated.

That's the main purpose of a relay...to keep two different circuits from talking to each other.

#### tigerapna

Joined Dec 14, 2011
73
It's isolated.

That's the main purpose of a relay...to keep two different circuits from talking to each other.
One last last question :

Which combo of diode and transistor should I use?
I'm using 1n4148 and PN2222A and either the diode or the tansistor keeps blowing.

The relay is. 24dc 16.67ma

#### #12

Joined Nov 30, 2010
18,224
It's the diode. A 1N4148 is a signal diode. Inductors kick like crazy when you try to shut them off quickly. Try a power diode like a 1N4001 to 1N4007 or a power Shottky if you have one.

#### Ron H

Joined Apr 14, 2005
7,063
It's the diode. A 1N4148 is a signal diode. Inductors kick like crazy when you try to shut them off quickly. Try a power diode like a 1N4001 to 1N4007 or a power Shottky if you have one.
16.7mA and 24V should be no sweat for 1N4148 or PN2222. Something else is wrong.

EDIT: DO you have power and the load connected to the relay contacts when the devices fail?
What is the load on the contacts?

Last edited:

#### #12

Joined Nov 30, 2010
18,224
Darn. I got another one wrong.

#### Ron H

Joined Apr 14, 2005
7,063
Darn. I got another one wrong.
Inductors do create a high voltage spike if the current is interrupted, and has no place else to go. The diode is there to provide an alternate current path.
When the tranny turns off, the voltage across the inductor abruptly reverses, but is clamped by the diode. The initial diode current is equal to the current that was flowing in the transistor, i.e., 16.7mA. The diode reverse voltage is 24V when the tranny is on. The transistor collector voltage goes to ≈24.7V when it first turns off. These are the maximum stresses on the semiconductors.
I occasionally hear of mysterious relay driver failures like this. I wonder if it is due to voltage induced on the coil due to high current transients in the contacts. Maybe other forum members can comment on this.

#### tigerapna

Joined Dec 14, 2011
73
16.7mA and 24V should be no sweat for 1N4148 or PN2222. Something else is wrong.

EDIT: DO you have power and the load connected to the relay contacts when the devices fail?
What is the load on the contacts?
I don't have anything connected to the relay contacts when it fails. (the N/O and NC switches right?)

I just have power going to the relay through the transistor.

I have a resistor and LED in parallel to the coil.

#### Ron H

Joined Apr 14, 2005
7,063
Are you sure you have the diode connected correctly? If it were reversed, either the diode or the transistor would fail. If the transistor collector and emitter were swapped, that could also cause problems.

#### tigerapna

Joined Dec 14, 2011
73
Are you sure you have the diode connected correctly? If it were reversed, either the diode or the transistor would fail. If the transistor collector and emitter were swapped, that could also cause problems.
I will triple check the connections when I get a chance. The diode connection is 100% correct. I'll take a look at the PN2222A data sheet again for E B C

It doesn't fail right away. It will work for some time and then when I try to test it randomly the diode or transistor will fail.

would the transistor still work if the collector and emitter were swapped?

#### Ron H

Joined Apr 14, 2005
7,063
Some transistors still work when reversed, but beta will be very low, and the "collector" (emitter, actually) will break down at around 6 to 8 volts.

Can you provide a link to the relay datasheet, or, failing that, the part number?

#### tigerapna

Joined Dec 14, 2011
73
Some transistors still work when reversed, but beta will be very low, and the "collector" (emitter, actually) will break down at around 6 to 8 volts.

Can you provide a link to the relay datasheet, or, failing that, the part number?
I attached the data sheet.

thanks so much for your help on this.

#### Attachments

• 591.1 KB Views: 17

#### Ron H

Joined Apr 14, 2005
7,063
I attached the data sheet.

thanks so much for your help on this.
That datasheet has a lot of part numbers on it. In the table at the bottom, which one is yours?

#### tigerapna

Joined Dec 14, 2011
73
That datasheet has a lot of part numbers on it. In the table at the bottom, which one is yours?
TE Connectivity
RTE24024

#### Ron H

Joined Apr 14, 2005
7,063
OK, thanks.
Do you have good power supply decoupling? I would have at least 10uF in parallel with a 100nF ceramic cap from +24V to ground, mounted as close to the positive end of the relay coil as possible.