I need to amplify a PWM signal from 5V to 24V in order to drive a mosfet that in turn drives a small DC motor. The input signal has a frequency of 500Hz and comes from Arduino uno (pin 9).
For amplifying the signal I thought of using a typical non inverting amplifier configuration
simulate this circuit – Schematic created using CircuitLab
If I use an op amp such as the TL071, the typical slew rate is 16 Volts/microsecond. This means that the op amp will take 24/16 =1.5 micro seconds to reach the high output of the PWM. This seems acceptable to me since with a 500 Hz PWM frequency, the PWM period should be 2000 micro seconds, therefore 1.5 over 2000 is negligible.
Is there any other consideration I should do? For instance, should I consider the time the mosfet needs to charge up the gate? Is there a better way to amplify a PWM signal?
Furthermore, suppose that I would like to increase the PWM frequency. For instance up to 2.5kHz. in this case the PWM period should be 380 micro seconds. considering 1.5 over 380 the the slew rate still seems acceptable to me.