This is a demonstration how to convert a Voltage ionto a PWM signal.
The trick is to compare the voltage (orange) to a triangle signal (green) using a comparator (output is blue).
The 1kHz generator inside the actual signal generator (both upper OPA) is necessary to get the simulation going. In reality, you can replace it with a piece of wire.
This circuit is useful to digitalize analogue voltagesThis can be used to allow a microcontroller read analogue voltages by timing the duty cycle of the PWM and/or to protect a weak sensor signal from EMI.