PIC16F88 digital output to gate of MOSFET - Voltage / Current questions?
1) "If I'm interpreting the datasheet correctly, this LED is happiest when it can draw 30mA" - It's not very clear in the datasheet, but you don't have to feed the LED the full 30mA. Less will do. It depends on how bright you would want the LED to be. You could start with 10-20mA or so. I'd expect even 5mA to be enough for the LED to light up.

2) "If my digital output pin is directly connected to the gate of the MOSFET, do I need to limit the current of this pin in any way" - No, you don't have to limit the current. Just apply 5V straight to the gate, no problem. The gate will draw minimal current when switching from high to low and vice versa, and no current at all when the gate voltage is constant. The gate of a MOSFET basically behaves like a small capacitor.

3) "I know I'll have to limit the voltage to the gate (the datasheet says the MOSFET expects a typical Gate Threshold Voltage of +2V, with a maximum of +3V)" - You don't have to limit the voltage to the gate either. The maximum of 3V the datasheet states is about the Threshold voltage. This is the voltage needed to start turning the MOSFET on. According to the datasheet the MOSFET typically turns on at 2V, but it could be as high as 3V before it turns on. That doesn't say anything about the maximum voltage at the gate, which is 20V according to page 1 of the datasheet. With a 5V supply, it's impossible to reach 20V, so apply the 5V straight to the gate. It's even better to apply more voltage to the gate, as more voltage on the gate means less Rdson - less resistance between source and drain when the MOSFET is on.

4) Make sure the gate of the MOSFET doesn't 'float'. So either program the microcontroller that the output is always either high (5V) or low (0V), and never high-impedance (input), or tie a large resistor (maybe somewhere between 10k and 200k) from the gate to ground to pull the gate low when the output of the microcontroller is in tri-state. If you don't do this, the state of the MOSFET will be undefined when the microcontroller output is in tri-state.







simulate this circuit &ndash; Schematic created using CircuitLab