Resistor values for P-Channel MOSFET + NPN Transistor Switch

There are numerous errors in your schematic. Try this, instead:


NOTE: Updated schematic to indicate ground attachment to supply [previously, "ground" was ambiguous].

And, that FQP47P06, has a "Gate Threshold Voltage" that will not be, consistently, low enough for it to work in this application. I mean, since, technically, the VGS(th) can be as low as -2V, and because, in this case, you're only driving a measly LED at around 6mA, if this is a one-off, you might be able to cherry-pick a winner, but I wouldn't hold yer breath :wink:

But, on to the rest of your question: How to figure out the resistors values. I see you connected to D4, which is NOT a PWM enabled output, so that makes this trivial:

Since a MOSFET is [statically speaking] a Voltage Driven device, you can get away with a wide range of values for R2. So, lets pick a value that will not contribute much to power supply demand [in case the Pro Mini is also being powered by a battery], like 33k.

The PN2222 is a Current Driven device. Thus, it's a matter of the ratio of input current, to output current. A bipolar transistor has a parameter called hFE, which is a number that indicates the maximum expected current gain. The hFE for a PN2222 is around 35 for the small current will be dealing with, here.

Rule of thumb, to turn a BiPolar transistor on, in a way that insures it's "really on" [i.e. is in the "saturation region"], use a current gain of "10", and since the gain, on this transistor, goes all the way up to 35, there's enough "head room" to achieve this.

Thus, a 33k resistor on the collector, will allow a current of around 0.1mA, when the transistor is all the way on, so to satisfy the stipulation of a current gain of 10, use the following math:

IB = IC/10 = 100µA/10 = 10µA
R1 = (Voutput - VBE)/IB = (3.3V-0.7V)/10µA = 260k

BUT, if conserving energy for a battery is not an issue, then a little more drive current might be wise -- especially if that MOSFET has a lot of Gate Capacitance to deal with [a whole other subject, that is more apropos for such things as PWM]. So, lets choose, for R2, a value of 3.3k, so we have 1mA of pull up current [e.g. turn-off current]. Combining the two formulas:

R1 = (Voutput - VBE) * 10/IC = (3.3V-0.7V)*10/1mA = 26k