Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer

I'm pretty sure that the only way to get PWM from this circuit is to have different charging and discharging rates for the capacitor C. You can change the operating frequency by R2 as you described, but you don't get duty cycle control.

Usually, you need two elements to make PWM - one to control the overall period, the other to control the on-time and off-time. You get this sort of configuration easily if you opt for a 555 timer-based PWM, which internally is two comparators with a latch and some other glue. You can get good duty cycle control with this approach, 555s are common, and the parts count is reasonable.

share|improve this answer
Thanks for the link. – D Brown Nov 1 '11 at 15:05
2  
The same basic circuit given in the link should work without the 555, using just an opamp. Just make the trigger and threshold inputs the opamp negative input, and take the output to the R1 / diode configuration from the op amp output. The 555 has the advantage that it doesn't need a bipolar power supply because it has two comparators. – Bitrex Nov 1 '11 at 17:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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