Hi, I’m a neophyte and although I know how a transistor works, I don’t know how to calculate the resistance on the base I would like some help. In a circuit where I used a transistor as a switch, and a voltage between collector and emitter of 19V works only if at the base I put a resistance of 440 ohms no less, otherwise the connected RGB led strip flashes quickly, with the 440-ohm resistor it works correctly, I would like to understand why thanks in advance
We need some more information.
Show us a good schematic of your circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.
In the Arduino IDE, use CTRL T to format your code then copy the complete sketch.
Use the </> button from the ‘reply menu’ to attach the copied sketch.
For a switch, a logic MOSFET is a better choice.
The circuit is very simple. It is made up of an arduino nano and an rgb led strip. Everything is powered by a 19v 3A power supply. The strip consumes approximately 250 mA. Arduino and the strip are connected in parallel with the power supply, and Arduino has a 550 ohm resistor in series so as not to burn. The rgb strip has 3 cables for the ground for each color and one for the power supply. The three transistors are connected with the Arduino base as I had already said in the previous post, collector to the cable of the ground of the strip, and emitter to the common ground. I will try to send an outline but at the moment I can’t, I’m sorry.
Without more information it’s hard to give answers.
When calculating the base resistor you need to know what current the collector needs to sink.
The base current needed to saturate a BJT will vary from device to device.
With a 2N2222
For Ic =500mAdc, Ib(sat)=50mAdc i.e. 1/10 the collector current.
Rb = (5v(Vcc) - .7v(Vbe)) / 50mA = 86 Ω
However, an Arduino can only safely provide 20mA base current not 50mA, a properly selected logic level MOSFET should be used.
We really need to know the information asked previously.
For how long?
I think you should consider a different technique.
A resistor is not a voltage regulator. One safe way of powering the Arduino from 19V is a 5V buck converter feeding 5V to the +5V pin. Another way is a 7V buck converter providing 7V to the Vin pin (input to the built-in 5V regulator).
The calculation is wrong since the hfe of that transistor is 100 not 10, also the emitter is connected to the common ground then Vbe in saturation is approximately 0.3v. Then:
For Ic = 500m, Ib (sat) = 500/100 = 5mA; Rb = (5v (Vcc) -0.3 (Vbe)) / 5mA = 940Ω
Calculation is true because HFE can be as low as 40 and you have to take margins
Are you using the transistor between the supply and the RGB strip V+?
NPN is the wrong transistor, PNP should be used there. Or a P-MOSFET.
Hello. That hfe that you say is for collector currents of 0.1 mA, for the currents that we are using here the hfe takes values of 100 minimum, 150 typical and 300 maximum. Considering it as 50 or 40 is not taking a margin, it is a complete error.
Not taking hfe into consideration at all; hfe has nothing to do with this calculation.
For saturation, Ib is one tenth (1/10) the value of Ic, see the data sheet.
So, HFE is important.
To be sure to saturate a bipolar transistor we take a “forced” HFE equal to the HFE min divided by 10.
This is probably the origin of your division by 10.
It is possible to take less margin, but then you have to pay attention to all the parameters.
One must ensure the base collector junction becomes forward biased so we do not use Ib values where we just approach saturation, we must exaggerate this value, hence in this case Ib is 1/10 that of Ic, Ic = 500mA vs Ib = 50mA as stated in the data sheet.
So in reply #3, @hydas seems to indicate this is the circuit.
Most LED strips are designed to handle up to 12V, so this would suggest an additional current limit resistor, indicated by the blue resistors here, would be needed to prevent overdriving the LEDs and burning them up.
Once @hydas indicates the NPN used, then the best base resistor to be used can be calculated.
19V feeding Vin with 550 ohm would seem to limit the current & voltage into the 5V reg. If @hydas could get a multimeter reading of Vin we could see if the 550 was sufficient, or perhaps too high. 19V shorted to Gnd with a 550 ohm resistor would only pass V=IR, V/R = I, 19V/550 ohm = 34.5mA, which suggests to me that 550 might be too high and limiting the current into the Nano too much.
Well, no matter how much I look at the datasheet, I can’t find that of 1/10, instead this graph, which is the one that is usually used, (I at least), they all copy each other
With the excess Ib that this poor TR is receiving the frequency response is changing, and that is why the LEDs blink, the TR does not recognize well the PWM frequency it receives.
@hydas does not indicate PWM is being used.
That circuit should not connect Vin to 19V. That is likely to blow up the input capacitors which are normally 12 or 16V rated. Also the resistor in series with it is also very wrong.
@CrossRoads do we bet that if? If I did not use it with that of the 1/10 that you use the TR would not cut the current, at most they would burn, that on the edge of it they have been doing tests by lowering the Rb. Anyway, let’s hope that @hydas answers with something because the only thing we do is suppose things.
Agreed, we need input from @hydas.