Maker Pro
Maker Pro

pull down resistor for npn relay driver

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Hi all,
I have the attached circuit diagram. I wanted to know if there is any way of calculating the value of the pull down resistor. I don't want the relay to be driven on when the microcontroller is switched on.
My understanding was that if the output from the PIC is OV. Then the transistor is off because we have the 15K in parallel with the pull down connected to 0V. It's when we have a high impedance, I think that case the pull down cones into play. also there is a miller effect from collector to base of the transistor, which could be influenced by the hfe of the transistor I.e. noise. But the pull down discharges this capacitance to 0V.
So is there a way to calculate the pull down value? Thanks in advance.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
10K would typically be fine. It is not critical.

Bob
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
you haven't attached a schematic, but I assume you have a common emitter circuit with a base resistor and no emitter resistor.

a resistor from the base to ground that is about 10 times the base resistor will do what you want.
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Hi Yes, i was having trouble uploading the schematic. Yes i have a 15K from the PI I/0 line to the base of the NPN. It is in common emitter mode with no emitter resistor, I was thinking of around 56K to 68K. Is there anything that determines the value?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
thread nothing special, but I wonder if the base resistor you're using isn't a bit on the high side.

it's ok if you're switching a load of about 3 mA. A more typical value might be in the order of 1k or so for a relay drawing 50mA or thereabouts.

oh, and do you have a diode across the relay coil?
 

AnalogKid

Jun 10, 2015
2,884
Joined
Jun 10, 2015
Messages
2,884
If the PIC output pin is active (either high or low) at all times, you do not need an additional pull-down resistor from the base to GND. If the PIC output pin might go to an input mode or tri-state (high output impedance), then a pull-down resistor will decrease the circuit's sensitivity to large radiated noise bursts, such as from arc welders on a production floor. The smaller the resistor, the less the sensitivity. BUT, the smaller the pulldown resistor, the more energy the PIC has to produce to turn on the transistor.

Starting with the PIC, its datasheet has its max rating for continuous output current and the associated high output voltage (it will not be equal to Vcc). Minus 0.7 V for Vbe, that gives you enough to calculate the smallest safe value for the series base resistor. Once you have that, calculate the base current and multiply it by 20 (I think 10 is too conservative for contemporary parts) to get the max collector current in hard saturation. If your relay needs less current, you can work backwards starting with the load current to determine a larger base resistor.

ak
 

Rajinder

Jan 30, 2016
568
Joined
Jan 30, 2016
Messages
568
Thanks ak. Just a final question. I have never really understood the meaning of high impedance or low impedance. What do they actually mean in real terms and why are they so important when connecting circuit outputs to circuit inputs. Is it loading effects? Any help would be much appreciated. Thanks.
 

AnalogKid

Jun 10, 2015
2,884
Joined
Jun 10, 2015
Messages
2,884
Yes, it is all about loading effects. A perfect voltage source (power supply, opamp output, PIC output pin, etc.) has a zero ohm output impedance. The output voltage does not change even if the load resistance varies by 1000, or 1,000,000 to 1. It is a perfect voltage source in series with a zero ohm resistor. Why think of it that way? Because in the real world there is no such thing, and the most common difference is that that series resistor has a non-zero value. So it is in series with the load, or the equivalent resistance of whatever the load is, and the two resistances form a voltage divider. Now the voltage across the load varies depending on what the load resistance is. If (working from memory) a PIC output cah source up to 25 mA, but the output voltage sags down from Vcc as the output current increases, that is a sign of a voltage source output with a measurable ESR (equivalent series resistance).

If something else is trying to impress a voltage across the load while the PIC is connected, that low output resistance sorta kinda appears in parallel with the load resistance. Under some conditions, an external voltage source can drive excessive current back into the PIC causing damage.

Separate from that is a current source output, which has a theoretical infinite output impedance. That is, the current through the load does not vary when the load resistance changes. Again it is two resistances in series, but now one of them is (almost) infinity. So no matter what the load resistance is, it is so small relative to the total resistance that it does not change the load current. If this one seems harder to understand intuitively, don't worry. It is, and many people struggle with it.

Tri-state is an (normally voltage source) output stage condition where neither the pull up nor the pull down transistor are on. So there is no very low output resistance in series with whatever is connected to the pin. If that thing is a transistor base (or even worse, a MOSFET gate), then the base is floating, basically disconnected from the PIC, and can be influenced by strong electromagnetic fields (depending on what other components are connected, trace length and shape, etc.). If there is a chance that this condition might occur, then a resistor from the base or gate to GND will prevent a near-infinite impedance condition.

ak
 
Top