Electronic – the simplest way to generate PWM without a Microcontroller

pwm

What is the fast and elegant way to generate PWM without a Microcontroller to control a servo motor? With potentiometer or other ways to control the duty cycle with fix period.

  • sorry about the mess, I want to control a hobby servo.

Best Answer

I recommend the (GASP!) 555 Timer in "astable" mode. You'll find everything you need in the link, but I copied them here just for you!

Astable mode gives you a variable PWM frequency, and allows for an adjustable duty cycle as well (high-time and low-time equations in the link).

The circuit:

555 Timer, astable mode

Note: I'd add an electrolytic cap across Vcc (positive lead) and GND (negative lead) to reduce the effect of dips in power supply voltage.

The PWM frequency:

Output frequency of 555 Timer in astable mode

Some defense for my answer compared to others in this post. Most other answers require an intermediate waveform to generate a variable PWM signal, such as the common triangle wave/comparator method. I don't see much point in constructing triangle wave generator (a significant circuit in-and-of itself) just as an intermediate step to solve your problem.

The 555 is a great analog chip and does just what you need. I wish people didn't hate on them as much.