Initial Frequency Generation

A project log for SquareTone

A hardware project that generates square waves frequencies and sums them together, Fourier style.

Adam GulyasAdam Gulyas 05/26/2015 at 09:560 Comments

Note: this log was created in 2015 and may not be valid anymore. Starting January 2016 I'm going through the design process systematically and may add or change details.

The chosen design involves generating an initial square wave and then frequency dividing it. This section talks about how to generate that initial waveform.

The easiest way I can think of to generate a square wave is with a 555 timer. Other methods would include an opamp relaxation oscillator or a comparator/integrator circuit.

Because of all the dividing necessary, the initial frequency is quite high. if I want a 1 kHz output signal, the initial frequency would have to be 1.26 MHz. That's getting pretty high, and I'm not sure if that's within the 555's frequency range.

The circuit used is shown below (image from wikipedia). Note that C is really C1.

According to "Practical Electronics for Inventors", the equation for the frequency of a 555 timer in astable mode is:

\color{White} \large f= \frac{1.44}{ \big(R_{1}+2R_{2}\big)C_{1}}

The goal here is to use this equation to find something I can change to sweep over an entire decade of frequency, say from 100 Hz to 1000 Hz, and also something I can change to switch which frequency decade I'm sweeping over. The easiest implementation was to change C1 by an order of magnitude to jump decades and then vary R1 or R2 with a pot. After using excel for a bit, it was found that it was better to vary R2 in terms of component values needed versus what is available on digikey. Another thing to keep in mind is that frequency controls usually have course and fine adjustment knobs. This translates into R2 being composed of two pots, one ten times larger than the other. This produces some weird maximum resistance values for R2, like 1100 Ω or 550 Ω. Also, there needs to be some small constant resistance added, to ensure R2 does not reach 0 Ω.

I wanted the frequency ranges to overlap a bit so I could be sure of covering every frequency. For a given decade, it seemed like [0.8, 12] would be a good range to cover.

The frequency division network divides the input frequency by 1680 to produce the fundamental harmonic. This means that whatever the initial frequency is, it is divided by 1680 to arrive at the output frequency for the device.

With all of that in mind, I played around in excel until I found component values that met my needs:

C1a = 900 nF, C1b = 90 nF, C1c = 9 nF, C1d = 900 pF

R1 = 68 Ω

R2 = 500 Ω pot + 50 Ω pot + 5.6 Ω

The figure below shows the overlap of the frequency range. Each line is a different capacitor value, with R2 being swept over its resistance range.

Note that the above figure shows the frequency after the divider network, not the frequency output by the 555 timer. The maximum value of the initial frequency in this design is 20.2 MHz. I'm pretty sure that's way too large, but let's give it a go anyways.


I assembled the circuit on a breadboard:

It didn't oscillate. I found that R1 was too low. Modifying the design a bit, I multiplied both R1 and R2 by 5 and divided C1 by 5. Lucky, the necissary components seem to be avaliable on digikey. New values are:

C1a = 180 nF, C1b = 18 nF, C1c = 1.8 nF, C1d = 180 pF

R1 = 340 Ω

R2 = 2500 Ω pot + 250 Ω pot + 27 Ω

I tried these values and found that they weren't behaving nicely. So. instead of fooling around with it anymore, I'm going to move to a relaxation oscillator circuit, shown below. I've built this circuit a few times and am confident I can get it to work.

To explain it briefly, R2 and R3 control the value to which C1 has to charge before the output polarity is switched, and R1 controls how fast C1 can reach that value.

It needs a dual rail power supply, so I will be splitting 5 V using the ever useful TLE2426.

Wikipedia gives its output frequency formula as:

\color{White} \large f= \frac{1}{2ln\big(3\big)RC} Their derivation set all the resistors equal when they don't have to be. All the resistors can be different, as long as you keep in mind how changing the voltage division ratio affects the circuit.

After some excel, I found the following values gave the desired [0.8, 12] frequency range for a given decade:

C1 = 12nF

R1 = 25 kΩ pot + 2.5 kΩ pot + 2.2 kΩ

R2 = R3 = 100 kΩ

With a range of R1 of [2.2, 29.7] kΩ , the frequency range is [1.28, 17.2] kHz. After dividing by 1680 for the division network, it comes to {0.76, 10.26] Hz. To get decades other than the 1 Hz, I will increase/decrease C1 by an order of magnitude.

I'm partial to the TL072 op-amp, since I've seen it everywhere in synth schematics.


I tried 4 different capacitor values and found the R1 value which made the circuit oscillate at 1.34 kHz and 20.16 kHz. (The values for a frequency of 0.8 kHz and 1.2 kHz after the divider network.)