I'm trying to convert a linear voltage to a 21kHz PWM signal using passive and active components.

Do you have any idea how I can achieve this ?

I tought about comparing my linear voltage to a sawtooth signal at 21kHz with this scheme:

enter image description here enter image description here

but making this signal with passive components is really hard and not accurate.

I can use any comparator, amplifier etc..

  • 2
    \$\begingroup\$ In that case: check electronics.stackexchange.com/questions/378517/… \$\endgroup\$
    – Huisman
    Commented Jun 18, 2019 at 10:33
  • 1
    \$\begingroup\$ Search internet on "ic voltage to pwm": TL594 or https://www.ti.com/lit/ds/symlink/tl5002.pdf \$\endgroup\$
    – Huisman
    Commented Jun 18, 2019 at 11:23
  • \$\begingroup\$ "I can use any comparator, amplifier etc." -- homework? I believe you're defining a transistor as a "passive component". Transistors are considered to be active. I believe you're confusing "passive" (i.e. it can't amplify) with "discrete" (i.e., there's just one thing in the package). \$\endgroup\$
    – TimWescott
    Commented Jun 18, 2019 at 15:05
  • \$\begingroup\$ Resistors, inductors and capacitor are passive components. Comparators and amplifiers ARE NOT passive components. \$\endgroup\$
    – Andy aka
    Commented Jun 18, 2019 at 15:11

1 Answer 1


Yes, basically make a sawtooth and feed that to a comparator. The venerable 555 can do this, although rather crudely. See here: https://www.falstad.com/circuit/e-555pulsemod.html

The key to making a good sawtooth is to use a current source to charge the cap. This makes the linear ramp, improving the accuracy of your PWM.

Another way to make a PWM modulator is to use a square wave generator followed by an integrator fed into the comparator. Example here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/4362. However I foresee issues with that approach in getting the DC offset right - always a problem with integrators.

You could ‘cheat’ and use a microcontroller to sample the analog waveform and convert that to PWM via software. I suspect that’s not the point of this question.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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