 # atmega328p+pca9685+mosfet gate resistor?

What I want to do: pwm controll 24v light sources from my arduino nano v3 board(328p).

Since I also have sensors connected to the 328p I am running it on 3.3v. Since the 328p can only output 6 pwm channels I want to use an extension board with a pca9685 so I get 16 pwm channels. since the pca9685 can only output 25mA I want the pca9685 to controll mosfets.

Now I have landed on the FQP30N06L mosfet.(I might change to IPD220N06L3 mosfets since they have lower Rds and Qg and a built inn drain-source diode)

My problem: How do I calculate the gate resistor?

I want to have it as small as possible so the mosfet switch as fast as possible and at the same time big enough to keep the current under 25mA so I don't overload the pca9685.

Is it as simple as ohms law R=U/I wich gives me 3.3v/25mA=132ohm? Or is there something else to consider?

Well after some more digging I found out it is as simple as ohms law because the gate acts as a capacitor so when the mosfet is in its off state the gate is discharged and when you turn the mosfet on the gate has to be charged. So the greater Qg the greater the current, anyways there allways has to be a current limiting resistor there (wich also counteract ringing effect).

Large resistor = slow switching

Small resistor = large current spike

So you have to calculate the optimum Rg.