Saturday 6 August 2016

What is the simplest way to generate PWM without a Microcontroller?


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.




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.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...