Bipolar transistors are more sensitive to current flowing into the base that the voltage. The BE junction will max out at ~0.7V. You put a series resistor between the base and the pin of the microcontroller to determine the base current.
The hfe of a 2N2222 is ~100 at 150mA collector current. This means you'd want something like 150/100 or 1.5mA into the base to turn it on "hard enough" to flow that collector current.
For switching apps a few mA of current is enough to saturate the transistor. To get, say, 3mA into the base, take your pin output voltage of 3.3 and subtract the base-emitter voltage of 0.7 to get ~2.6V. Take this and divide it by the desired base current of 3mA to get 866-ohm. Choose a standard value close to that (820 or 910 ohms, for example) for the series resistor between the processor pin and the base.