What is the proper way of driving a logic level with an arduino?
Connect from the Arduino pin to the gate through a resistor, like this:
A pull-down resistor on the gate (or zener diode) is also suggested to keep charge from accumulating at the gate when the Arduino is unconnected or floating.
Or, if it better to use something like a 2n2222 to drive the fet? Seems like you wouldn’t need to.
You don’t need to.
How does one pick the correct value of the gate resistor?
There is a tradeoff between current drawn from the Arduino pin and the switching speed (turn-on/off time) of the MOSFET. The MOSFET gate looks like a short circuit at the instant the Arduino drives its pin high (it is very capacitive). The instantaneous current sourced by the Arduino is (to a first approximation) I=5/R where R is the gate resistor. It is a good idea to keep I<0.02A so I would recommend R>250 ohms.
Now since the MOSFET gate is very capacitive (a few nF) the gate resistor and this “capacitor” form an RC network which cause the gate voltage to rise “slowly” towards 0V rather than instantaneously. For example, the MOSFET you selected (MTP3055) has a gate capacitance of about 760pF, let’s say 1nF for simplicity. The time constant formed by a 250ohm resistor and 1nF capacitor is 250ns. As a first approximation it will take 5 time constants, or 1.25us, to turn on/off the MOSFET.
99.9% of the time this is good enough (turning on a solenoid or relay, for example) but is not good enough for high-frequency switching in power supplies, motor drivers, etc. so more careful consideration is required.
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons