A simple PWM generator based on a 12F675 PIC microcontroller.

This project produces a square wave of variable frequency and duty. The frequency goes up to a few kHz, and down to visible blinking speed. The duty has a very limited resolution at the high end of frequency range. Both duty and period (or frequency) are set with pots.

Circuit diagram

Non-5V operation

The normal output is a square wave at 5V. There is also provision for a higher voltage output (eg 12V) when jumper J1 is in place and the higher voltage is supplied at HVin. The higher output is then available (inverted) at HV PWM out. If this voltage is at least 7V then this can also power the PIC via 5V regulator U2 and diode D2.


The source for the PIC firmware is released under the GNU GPL version 2. Download source .

The hex file built from the sources: pwmgen.hex