Step Down 12V PWM Signal to 5V – How to Guide

pwmttlvoltage-regulator

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?

Best Answer

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:

schematic

simulate this circuit – Schematic created using CircuitLab

This depicts the translation levels before enabling the capacitor:

translation

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

fast filtration