mosfet resistors

so im adding gate resistors to a circuit and need to know what values to use,

i'll be running an attiny85 to control 2n7000 mosfets with a 5v power supply.

i want to add the resistors used for chip pin to mosfet gate and gate to gnd.

ive tried to search for this answer and havent had much luck, what would you recommend being used?

The resistor value isn't too critical. About 1K should be fine.

The gate has a small capacitance. That capacitance (with no resistance) is bad for the Arduino when it switches state because the capacitor gets charged/discharged without safely limiting the current.

When you add the resistor you limit the current but you also create a low-pass filter which makes the MOSFET switch on & off more-slowly. A larger resistor makes it slower. During the time it's switching (when it's neither fully-on or fully-off) it dissipates more power and generates more heat so you'd like to switch it fast.

Both of these a bigger issues when switching high-power at high frequencies (such as PWM or high-frequency PWM).

No gate resistor needed for that mosfet (tiny gate charge), but use 220ohm if that makes you feel safer.
Add a (10-100k) resistor from pin to ground (not from gate to ground) to keep the fet off during boot time.
What are you switching (current). The 2N7000 is not really logic level, but ok for small loads.
Leo..

its only 20 to 40 ma as its one or two leds per pin.

i knowthe chip can handle that without but id much rather have them there to ensure longevity of the pin driving 2 leds as it seems thats the threshold for it

Note that stray capacitances on logic signals are in the 1..10pF range, in cables 30pF--1nF or so(*), small signal MOSFET/transistor is a few tens of pF or so, but large power MOSFETs have upto 10nF of gate capacitance - way beyond what a logic signal is designed to handle (perhaps 100pF or so).

(*) which is why raw logic signals can't work at high speeds over most cable runs.

I am assuming you are using an arduino driving LEDs or relays. You can directly connect the arduino pin to the gate of the mosfet. You can add a 10K or so pull down to be sure the FET is off during reset. If you want to add a gate resistor I typically use less then 50 Ohm. as for the gate capacitance your wiring will probably have more then the FET. Check the output rating of the Arduino microprocessor and its switching time to determine if it is even close to a problem. Charge time is in the range of 1us or so assuming 0.2 Ohm resistance. Try this: Capacitor charge and discharge calculator | MustCalculate
1 nF (nanofarad, one billionth (10−9) of a farad) = 0.001 μF = 1000 pF. 1 pF (picofarad, one trillionth (10−12) of a farad). If you are using a 2N7000, not all are avalanche rated, if not you will need a diode if driving a relay.
Good Luck & Have Fun!
Gil

well it was going to be an attiny45 but due to imcompatibility with a certain library i have to change the chip im using.