# How do I step down a 12V pulse width modulation signal to 5V?

I want to control my new laser module from my repurposed 3D printer. The laser module has a 12V pin for power, a ground pin and a 5V PWM pin. My board's fan-control port can generate a 12V PWM signal, so I think I should convert it to 5V to control the laser's power.

Are there any special considerations when stepping down PWM signals? I'm worried that a linear converter's capacitors might smooth out my signal or that a buck converter could do something similar. Should I just use a resistor?

• you wouldn't use a regulator to drop the signal voltage. A resistor divider should be sufficient. May 15, 2021 at 12:36
• What's the PWM frequency? How long is the connection between the board and the module and is it shielded? What are the output and input impedance? May 15, 2021 at 13:44
• Is your 12V pulse a signal? Or is it meant to power something? If just a signal, use a voltage divider, i.e. 2 resistors. May 15, 2021 at 17:50
• @Reinderien Sigh, I'm afraid I don't have the tools to measure any of those values. May 15, 2021 at 18:05
• You don't have a ruler? May 15, 2021 at 18:06

Your 40cm long, likely unshielded, possibly non-twisted wire connection is prone to noise. Depending on a large number of factors, this may or may not be a problem. A level-shifting Schmitt trigger with some basic capacitive filtration and Schottky protection diodes will help:

simulate this circuit – Schematic created using CircuitLab

This depicts the translation levels before enabling the capacitor:

This depicts the effect of the filter cap. It's crucial that you understand your PWM frequency and minimum duty cycle before adding this.

If what @BruceAbbott suggests is true and your PWM frequency is 25 kHz, then (depending on expected duties) your transients with a 200pF cap could look like

I would suggest using a bi-directional level shifter, they are inexpensive, apparently less then unidirectional modules and are readily available. They are not that expensive and the parts are already soldered to a PCB. There are a lot of different ones available. Try searching for"level translator arduino 12V 5V" There are many types and sources available for them. If you want to build it yourself consider using a MM74C914 hex inverter, it will take 25V on its inputs. Simply connect two in series. You are correct capacitors in the circuit will definitely mess up the PWM signal. Be sure to ground the 4 remaining inputs and leave the outputs open.

• Cool. Another user suggested using a resistor, is there any reason why that would be a bad idea? May 15, 2021 at 18:12
• If the 5V input has a high and constant impedance (I assume that it does, but double check in the documentation), a voltage divider (which btw consists of two resistors, not one) should work fine. en.wikipedia.org/wiki/Voltage_divider Be mindful of what resistor values you choose; Too low R and unneccesarily much power is converted to heat, too high R and your PWM signal will be more susceptible to noise. May 15, 2021 at 18:23
• To many unknowns to properly size it. See Dampmaskin's comment, he names a few. Also I have no idea of your skill set and resources available to you.
– Gil
May 17, 2021 at 21:55