Electronics with passion: amplifiers and power supplies, FET's and vacuum tubes..
audio

100KHz square wave generator for testing audio amplifiers

 

[Читать на русском]

The musical signal's form does never resemble a square wave. The frequency range perceived by an average adult hardly goes above 17KHz. Hence I do not give a dime to those heated discussions whether it's appropriate to test audio amplifiers using a 100KHz meander signal. But being an electronic engineer in my heart as well as by education and passion - I can assure you that giving an audio amplifier a try with 100KHz square wave test signal can reveal quite some technical qualities (or lack of those) in the design. Overshots caused by negative feedback loops or signal slopes formed by input/Miller capacitances are amongst things that are easier to observe with meander than when using sound-frequency test signal.

  • Wasn't it too complicated?

Before turning to the true and tried CMOS 555 I tested several oscillators based on old soviet К561ЛА7, К561ЛН2, as well as 74HC04 and 74HCT04; the last unsuccessful attempt was made using LM555. All the attempts listed above have failed due to the horrible ringing the chips were generating at its outputs. The current spikes in the power line were also quite hard to tolerate. Therefore I came up with only two budget solutions:

  1. Use a low-bandwidth scope so one does not see high-frequency oscillations (it's a joke)
  2. Utilize CMOS version of 555
  • CMOS 555

Important: in this design only a quality CMOS variants of 555 timer should be utilized. For example: TLC555 datasheet by TI.

To my taste here is one of the most clear representations of what ticks inside 555:

Block-diagram of CMOS 555 timer
  1. GND - Ground
  2. TRIG - Trigger
  3. OUT - Output
  4. RESET
  5. CONT - Control voltage
  6. THRES - Threshold
  7. DISCH - Discharge
  8. VDD - Positive supply voltage

People who love micro-controllers may start laughing at me here. Honestly I was also tempted to build a universal square wave generator based on ATmega-8 that I had at hands. But somehow I am too lazy to program when the same result can be achieved by a comparable amount of soldering without turning on that annoying thing (computer ;). And to tell you the truth I strived to have as minimal of those high bandwidth current spikes as possible - in order to test quality audio equipment I wanted to have a quality test signal as well. Regardless the fact that the generator's bill of materials amounted for just a few bucks.

  • The simpler the better

While publishing this pretty trivial design I still hope that it may help some good people to save time on experimenting with more noisy alternatives. 

Square wave test signal generator
  • C1 = 1 nF
  • R1 = 6.2 kOhm
  • R2 = 1 kOhm
  • R3 = 300 Ohm
  • R4 = 5 kOhm
  • C2 = 1 uF
  • C3 = 10 uF 25 V
  • C4, C5 = 0.1 uF

Obviously testing audio amplifiers with the test signal well centered relative to the ground is very convenient. On the other hand adding DC shift helps to qualify how well the servo-circuitry works - the one that is responsible for assuring the steady zero DC at the output. Thus having a choice between "open" and "closed" output was a good thing to build in the test signal's generator: just install a switch or a "jumper" that would short C2.

  • Why restricting ourselves to single frequency?

In theory the generator's frequency can be calculated as follows:

f = 0.72 / (R1 * C1)

However in the reality the obtained frequency tends to be lower, especially at the higher end of the generator's range.


Once I heated up my soldering iron I did not want to stop with a single 100KHz frequency. By adding a simple line of DIP-switches and few extra capacitors and resistors we are able to cover pretty wide frequency range.


I settled on the following set of R1 and C1 switchable substitutes:

  • C1: 1 nF, 10 nF, 0.1 uF, 1uF
  • R1: 2.2 kOhm, 6.2 kOhm, 150 kOhm, potentiometer 220 kOhm

That gives us a convenient choice of generated frequencies:

  • 250 kHz - 1 nF 2.2 kOhm
  • 100 kHz - 1 nF 6.2 kOhm
  • 30 kHz - 10 nF 2,2 kOhm
  • 10 kHz -  10 nF 6,2 kOhm
  • 3.1 kHz - 0.1 uF 2.2 kOhm
  • 1.1 kHz - 0.1 uF 6.2 kOhm
  • 465 Hz - 10 nF 150 kOhm
  • 46 Hz - 0.1 uF 150 kOhm
  • 4.5 Hz - 1 uF 150 kOhm

Of course the frequency values are very approximate, it depends on the used components variations.

  • Test assembly

The finished generator circuit can be fed from 4 AA batteries or a simple wall-brick. I strongly suggest you staying away from switching power supplies here and use an old good low frequency transformer. Since I like good CMOS 555 a lot - I added the reverse polarity protection to this design.

Square wave generator with selectable frequency

 

 

Kynar wire "web" routing - inexpensive and quick

 

Left mouse click on pictures will show them full-size

  • Waveform - it's SQUARE
The result: square "wave" signal

17 Comments

  1. Елена

    Ценная информация для целевой аудитории.

  2. michel

    This schematic looks strange (or at least unconventional)
    Where has gone pin 7 (discharging) normally attached to R1 R2 node?

    • serge

      Thanks Michel for the comment. You’ve got a good eye!
      I do like unconventional solutions 😉
      Here we use 555′ output (pin 3) to charge and discharge C1. Hence pin 7 remains unconnected.

      • michel

        I have tried it.
        100khz is nice but only at full swing. Using the pot to attenuate rounds it.
        Have tried a follower between output and pot but it is getting worse.
        May be an inverter at this place?

        • serge

          That’s the load’s capacitance that rounds the signal after the attenuator. Certainly there are few ways to improve on that.

          1) Leave with that – just assess how much does it impact your measurements (that was the resolution I used in my own tests)

          2) Reduce the attenuator’s impedance

          3) Use a repeater _after_ the pot. Start from a simple follower. Then… I am not kidding, this little design can be very helpful here: http://myelectrons.com/hotfet-j-fet-preamp-schematics/

          A digital inverter will ring inevitably. And it will not help on attenuating the amplitude. Thus I would consider using any digital rig here as the very last option.

    • Moristo

      You are right friend, Pin 3 is the output only, IC 555 no need feedback from output. So between R1 and R2 is Pin 7

      • serge

        Hi Moristo, thanks for chiming in!
        I stand correct, the schematic is showing the right pin numbers.
        Pin 7 is discharge only. Hence it’s difficult to form a 50% duty cycle signal while using a “standard” 555 oscillator schematic.
        Pin 3 is a push-pull output. In case of a CMOS chip that gives us nearly perfect Vcc and Vdd, hence we can get a square wave easily while using the output pin for feedback.

  3. michel

    Thanks for the infos.
    I got it working nice lowering R4 pot to 1K and adding a follower in front of it.I also had to lower R2 to 500 ohms to get T1=T2.
    Nice circuit.
    I also built a generator using XR2206 but it’s 100khz square wave is not so nice.

  4. Michael Yonus

    Hello, I very much like this circut and eager to get started with the switchable substitute version right away. Is there anywhere I can print out the final scematic as to not make any visual mistakes? I am a novist when it comes to deciphering layout. And would probably could use a backup plan to insure that u use the correct components and wiring. Thank you in advance to your generous contribution to my education and testing bench. If there is any way to donate a monetary contribution to your cause, let me know.

    • serge

      Hi Michael and welcome!
      Sorry I could not provide you with layouts nor a DIY kit yet. It’s on my to-do list, but other priorities were taking over my time so far.

      I believe this particular schematic, while delivering quality signals, can still serve as a good start for beginners too. I suggest you get your hands dirty with electronics and sketch it one way or another. If in doubts – please do not hesitate to send your drawings so I could verify them for correctness etc. Just drop me a note at: patrushin [at] gmail . com
      Cheers,
      – Serge.

      P.S. appreciate your offer for donation! Honestly I publish things here for everyone for free. Let’s keep in touch and hopefully collaborate. Who knows what cool little business can grow out of this in the future 😉

  5. Renalto

    I have all my amp equipment set up but im uporendwering my subs until my new amp comes in.. my question is my headunit has a sub setting of -10 to +10 is it best to leave this setting at -10 or crank it up to 0 ? I have two 12 hifonics subs 600 watts rms each but a cheap leftover amp i had on it now only getting 150 rms each to them

  6. Jidis

    Hi Serge (and thanks for the circuit!)

    Etched one of these yesterday and it seems to be working well. I did the full one with the switches and all. The lowest three settings don’t produce a very clean square, but I’m not sure I’ll be needing them. At the 465Hz one, the wave tops begin to slope, and by 4.5, it makes a strange looking curved ramp. Are yours still relatively square down there?

    I also may etch it again later as I left out the attenuator pot, and would like to try Michel’s solution on the changed values and follower circuit if I can figure it out. If you ever get time to throw up a sketch of an “enhanced” version, that would be great.

    Take Care

    • michel

      This is a quite old story to me. If i remember well i got acceptable results at 100khz adding two transistors between the output and the potentiometer. (Sorry,I can’t find a way to post a schematic there).
      Then i built several generators using 2206 and Max038. The loading problem i encounterd with every generator circuit (square wave deformation when moving the potentiometer) was perfectly solved only when using an AD811 video amplifier as output. High slew rate, wide bandwidth, low Z output, non inverting configuration.
      I wanted a clean 100khz.

      • Jidis

        Thanks Michel!

        It sounds like your requirements are a bit higher than mine. I haven’t yet decided what frequency range I’ll actually need, so I may be able to get by with the output I’m currently getting. I think what may end up being more of a problem than the “sub-maximum” attenuator setting is what it does down below 1kHz. I don’t really get the cleanest squares down there, but I’ll try to play around and see why that is unless someone can verify that they do in fact lose their shape down in that range.

        Take Care

        PS- I’ve also been wondering for a while what sort of output people get from those cheap microcontroller based function generators that are all over eBay these days. They seem to pack a lot of functionality for their size and price, but if the output is sloppy, I don’t guess it would matter.

  7. Professor

    AMAZING! Your assistance requested fine sir!

    Just this evening I fed a 7.83Hz square wave signal into a stereo audio class D amp, and I was amazed to see a square wave on the oscilloscope screen! I thought these amps only worked with sine waves. really cool, but it did not function for my purposes. So I sent the amp back to the vendor.

    I have a need for the following circuit device,.

    Basically a 30KHz square wave generator that outputs 50 watts RMS. Also a variant that outputs 100 watts RMS would be nice.

    I need it to be battery powered if possible.

    Your assistance is greatly appreictaed. Email me tthe solution please!

    Much thanks!

    • Serge

      Hi Professor, welcome to MyElectrons!

      In order to define output power of a signal source we have to know the load impedance. For example: 50W RMS into 8Ohm load (a typical loudspeaker) would require 20V RMS, or nearly 30V peak output. The same time 50W into 1Ohm load would require a mere 7V.

      For a square wave RMS voltage would be equal to its peak voltage. Hence if one only needed a square wave output at a given power – I would suggest simply taking a half-bridge and be done with it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.