Sine wave tone generator

Started by jfrabat, August 12, 2020, 06:41:57 PM

Previous topic - Next topic

jfrabat

Hi, guys.

I am looking to make a sine wave tone generator to test circuits.  In the past, I have used the ToneGen app for Android, but my phone no longer has an audio jack, and now my new tablet is missing one (the old one still works, but I figured I would prepare in advance for the inevitable!).

I first thought of trying it with an Arduino, which I have more than a couple in stock, but I could only get a square wave out of those without buying extra parts,s o I decided to keep the Arduino out (I have to admit, the OLED screen telling you the frequency is pretty cool, though!).  I also looked at options with the 555 timer, but those make selecting a frequency kind of a hazzle.  I also made a quick breadboard with a Wein bridge oscillator using a dual gang pot with a TL071, but that did not work as expected (I am getting nothing if I connected to a small amp).  Just in case anyone is interested in educating me as to why that did not work, though, here is what I did with that:



Please excuse the horrible schematic and hand writing; I did that on my phone!

Anyway, as of now (AND THE MAIN QUESTION IN THIS POST!), my first choice is to build Valve Wizzard's Signal Generator, but I wanted to verify something before breadboarding...  It says that LDR1 is > 100K; I have some NSL-32's, which are 500K.  I should not have any issues by using these, right?

Thanks!
I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).

GibsonGM

A quick and easy way to get a test sine tone...is R.G. Keene's "Quick and dirty osciallator" at GEOFEX (link up top or search net). That'll get you running, and if you want a more formal and nice (!) piece of equipment, Merlin's is great...just more of a build than you might need...

  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

jfrabat

Quote from: GibsonGM on August 12, 2020, 07:12:21 PM
A quick and easy way to get a test sine tone...is R.G. Keene's "Quick and dirty osciallator" at GEOFEX (link up top or search net). That'll get you running, and if you want a more formal and nice (!) piece of equipment, Merlin's is great...just more of a build than you might need...



That is not a horrible option, but I was thinking more along the lines of Merlin's simplified version.  But one thing I could not figure out is where is the LED connected to...



Keep in mind this is not the same as the schematic, so I am not sure what is what...
I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).

Rob Strand

#3
Quotequick breadboard with a Wein bridge oscillator using a dual gang pot with a TL071, but that did not work as expected (I am getting nothing if I connected to a small amp).  Just in case anyone is interested in educating me as to why that did not work, though, here is what I did with that:

The reason it didn't work is your circuit needs a +V and -V supply with grounds connected to 0V.   To get a single supply versions running you need to bias the opamp.

The simplest case is to only bias the RC network like this,



For a 9V supply Vref needs to be 1.5V.    You can use same circuit for Vref that's used on pedals only the resistors aren't the same value.    So 10k from Vref to 9V, 2.2k from Vref to ground then at least 10uF from Vref to ground.

Another way is to run both the ground connections back to a Vref which is set to Vcc/2, exactly the same as you would do with a pedal,  maybe use a 47uF Vref cap for this one,


For your circuit the 50k + 5k + diode is just the 20k resistor.

In this circuit the 5k will sort of set the output level.   The way of adjusting the output doesn't give as clean a output as you you might want.   If you tweak the 20k you might be able to get a cleaner output.

The oscillator you built is a Wein Bridge.    It's has good frequency adjustment but needs the ganged pot.  The output can be clean with more complicated designs like Merlin's but  it is possible to get a cleaner waveform from a simple circuit like yours by tweaking the 20k resistor (too low and it won't oscillate too high and the output is distorted.)  Don't try to use the 20k to adjust the level.  Keep the output high.

RG's circuits are Twin-T oscillators.   They are very simple circuits and they don't have any problems working.    The output isn't as clean as the Wein but it is certainly good enough for something that is more or less sine output.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

jfrabat

Quote from: Rob Strand on August 12, 2020, 08:20:08 PM
The reason it didn't work is your circuit needs a +V and -V supply with grounds connected to 0V.   To get a single supply versions running you need to bias the opamp.

The simplest case is to only bias the RC network like this,



For a 9V supply Vref needs to be 1.5V.    You can use same circuit for Vref that's used on pedals only the resistors aren't the same value.    So 10k from Vref to 9V, 2.2k from Vref to ground then at least 10uF from Vref to ground.

The oscillator you built is a Wein Bridge.    It's has good frequency adjustment but needs to ganged pot.  The output can be clean with more complicated designs like Merlin's but  it is possible to get a cleaner waveform from a simple circuit like yours by tweaking the 20k resistor (too low and it won't oscillate too high and the output is distorted.)  Don't try to use the 20k to adjust the level.  Keep the output high.

OK, in mine the 2 100K pots are ganged (I drew an arrow trying to indicate that, but it barely shows!), so I guess I am on the right track then, with the exception of the ground I drew at the bottom (RC network).  Instead I need to connect that to a 1.5V source.  I take it a simple voltage divider adjusted to drop from 9V to 1.5V will suffice, right?
I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).

Rob Strand

QuoteI take it a simple voltage divider adjusted to drop from 9V to 1.5V will suffice, right?
Yes it should bring it to life.    The 10k + 2k2 values should prevent any weird behaviour but really you need to add the bypass cap, say 10uF, across the 2k2.   Without the cap the divider will affect the oscillator.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

jfrabat

Thanks, that worked perfectly.  In fact, even without the cap it works fine, but I left it in just in case.
I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).

Rob Strand

QuoteThanks, that worked perfectly.  In fact, even without the cap it works fine, but I left it in just in case
Good news.   Yes it probably works without the cap but you might see subtle changes in the signal quality at low and high frequencies.  If you adjust the 20k too finely it could even stop oscillating at one end of the frequency range.    All finer points.   With the bypass cap in place it's much more robust.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

antonis

Quote from: jfrabat on August 13, 2020, 02:10:23 PM
even without the cap it works fine

Rob wants to tell you that is always wise, in the cost of a cap, to have a stiff voltage source (divider in present case) "isolated" from any AC interpolations..
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

jfrabat

100% agreed.  I left the cap in just to be safe.
I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).

jfrabat

Boxed it up.  Just needs some graphics!  According to my oscilloscope, frequency range is from 115 Hz to 1.3 KHz

I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).