1
\$\begingroup\$

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?

\$\endgroup\$
10
  • 3
    \$\begingroup\$ you wouldn't use a regulator to drop the signal voltage. A resistor divider should be sufficient. \$\endgroup\$
    – Kartman
    Commented May 15, 2021 at 12:36
  • 2
    \$\begingroup\$ 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? \$\endgroup\$
    – Reinderien
    Commented May 15, 2021 at 13:44
  • 3
    \$\begingroup\$ 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. \$\endgroup\$ Commented May 15, 2021 at 17:50
  • \$\begingroup\$ @Reinderien Sigh, I'm afraid I don't have the tools to measure any of those values. \$\endgroup\$
    – Alex P.
    Commented May 15, 2021 at 18:05
  • \$\begingroup\$ You don't have a ruler? \$\endgroup\$
    – Reinderien
    Commented May 15, 2021 at 18:06

2 Answers 2

2
\$\begingroup\$

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

\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ Cool. Another user suggested using a resistor, is there any reason why that would be a bad idea? \$\endgroup\$
    – Alex P.
    Commented May 15, 2021 at 18:12
  • 2
    \$\begingroup\$ 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. \$\endgroup\$
    – Dampmaskin
    Commented May 15, 2021 at 18:23
  • \$\begingroup\$ 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. \$\endgroup\$
    – Gil
    Commented May 17, 2021 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.