I want to use a BC547 transistor to switch a mosfet. The base-emitter side should be driven by a raspberry pi. Max output from the pi is 3.3v, max current is 15mA but I would not like to have more than 6-8mA for safety reasons - output pins are connected directly to the arm chip and I do not want to risk damaging it. My problem is that I do not know how to calculate the base-emitter current. The datasheet of the bc547 says that the base-emitter side is saturated at about V_BE_sat=700mV, but I have no idea about the I_BE. I could measure it with a multimeter, but this question became a theoretical one for me. How can I calculate this for any V_BE value and any datasheet?Would it be wise to use a resister to limit base current ?
The base-emitter junction will drop around 0.7v when fully "on", so...
3.3v - 0.7v = 2.6v to drop
Ib = 8mA (the amount of current you desire into the base)
E = I*R
R = E/I
R = 2.6v / 8mA
R = 325 Ohms
325 Ohms (330 standard value) will give around 8mA into the base, at 3.3v and with 0.7v being lost from base to emitter.
The performance curves are to be found in the data sheet for the information you seek. And what do you mean by "minimum Ib required to fully open the transistor?". The curves typically show Vce marked on each curve, with Ib and Ic shown. Beta or intrinsic gain of the transistor is not of as much practical interest as the actual gain when you employ the transistor in a circuit, because the circuit designer will do a trade-off of the beta, accepting a lower value of current gain to obtain a more temperature stable circuit. In your application, you should be more concerned about the max draw of current from the driving circuit (rasp pi) which you decided to restrict to 8ma. Hence the practical way its done is to simply divide the input voltage less 0.6 volts by the resistor you have at input to base , this gives the max current draw from your rasp pi in worst case scenario, this scenario may not really be achieved in practice by your circuit, its really a circuit input impedance design criterion or thumb-rule.
Other issues you raised like collector current resulting are not relevant except for calculating the power is within the transistors thermal dissipation requirements, which is also not an issue in your application.
Further, note that the actual collector current would depend on your LOAD resistor (Rc in parallel with your load resistor, the net value) , you are making an error by thinking the collector current is Theoretical beta of transistor times Base current. I normally look at voltage gain only , RL/Re (load resistor over emitter resistor ) gives the voltage gain in a Common Emitter circuit, check if it satisfies your output requirements first.
For MOSFETs, the Gate charge will be given in data sheet, divide that by the rise time (usually in ns) to obtain the peak current. This is instantaneous and not correlated to your maximum collector current for transistor driver. Refer to "peak instantaneous pulse collector current" in data sheet, or something similar sounding to know how much instantaneous current it can give in response to a brief pulse input. certainly it will be more than 10 times Ic max (continuous).
I usually find it quicker to simulate this kind of thing in LTSPICE, placing a capacitor in place of the MOSFET (if i do not have the mosfet model this is quicker to answer the basic question if the output amperes would fall within the transistor's specs) which is having same value as the "gate capacitance" (this is given in MOSFET data sheet for different voltages, select the voltage of interest as the P-0 value of your square or sine wave at MOSFET gate) and run the simulation, which will let you know the current wave form at collector pin (same as MOSFET gate, nearly).
There is nothing really to remember if you consider the b-e as a diode.. either 0.7V or nothing, the beta of the transistor is known, and Kirchoff's Làws are applied. You could also be called upon to remember that current is never created or destroyed, so that at any point collector current will be equivalent to base current plus emitter current. Draw a circuit picture to deduce the current directions.