top of page

CMOS multi-waveform generator

Anyone who has done any considerable amount of repairs and troubleshooting knows the importance of having a signal generator. For audio circuits, at least in my experience, this doesn't need to have particular requirements, neither in terms of frequency precision nor distortion, as long as it gives something to visualize on a scope; large output amplitude isn't that necessary either, even if nice to have.

This is why I've managed so far with a simple phase-shift sine generator made from two transistors and housed in the shell of a broken DC wall wart, with the output available from the former mains prongs. It was fun to use, but distortion was awful (~4%) and it stopped working if the supply voltage dropped too much, an issue with battery power. 4% might seem like a lot of distortion and it is, but the output still looks sinusoidal enough on a scope.

It's also perfectly suitable to use phones or other devices capable of outputting audio as signal generators, with apps such as this one, as long as the phone doesn't output ultrasonic frequencies that aren't audible but still apparent on scope (such as my Samsung). Still, while this method gives multiple waveforms, low distortion, frequency control and even sweeps, it's still nice to have something that's quicker to setup, and doesn't have me worried about connecting it to some suspicious circuit to test (even if the phone or mp3 player is an old one).

In particular, I wanted to try using a triangle wave to better see the eventual onset of clipping, because the sharp peaks would be flattened, as I had seen in some old service manuals. That's why I had the idea some months ago, while reading through the Wireless World "Circard collection part 3"(a true treasure trove of CMOS application, already in the 70s), to combine some of the ideas presented in a circuit that could output multiple output waveforms using a single CMOS unbuffered hex inverter. Some time later, I finally put together a schematic, breadboarded it, and found it to work just as expected:

The core of the circuit is the schmitt-trigger + integrator pair formed by U1B, C and A, a classic triangle + square generator. The main addition to this part of the circuit is a trim pot that adjusts the symmetry of the output waveform (and the duty cycle of the pulse wave), as suggested in the circards, a necessary addition because the threshold voltage of CMOS inverters isn't perfectly half of the supply (but is still proportional to it).

Two output waveforms are already handled, even if the triangle output passes through an inverting amplifier made from a spare inverter, just to give it a bit more output without changing the shape of the wave and isolate it a bit more from the oscillator.

It's very easy to add upwards and downward-ramping sawtooth outputs: putting a diode in parallel to the resistor feeding the square output to the integrator, the discharge time in one direction is much faster than in the other. The frequency remains roughly the same. It's even possible to have an additional potentiometer after the diodes that varies continuously between the two saw ramps and triangle in the middle, while also varying the pulse wave width if wanted. Care must be taken that this doesn't influence the sine wave output, or the eventual fixed symmetry trim.

To generate the sine wave output, the triangle is simply passed through a multiple-feedback low-pass filter with high Q tuned close to the oscillation frequency. The sine wave is then further amplified by an inverting amplifier made by another inverter.

You might think that filtering a triangle can't give a low distortion sine wave, but actually the output of this circuit measures 1.40% with ARTA, which is lower than my expectations and much lower than the "looks like a sine on a scope" bar. You might also think that the amplifier after the filter isn't very linear and would increase distortion, but I've actually found that the distortion is lower after the amplifier, because the non-linearity further smooths out the waveform. After all, shaping a triangle wave, even if in much more refined ways, is also the basis of famous function generators like the ICL8038.

The output voltages (on 9 V) are 2.2 V for the sine, 2.6 V for triangle and saw, the full supply voltage for the square. Of course the potentiometer allows any value between 0 and those.

The frequency with the values shown is a bit below 600 Hz, but it can be anything else, by changing C1 for example (the low-pass filter must be scaled accordingly).

The current draw can be expected to be around 25 mA, because CMOS inverters used as linear amplifiers have high current draw, but that's perfectly normal and nothing to worry about.

I've messed in the past with sine generator circuits with and without nonlinear feedback elements, but never with good results. The circuits either refused to oscillate or gave untolerable distortion, with or without painful trimming. The reason I had finally settled on the phase shift oscillator was because it was actually "reliable", even if it was sensitive to supply voltage. This new circuit, being based on a triangle oscillator, is much more reliable and independent of supply voltages. I've found no measurable changes in output and distortion for a reduction of supply voltage of at least 1 V. Even on a battery with the mentioned current draw, the circuit will operate reliably for long periods of time.


The layout

If you want to make one, here's the perfboard layout I used:


The build

Since this is "bench equipment", the look is even more utilitarian than usual, with a cheap plastic enclosure and recycled knobs. The main output is the 6.3 mm jack, while the parallel BNC jack allows me to use other cables I have.


210 views4 comments

If you want to leave a comment, try to be logged in, even with a throw-away account, so that I get notified.

bottom of page