Need help choosing a resistor. Is my math wright?

I'm using my arduino to trigger a logic level mosfet. I need a resistor to put in circuit with mosfet gate to protect the arduino. Or at least that's how I understand it. Using ohms law. I take 450 the amount of current my arduino will actually give me using a USB and divide it bye 5 for the voltage supplied by the arduino. which equells 90. I need a resistor of 90 ohms or so. Is my math for this at all wright?

No, you cannot pull 450mA from an Arduino digital output just because the USB 5V line will supply it.

BTW, -always- ALWAYS give what you are measuring. "450" means nothing. 450 amps? 450 volts? 450 teddy bears?

An Arduino digital output is capable of putting out around 80mA, but it is -rated- at a maximum of 40mA without damage. However, it is a good principle to not take more than 20mA out of it.

Since a MOSFET gate looks like a capacitor, you need a resistor equal to 5V/20mA = 250 ohms. However, that is not a standard value. You could use 270 ohms for a bit less current, or 220 ohms and still be well under 40mA.

If you are simply turning something on and off, this is enough.

However - PWM (ie, analogWrite) needs a driver in between, something that can supply more current.

You should work on memorizing Ohm’s Law and the other formulas for electronics.

V = IR
I = V/R
R = V/I

Graphics like this can help.

Or to include power formulas:

Print them out, tape them on your computer. Put a couple in your shirt pocket, and on your electronics bench. They should become second nature.

Mnemotechnic stuff is good... But please, don't in that case. You have 2 formulas to remember and you can find all the others by inverting them or replacing factors...

V=IR, P=IV, everything else can be derived as needed.

The penalty for forgetting OHM'S LAW is a PIE in the EIR. (P=IE,E=IR)

For you Newbies "E" is ELECTROMOTIVE FORCE (ie:VOLTAGE)

Has anyone ever damaged an arduino by connecting the gate of the MOSFET straight to an input/output pin?

I've never heard any reports of damage from it, I've never had any problems doing it (and I have multiple devices PWMing mosfet gates directly in every-day use w/out issue), and I almost never see designs that include the extra resistor... so I start to wonder about this.

I mean, I'm sure that's a problem on really big mosfets, where the gate charge is larger, but I really question the need for it in practice with the small mosfets that we typically use in hobby electronics.