# How to reduce the amplitude of my PWM signal?

I'm using a PWM control signal that ranges from 0-24V to drive a stepper motor. However, the datasheet in the driver says it should range 0-5V.

How can I bring down the amplitude of my PWM control signal? Would I use a 5V regulator or does a potentiometer make more sense? If neither of these, then what?

• Where does your 24V PWM signal come from? Commented Feb 6, 2015 at 23:27
• Is the 24 V signal just a control voltage for some driver chip/module, or is it the actual power output for the motor? Commented Feb 7, 2015 at 3:54

Not the voltage regulator. That will try to give a constant voltage at the output, but PWM at the input won't allow this. Anyway, the regulator won't work, but your PWM signal will be lost.

A potentiometer will work, and allow you to vary the output level, but if you know what level you want (5V) then a resistor divider is cheaper. 3k9 for the higher resistor, and 1k for the lower one will give you 4.9V. Both values are E12, so they are more common that the values Nick suggests.

edit
Nick suggests higher resistance values, like 39k and 10k. Lower values mean less susceptibility to noise and other disturbances, and if you're working with stepper motors you can afford the extra few millis; the stepper motor will consume a lot more.

• They'll also waste 5mA; I'd suggest multiplying the values by 10, assuming the PWM is in the kilohertz range. Commented Feb 6, 2015 at 11:43
• @NickJohnson: if you're driving stepper motors anyway, then 5 mA won't matter much. Commented Feb 7, 2015 at 9:20
• Perhaps not, but why waste power when you don't need to? Commented Feb 7, 2015 at 17:34

You can simply use a resistor divider for this - feed your PWM signal into the top of the divider, and take the 5v signal from the center.

A resistor divider with a 10k resistor on top and a 2.61k resistor on the bottom will give you 4.96v out for 24v in.

• It might be worth noting the 2.61K resistor is a 2% (E48 series) value. Commented Feb 6, 2015 at 11:22