I want to calculate the transistor base resistor. My transistor is 2N5088. The collector is connected to a motor's ground. The emitter is connected to the ground. The motor is connected to a 5V power supply and the base to a 3.3V power supply (but same ground).
I'm actually pretty new in all the electronic stuff. This is a transistor I've got in a kit (only this type)... Thank you for the warning! Which transistors are better for this?
Thanks for the suggestion (and the last tool is very cool)! I actually know the basic theoretical part of electronics. But when it comes to real life, it is harder :).
The hardest part for me is to find the components that fit my needs. For example, in your link they use PN2222 in another tutorial, I saw they use 2N2222. Not sure why...
The 2n2222 is a common transistor originally in a metal TO-18 case. The PN2222 is a (now more common) variant in a plastic TO-92 case. they can be used interchangeably.
Hfe is not relevant when the transistor is used as a switch.
A base current of 5-10% of the collector current is commonly calculated.
That would be 10-20mA into the base (for 200mA collector current).
Have a look at the saturation graph in the datasheet.
A 3.3volt pin usually can't provide 10mA, so you might have to reduce base current to an acceptable CE saturation voltage.
470 ohm could be ok, which is (3.3 - 0.7) / 470 = ~5.5mA.
330 ohm (almost 8mA) might already be over the MCU specification.
The danger of not fully saturating is the transistor heating up and popping it's top.
Are you sure your motor is 200mA (stall). That would be fingernail-size.
Motor drivers usually use mosfets for switching, or (the older ones) darlington transistors.
Leo..
If the (unspecified) pin can safely provide 10mA, then use 330 ohm.
0.7volt is the drop across the transistor's BE junction, leaving about 2.6volt across the resistor.
Assuming the pin stays at 3.3volt under load (which it doesn't).
You might just have about 2volt across the resistor (2/330= 6mA), which is ok.
Leo..