Powering a 5V fan via Arduino

Hey, so I followed this thread (https://forum.arduino.cc/index.php?topic=653252.0) because I have the same fan (5V, 0.2A) and I want to power it from an Arduino.

I want to change the transistor into something more common (like BC337) and want to calculate the required base resistor.

I found the DC current gain is 10 (Ic/Ib at VCEsat=0.7V is 10)
The base current is: Ib=0.2A/10=0.02A
To calculate the base resistor Rb, the supply voltage 5V is subtracted by 10% of 5V as tolerance and 0.7V as the drop over Base to Emitter.

So Rb = (5V-0.1*5V-0.7V)/0.02A = 190 Ohm

Is this calculation correct?

Sounds OK, but I would think the gain would be higher than 10 in practice. More like 50 to 100. Where did you get the figure of 10?

But 200R should do no harm.

Don't forget a fly back diode for the fan motor, or the transistor could be damaged.

190 sound pretty good.
I usually pick a resistor that will keep Arduino pin current flow at a safe level.
With Vbe ~ 0.7V, then:
(5V - 0.7V)/.025A = 172 ohm
180 I think is a standard value, for a touch less current.
150 is another for a touch more current.
Either way, you want the transistor to turn full on and just act like a switch as much as possible. Otherwise Vce increases and the transistor has to dissipate more power; you want the load to dissipate power, not the switching device.
That is where N-channel MOSFETs shine, their low Rds lets the load see almost all the power while running nice & cool themselves.

PaulRB:
Sounds OK, but I would think the gain would be higher than 10 in practice. More like 50 to 100. Where did you get the figure of 10?

Hang on, are we not always explaining to people that this is for saturating the transistor and switching power, not amplifying a signal, so a figure of 10 to at most 20 is the correct figure?

The OP has already explained that the figure of 10 is from the datasheet!

Paul__B:
The OP has already explained that the figure of 10 is from the datasheet!

?

Look at the saturation graphs in the datasheet.
When used as a switch, a low remaining CE voltage is required, otherwise the transistor will get hot.
That can only be achieved when the base is driven hard (5-10% of Ic).
Gain (Hfe) is irrelevant when collector voltage (0.1) becomes lower than base voltage (0.7).
Been explained many times here.

220 ohm ((5-0.7)/220 = ~20mA) is a standard/safe value for up to a few hundred mA collector current.
Leo..

Ok, I get it. But my point is the OP has not mentioned a data sheet, or even chosen a specific transistor (only that it will be "like" bc337). He "found" that the gain is 10, but does not say how or from where. The OP may believe they have correctly measured the gain in some way, or used a transistor tester. How often do newbies come to the forum convinced of some particular fact that that turns out to be nothing of the kind, and they can't recall the source?

PaulRB:
He “found” that the gain is 10, but does not say how or from where.

Actually he did explain how.

In the OP.

antonright:
I found the DC current gain is 10 (Ic/Ib at VCEsat=0.7V is 10)

Look here at the BC337 datasheet.
The last (3rd) box under “ON CHARACTERISTICS” on page 2 says: Collector−Emitter Saturation Voltage (IC = 500 mA, IB = 50 mA)