morrisonandboyd:
You will get a 0.6-0.7 volt drop through the transistor when fully on.A TIP-120 darlington is a better power transistor.
Make that ~0.1volt for the PN2222 (with the right base current).
A TIP120 has >=0.7volt saturation because of the darlington configuration.
Not a good choice below a few hundred milliamps.
A 220ohm base resistor and a PN2222 should work.
Maybe OP should post a real picture of the setup.
Note the TWO mistakes in the Fritzing picture.
Leo..