Electronic – Amplifying a PWM signal with an op amp. Is the slew rate a problem

amplifierpwmslew-rate

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

schematic

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.

Best Answer

For this kind of voltage amplification, you'd typically use ... a MOSFET.

Simple N-Channel one, low-side switching with a resistor going to the positive supply voltage:

schematic

simulate this circuit – Schematic created using CircuitLab

The value of R1 depends on what you need to switch on the outside.

This is in fact an inverting circuit, but that really doesn't matter – most MCUs can simply set the polarity of the PWM, or you can just logically invert the duty cycle.

Which really raises the question why you think you'd have to raise the gate voltage of the MOSFET you're trying to drive!