3.1 - One wire PWM

Submitted by Webbot on October 30, 2008 - 5:04pm.

This mode uses a single PWM output pin (default is port B2). The PWM is set up to oscillate at an inaudible frequency. The volume levels 0 to 15 are then used to change the duty cycle between 0 percent and 50 percent.


The electronics to decode this signal are made fairly complex. First we use a low pass filter to filter out the high pitch carrier frequency. We then use an audio amplifier to amplify the resultant signal. I have included a potentiometer/trimmer as a volume control. If you set the volume too high then you may well get all sorts of squeal !!!. You could use a breadboard to find the best setting of the trimmer and then replace it with fixed resistors.


To activate this mode you need to edit global.h and make sure that the line:-

    #define _AVR_PWM_
    is not commented out. You cannot change the port without digging around in the code a bit and requires you to understand how to change the AVR registers for the different PWM modes.


The attached Eagle schematic shows you how to create the circuit:-



pwm driver.sch247.16 KB
pwm driver.brd14.2 KB