Electronic – Getting PWM with an astable multivibrator (square wave generator)

operational-amplifierpwm

I would like to use this schematic:

enter image description here

to create a square-wave generator but I would like to modify it by getting an output that runs from 0 to +5V, as well as changing the signal so that I can change the duty cycle of the pulse(PWM).

Should I replace the resistor R2 with a variable resistor so that I can get the PWM signal? If not, what would be the correct approach?

Best Answer

One way to vary the duty cycle would be to remove R1 and connect a potentiometer track between V- and V+ with the wiper connected to R2/non-inverting input of the comparator. With the pot at mid position you will get 50% duty cycle but this will only be very roughly linear for small changes in position of the pot. Also, the frequency will reduce as you move the pot either side of mid-position.

Note that if you want single supply (5V) operation with the original circuit as shown, R1 would have to be returned to 2.5V rather than 0V.