Hi, my ignorance on this is really showing here: I want to use a transistor (this one: https://www.digikey.com/products/en?keywords=497-3235-nd) to control a small relay. The coil current on the relay is only 22 mA, so I probably could use an output pin on my Arduino Uno directly, but I'm wanting to be on the safe side. What I'm wanting to know is: what is the draw on the transistor? Which spec do I check for that, or is it presumed to be so small as to not be a factor? As you can see, there's much here I don't know. Thanks in advance.
The HFE (gain) is 150-300. 22ma collector current is quite small.
Base current X HFE = Collector current. Base current = .022 / 150 = 150 µA Base resistor = 5v / .00015 ~ 33k suggest you just use a 220Ω
Make sure you add a kickback diode across the relay coil.
Base resistor = 5v / .00015 ~ 33k suggest you just use a 220Ω
I think what larryd was saying here is for switching applications where you want the collector voltage as low as possible when the transistor is conducting (ON) you must assume a lower gain number.
A rule of thumb is to use a "forced gain" of ~ 10, instead of hfe. This is because hfe is only specified when the collector is not fully on or fully off but in the amplifying mode.
I suggest an analysis using the "forced gain" would be:
Load current = 22 ma Desired base current = 22ma / 10 =2.2ma
Drive from processor ~ 4.7 Vdc Base to emitter voltage drop ~ 0.6V
Base resistor = (4.7 -0.6 ) / 2.2 ma = 1.8k
I believe this will do the job. You could use the 220 ohms previously suggested and it will work fine but the processor will be providing almost 20 ma to the base, which is almost where you started.
LarryD and JohnRob, thanks to both of you. That helps me make sense of this. Greatly appreciate your input!
If you know that the coil current is 22 mA at 5 V - coil resistance at least 220 Ohms, you can use the Arduino output directly, Put a diode across the coil and once you define the pin as OUTPUT, do not alter pinMode.
Not sure the OP’s relay is 5v, but it might be.
Here's the relay: https://www.digikey.com/products/en?keywords=apan3105
It would simplify things if I didn't have to add the transistor. My multimeter shows 231 ohms across the coil terminals. Is there any real need for a transistor switch in this case?
i would go with reply #2 and a kickback diode.
If you were to drive the relay from an Arduino pin, its essential to use a schottky free-wheel diode to protect the pin's internal protection diode which aren't designed for 20mA.
If you use an ordinary diode the protection diode in the chip may get fried as there's no guarantee it won't take the brunt of the current pulse.
@MarkT -- I had planned to use a regular diode in series with a Zener diode. Would that work? I understand that minimizes the delay in releasing the relay contacts, which helps preserve the life of the relay.
If you drive direct from an Arduino pin, the only protection you can use is a schottky diode, anything else will burn out the pin's protection diode.
If you want zener+regular diode back to back, use a transistor.
Actually, I was thinking that with the pin in OUTPUT mode, there would be no need for the snubber diode however this may not be the case for a coil resistance less than 500 Ohms.
This also presumes of course that the output FETs switch over within a reasonable number of nanoseconds, much faster than the resonant period of the relay coil.
Input protection diodes are absolutely tiny, continuous ratings might be a mA or so... Its bad practice to rely on them for anything but static protection.
But the protection diodes should not be subject to the kickback voltage as long as the output FET catches it.
Paul__B: But the protection diodes should not be subject to the kickback voltage as long as the output FET catches it.
You forget that pressing reset turns off all the output FETS...
Then don't press it.