I'm new to electronics. If I say anything that's presumptuous or just flat out weird or wrong, please point it out. There are many gaps in my knowledge.
I'm working on a simple personal project. I want to use a PIC16F88 microcontroller to toggle an LED on and off at regular intervals. I'm using this LED. If I'm interpreting the datasheet correctly, this LED is happiest when it can draw 30mA - which I'm told is quite greedy for a little LED like this. In any case, the PIC16F88 would struggle to source or sink this much current on any of its I/O pins, so the solution seems to be to use a BJT or MOSFET.
I decided to use this MOSFET - which seems a little overkill, but it's what I had available. The plan is to configure a pin on the microcontroller as a digital output, and then in software just set that pin HIGH, then sleep, then set it LOW, sleep, repeat. This signal would trigger the gate of the MOSFET and allow the desired current to flow through the LED (with a 100 Ohm resistor in series with the LED).
Here's where my questions start:
In my configuration, the PIC16F88 outputs a LOGIC HIGH at +5V. 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, like with a resistor? I mean, 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), but what about the current? I certainly wouldn't want the microcontroller to try and source more current than is desirable for the I/O pins, so in a sourcing configuration, around 1.6mA? Less than that? I'm basing that guess on an answer I got for a different question I posted about the same microcontroller, where the user @glen_geek writes:
It appears that an I/O pin can sink current (8.5mA) with less stress than it can supply current (1.6mA). These are not limits, but are a single data point within the maximum limits stated elsewhere (Section 18.0 states that maximum current on any one I/O pin shouldn't exceed 25mA).
I don't really have room for experimentation, because I don't have access to a multimeter at the moment. How would I even know how much current my pin-to-gate connection is drawing? I realize that MOSFETs are voltage-controlled devices, so does any of this even matter? Does the MOSFET only draw as much current as it needs at the gate (does that even make sense)? I also know you can have voltage without also having current... is it kind of one of those things? You can tell I'm flailing at this point.
Finally, one more tangential question: Is it possible - or does it even make sense - to achieve a configuration in which the pin is sinking current (which would be desirable apparently because the microcontroller can do this more easily), and in doing so, triggering the gate of the MOSFET? I thought about this for a while but it doesn't really possible - perhaps not even useful, seeing as how I'd be using a MOSFET to do the heavy lifting anyway.
Thanks for any feedback.