Making a low frequency rectangular-wave oscillator
from Aug.20 2006 to Aug.26 2006

After making the first headphone amplifier for my friends, this amp was a variation of PRR's Tori Amp with BJT output stage, I decided to mod my sign wave oscillator and to make a rectangular wave oscillator before making a headphone amplifier for myself. There are many ready-made oscillator available at less than 30,000JPY and DIY oscillator may cost even or more, I picked DIY expecting it will give me more fun and knowledge.

By google, I found many examples (like this site) making rectangular oscillators using 4069UB CMOS logic IC, and I simply followed these samples. Here is the close final complete schematics of my rectangular-wave oscillator.

fig.1 Schmatics of rectangular-wave oscillator. 4069UB is powered by +5VDC, TL074 is powered by +/-15VDC

I installed three identical (except two caps and one resistor) circuits and switch the outputs signal to select the frequency. Very simple. My purpose is to determine the DIY audio equipments for my private use, so I picked three frequency - @20Hz, @1kHz and @20kHz. Amplitude of output signal is also optimized fo rmy usage, fixed to 2V peak-to-peak. Output Z is set to 150ohm instead of popular 600ohm, simulating most of commercial pre-amplifier or CD player's output stage.

Let's back to what I did.

fig.2 Testing a 4069UB oscillating

My original idea was to use potentiometer and to get continuous frequency control, but soon I found it is rather difficult to cover 20Hz to 20kHz only by single potentiometer, so I switched to make three frequency oscillator using all (six) inverter in 4069UB.
A coil, a ferrite, an OS-CON and two blue ceramic caps are to (try to) reduce switching noise of power source (+5V) - off the shelf switching power supply capable providing +/-15V and +5V.

Other caps are:
- 910pF mica cap for oscillating @20kHz
- 10nF film cap for oscillating @1kHz
- 0.1uF film cap for oscillating @20Hz

fig.3 Another picture. Power source behind, testing output circuit at front - on breadboard

fig.4~6 Oscillated signals @20kHz/@1kHz/@20Hz w/open load

fig.7 Output stage for test

Output stage is a voltage follower using TL07x. At first, I put coupling capacitor to the output of opamp, and found I need several hundreds uF cap to get clean rectangular wave for heavy load, such like 600ohm. Below pcture shows @20Hz output signal for 1kohm load via 1uF coupling C.

fig.8 @20Hz output signal for 1kohm load using 1uF output C

At my initial trial, coupling cap between 4069UB and output buffer does not work well - DC remains.
I looked at my initial simpler schematics for a few hours, tried to imagine what electrons feel and behave, and finally it came to my mind, needs of a shunt resistor at the output of 4069UB.

fig.9 Additional shunt resistors (47kohm) on the pattern side of the board

Input Z of output stage is rather moderate than 600ohm (it is around 100kohm), and I found following coupling caps provide good wave form for each frequency.
- 0.1uF @20kHz
- 4.7uF @1kHz
- 22uF @20Hz

fig.10 4069UB and output buffer using TL074. 3 amps out of 4 amps in TL074 are used
Coils and larger electrolytics at the right hand side are for (trying) reducing noise form power source.

Casing is always the most tough in DIY.

fig.11 Big, expensive off-the-shelf switching power supply (+/-15V and +5V) may be too much for this circuit

fig.12 Not bad

I did not notice any problem in my oscillators output signals, but my brother in law (video electronics engineer) saw the wave form and pointed me that I'd better to add some phase compensation into the output stage to improved thru rate, to get cleaner wave. I copied some values from the schematics of QUAD34 pre, and got this.

fig.13 Final schematics with phase compensation at the output buffer

fig.14 Installation of caps and Rs for phase compensation (Green electrolytics are for bypassing power supply of opamp)

It was interesting for me to make oscillator. Price performance may be worse than ready made oscillator, though, minimized user interface is quite usefull for my purpose, at least.
In addition, good thing for me was that I really realized the frequency we can get from 1/2piRC has almost no realation if the system can transfer good shape rectangular wave or not. At 20Hz, even for 100kohm load, a few 10uF coupling C is needed for rectangular wave.

Another important thing I got from this oscillator came to me after I checked my prototype headphone amplifier, one Tori Amp type and one simple OPA132 amp. Both can amplify rectangular wave from 20Hz to 20kHz very cleanly. I can say the shapes of the waves from these two are almost identical, while I can enjoy music by Tori Amp and the sound from simple OPA132 is just tiring me. Maybe I can check minimum performance of the audio amplifier by this oscillator, while I cannot get any information about sound performance of the amplifier using this oscillator.

Sep.5 2006