# Amplifying a PWM signal with an op amp. Is the slew rate a problem?

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.

• Why do you need 24V to drive a MOSFET? You can use the 5V signal directly with a 'digital' MOSFET. (low gate turn on). Changing the frequency is something you do at the MCU when you generate the PWM. Commented Apr 3, 2017 at 10:44
• As said @JImDearden, MOSFET is more suitable for such amplification. Unlike op amp, there is litter slew rate and almost no delay Commented Apr 3, 2017 at 11:40

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:

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!

There are several things wrong or confused here:

1. 24 V is very high for a MOSFET gate. These are usually specified to switch fully with 10 or 12 V. 24 V might be the absolute maximum, not what it's intended to switch at.

2. A TL071 is totally inappropriate here. Those need several volts of headroom from both supplies at both the input and the output.

3. Typical specs are meaningless.

4. Use a FET driver. Driving a FET gate from a digital signal is exactly what they are for.

5. Depending on the motor power supply voltage and the motor current, you might be able to use a FET that switches nicely with just 5 V on the gate. If the motor is powered from 30 V or less, then something like the IRLML0030 would work. You just connect its gate directly to the digital output.

6. 500 Hz is probably fast enough for the motor to mechanically filter the pulses. However, there will likely be audible whine, and the current will probably change significantly during the on and off time of each pulse.

Even if you don't care about the whine, having a steady current matters. Think of the current thru the motor broken into its DC and AC components. Only the DC component moves the motor. The AC component does nothing useful, but still causes heating due to the resistive component of the motor coils. In short, the less AC component, the more efficient the overall motor drive is.

• The OP has not stated what their MOSFET circuit is, so how can you say 24V is high? You're presuming it has a grounded source instead of asking OP. Commented Apr 3, 2017 at 10:52
• @Tony: True, but no justification has been given for a high side switch. If that's what the OP is thinking then considering a low side switch is another issue. I see we both got downvotes, so apparently we didn't tell the OP what he wanted to hear, LOL. Commented Apr 3, 2017 at 10:55
• @Olin Lathrop On 1) I thought of using, of course, a mosfet that supports 24V on the gate. Sorry I've not stated that in the question. 2) Could you please elaborate a bit more on the headroom problem? 3) Yeah, ok, but I should start somewhere shouldn't I? At least the order of magnitude seems a reasonable start. 6) That's why I thought of raising the frequency and was a bit worried about the slew rate. Commented Apr 3, 2017 at 10:57
• @Olin Lathrop I did not downvote anyone, I take all the answers, good or bad. I'm here to learn, negative and positive feedbacks are both equally welcomed (no pun intended) Commented Apr 3, 2017 at 10:59
• This has now received two separate downvotes. Whoever you are, it would be useful to explain what exactly you think is wrong, badly written, or misleading. Given the sparse information from the OP, all these still look like valid points to mention. Commented Apr 3, 2017 at 11:41

What you have analysed and concluded looks fine, good work.

You should put a resistor between the op-amp output and your FET gate. Without it, the op-amp has the capacitance of the FET gate on its output which can cause it to oscillate. I can't say the resistor value without knowing the FET's gate capacitance. However, you usually find values around 470 R or 1 K typically used so I imagi

• Did not think about the resistor between op amp and gate. Noted, thanks. Commented Apr 3, 2017 at 11:05

Is there any other consideration I should do?

Gate drivers are generally a function of the switchers you intend to drive. The most important factors there are current capabilities, frequency limits, and drive topology.

Very rarely you see an linear amplifiers used here. Google gate driver may help you get more insights.

You can amplify a PWM without inverting it with a Schmitt-Trigger.

Image Source: The Art of Electronics (Horowitz, Hill)

You can change the Supply Voltage (here 5V) to the voltage you want the PWM to be. For example with a voltage divider.