LTspice PWM Signal Generator

Published: Jun 16, 2021 by James K

This is a fairly simple post, but useful nontheless. I was designing a constant current source for a string of Luxeon LEDs, and the driver that I was using can take a PWM signal to control the dimming. I was simulating in LTspice, and needed a way to create a PWM signal.

The solution is baiscally a sawtooth wave, and a comparator (which is actually performed by a Schmitt trigger, with no Schmitting at all, i.e. no hysteresis). It has been parameterised, and packaged up into a component that can be dragged into a circuit.

Main circuit of the PWM generator

Example usage of the packaged PWM component

Three PWM signals generated

Check it out on GitHub.

Share

Latest Posts