STAMP 1 Correct bias resistors for transistor switch
KatyBri
Posts: 171
Hello,
I need to drive a relay using a transistor switch hooked to an output pin of a STAMP BS1. Seams like a simple thing. But, when looking around the Internet at the resistors used, there is a huge variety shown. I'm not sure which is correct. So I found some calculations to determine the resistor between the STAMP's output pin and the transistors base which turns on the transistor when a high logic level is present (R1); as well as a base-to-emitter resistor which is supposed to guarantee the transistor will shut off with a low logic level (R2). Many examples I found do not even use the base-to-emitter resistor.
I am using a 2N2222A NPN transistor in a grounded emitter configuration. The relay is in between the collector and 5 vdc supply. The relay has a protective diode.
I'm not sure I have the Minimum Base Current correct either since the STAMP pin can only source 20ma max. I don't know what to use for it.
So, here are the calculations I did. If someone, who really knows how to do these calculations, would let me know if they are correct I would appreciate it.
Supply voltage = 5vdc
Load: 40ma for relay = 40 ma (0.04 A)
Minimum HFE of 2N2222A NPN transistor = 50
Minimum Base Current = load/min HFE= 40 ma / 50 = 0.8 ma (0.0008 A)
Maximum Current Required = 40 ma (for relay)
Supply Voltage = 5 vdc
R1= Supply Voltage / (Maximum Current Required / Minimum HFE * 1.3)
R1= 5vdc / (.04A / 50 HFE * 1.3) = 4807.692 ohms
The STAMP1 project board has 200 ohm resistors on it so subtract this value from R1
R1= 4807.692 ohms - 200 ohms = 4607.692 ohms closest available resistor = 4.7 Kohm
note: the .3 in 1.3 adds 30% more current to make sure the transistor stays saturated and on.
R2 = R1 * 10 = 46077 ohm closest available resistor = 47Kohm
Thanks
I need to drive a relay using a transistor switch hooked to an output pin of a STAMP BS1. Seams like a simple thing. But, when looking around the Internet at the resistors used, there is a huge variety shown. I'm not sure which is correct. So I found some calculations to determine the resistor between the STAMP's output pin and the transistors base which turns on the transistor when a high logic level is present (R1); as well as a base-to-emitter resistor which is supposed to guarantee the transistor will shut off with a low logic level (R2). Many examples I found do not even use the base-to-emitter resistor.
I am using a 2N2222A NPN transistor in a grounded emitter configuration. The relay is in between the collector and 5 vdc supply. The relay has a protective diode.
I'm not sure I have the Minimum Base Current correct either since the STAMP pin can only source 20ma max. I don't know what to use for it.
So, here are the calculations I did. If someone, who really knows how to do these calculations, would let me know if they are correct I would appreciate it.
Supply voltage = 5vdc
Load: 40ma for relay = 40 ma (0.04 A)
Minimum HFE of 2N2222A NPN transistor = 50
Minimum Base Current = load/min HFE= 40 ma / 50 = 0.8 ma (0.0008 A)
Maximum Current Required = 40 ma (for relay)
Supply Voltage = 5 vdc
R1= Supply Voltage / (Maximum Current Required / Minimum HFE * 1.3)
R1= 5vdc / (.04A / 50 HFE * 1.3) = 4807.692 ohms
The STAMP1 project board has 200 ohm resistors on it so subtract this value from R1
R1= 4807.692 ohms - 200 ohms = 4607.692 ohms closest available resistor = 4.7 Kohm
note: the .3 in 1.3 adds 30% more current to make sure the transistor stays saturated and on.
R2 = R1 * 10 = 46077 ohm closest available resistor = 47Kohm
Thanks
Comments
47K is way too high, I doubt if the relay will trigger much over 1K . I usually use 330 ohms to drive a relay transistor like that. You want to saturate the transistor to switch fully on.