Skip to main content

Audio Function Generator with Frequency and P-P voltage display

This is an audio signal generator that does sine or square wave, operates from 20Hz to just over 30Khz, has a frequency display with 1Hz resolution, and a P-P output voltage indicator with a resolution of 100mV.

(Reproduced with the permission of the author)

This is a function generator based on the tried and true XR2206 function generator chip. It will produce low distortion sine waves or square waves at frequencies ranging from 20Hz to just over 30Khz. I also incorporated a 16F88 PIC which facilitates frequency and voltage display, so you know what is coming out of the unit at a glance.

The circuit is split up into 3 sections for simplicity -
1) The power supply - 5v and 12v linear regulated for minimum noise. The transformer only needs to be of a 3VA - 5VA rating. Anything more is overkill.
Function Gen PSU.JPG
2) The Signal Generator itself - adjust R8 until the onset of clipping (in sine wave mode) at the output, then back it off slightly. This then gives similar sine and square wave levels with minimum distortion. Note that trimpot R8 only adjusts the sine wave level, R19 is the user adjustment that adjusts both sine and square wave levels equally.
Function Gen XR2206_2.JPG
3) The PIC that displays what the unit is doing - RA0 and RA1 are configured as inputs - RA0 counts frequency from the squarewave output of the XR2206, while RA1 measures the Peak voltage from the output of the unit, via a shottky diode for minimum forward voltage drop. The rest of the circuit is the same as the digital clock(s) I published earlier, with the exception of the pushbuttons, and a faster crystal, and a 16F88 PIC instead of a 16F84A.
Function Gen PIC.JPG

I built a functional prototype of this unit onto vero-board, but in the future, I may choose to make a PCB, as the TL072 op amp that I used has a tendancy to "Ring" at higher frequencies, probably due to the layout on the vero board, however, despite this, the unit is still very useable.

I have included the code for the PIC, and a few photo's of the prototype below. Note that the display is only showing frequency, but the final version shows frequency and volts.

lidoff.jpg
botofvero.jpg
freqdisplay.jpg
sinewave.jpg
squarewave.jpg

73 once again, from Jamie, VK2TIM

Tech File Attachment: