DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: merlinb on April 15, 2010, 05:11:24 PM

Title: Mini DIY signal generator
Post by: merlinb on April 15, 2010, 05:11:24 PM
Since the all-in-one function generator chips seem to be out of production (well, I can't find any here in Britian) I came up with this simple circuit using a quad opamp instead. Thought it might amuse some folks here, plus its small enough to fit into a MXR-style enclosure.

It produces sine and square waves from 18Hz to 10kHz in three ranges:
18Hz to 180Hz
180Hz to 1.8kHz
1.8kHz to 10kHz

One shortcoming is that the amplitude of the sine wave varies a lot as you change the frequency (this is also why it only goes up to 10kHz, since I had to chop off the last bit of the range or the amplitude skyrockets) , but hey, what do you expect for a circuit the size of a match box! The square wave stays nice and constant though. The other shortcoming is that it needs two 9V batteries.
Maximum output amplitude is 10Vp-p.
Output impedance 47 ohms.
Square wave rise time 2microsecs
(http://i81.photobucket.com/albums/j207/merlinblencowe/DIYSigGen.jpg?t=1271365807)
Title: Re: Mini DIY signal generator
Post by: Skruffyhound on April 15, 2010, 05:40:47 PM
Thanks for that.
Title: Re: Mini DIY signal generator
Post by: KazooMan on April 15, 2010, 09:09:00 PM

Thanks!

I have a simple, single frequency oscillator to trace circuits, but your signal generator should provide some new options when troubleshooting a pedal.

The more tools available the better!

Now the problem will be what to do with my old oscillator.  It is one of the first circuits I ever built and the components all sit proudly well spaced on a piece of perfboard.  One frequency with three levels out.  A real masterpiece, but it did allow me to troubleshoot some builds.  Maybe belongs in the stompbox hall of fame (or shame).

Thanks again!
Title: Re: Mini DIY signal generator
Post by: John Lyons on April 15, 2010, 09:13:20 PM
Neat! thanks for posting. Any chance to get the schematic
for us non strip board builders?

John
Title: Re: Mini DIY signal generator
Post by: slotbot on April 15, 2010, 10:07:31 PM
second on the schematic.

also your tube website is AMAZING. keep up the good work.
Title: Re: Mini DIY signal generator
Post by: andymac1962 on April 16, 2010, 01:08:37 AM
i have one i built from an electronics magazine in Australia several years ago. It just used op amps, but had a harmonic cancellation circuit to do amplitude stabilsation rather than ptc's of zeners.....
Did 20hZ - 20kHz in 4 ranges,    easy to build...

Will see if i can dig it out over the weekend, scan it & post......
Title: Re: Mini DIY signal generator
Post by: Brymus on April 16, 2010, 01:36:03 AM
Yeah welcome to the board Merlin,your tube site is the bees knees  8)
I have used it many ,many times
And thanks for sharing the sig gen,I could use a schematic too if you dont mind,
Bryan
Title: Re: Mini DIY signal generator
Post by: merlinb on April 16, 2010, 04:38:32 AM
Thanks guys! Here's a quick ghetto schem. Note that the part numbers do not correspond to the layout I posted! The layout also has an LED, but I'm sure you can figure out how to do that on your own  ;)

The circuit is a conventional Wein bridge oscillator in a Cambridge configuration (that's OP3) to allow a single pot to tune the frequency. I used a DPDT-centre off switch to select the frequency range, rather than the conventional rotary switch, because the whole point of the project was to be as tiny as possible. Anyone can build a good sig gen if it doesn't have to be small! :icon_lol:
The sine wave is then sent to OP1 which is a Schmitt trigger and converts it to a square wave. A 10pF cap is added to improve the rise time, but some opamps might not like that, so it is optional. The square wave is then padded down to make it the same amplitude as the max sine amplitude. The rest should be obvious.

EDIT: I just noticed that R9 is redundant- you can leave it out.

(http://i81.photobucket.com/albums/j207/merlinblencowe/MiniSigGen.jpg?t=1271406868)
Title: Re: Mini DIY signal generator
Post by: Auke Haarsma on April 16, 2010, 04:51:23 AM
Thanks for sharing the layout  and circuit!

Quote from: merlinb on April 15, 2010, 05:11:24 PM
Since the all-in-one function generator chips seem to be out of production

The XR2206 is readily available. If I am not mistaken it has even been put back into production.

Available at e.g. http://www.conrad-uk.com/goto.php?artikel=179973 (I live in the Netherlands, so I am not fully up to speed on the UK market, however, this link popped up with a quick google search).
Title: Re: Mini DIY signal generator
Post by: Kain on April 16, 2010, 05:07:26 AM
Nice one.

I use Visual Analyser's waveform generator (sine, square, sweeps, noise, pulses, saw...). With same software you can also see the scope and spectrum.

Laptop (VA waveform generator) > omega lexicon output > magical mystery diy box > omega lexicon input > laptop (Visual analyser), works well. Very entertaining and educational also.
Title: Re: Mini DIY signal generator
Post by: Skruffyhound on April 16, 2010, 05:45:27 AM
XR2206 also available from leemoon611 on ebay, where I got mine
Title: Re: Mini DIY signal generator
Post by: andymac1962 on April 16, 2010, 06:40:05 AM
Heres the low distortion audio oscillator circuit, originally from Silicon Chip magazine in Australia.
Adjust the 1K trimpot for approx 2.5Vrms on the output. As i recall, it worked by subracting harmonics, and ended up with a pretty good sine wave of approx 2% distortion, with excellent amplitude stability over the whole range.
sorry cant work out how to paste into my reply, so here is the link
http://www.eserviceinfo.com/equipment_mfg/books_41.html

i have some books on pdf i will upload next week, including GEC valve audio amps, stompbox cookbook, guitar amp book, radiotron valve handbook, solidstate guitar amp book, high pwoer audio amp book.
You dont have to join the site to download
Title: Re: Mini DIY signal generator
Post by: diydave on April 16, 2010, 07:34:44 AM
[qoute]The circuit is a conventional Wein bridge oscillator in a Cambridge configuration[/quote]

What's a Cambridge configuration?
I understand the principles of a Wien Bridge oscillator, but the Cambridge thing is new.

Btw: love your site, merlinb. It has helped me a lot in tinkering with my own amps.
Title: Re: Mini DIY signal generator
Post by: merlinb on April 16, 2010, 08:05:02 AM
Quote from: diydave on April 16, 2010, 07:34:44 AM
What's a Cambridge configuration?
With ordinary oscillator you invariably need to vary two resistances simultaneously in order to sweep the frequency. Andymac's post is another example of this; you need a dual-ganged pot. Obviously this can be a pain if you're trying to save space, plus I never seem to have any dual pots in my spares box, and I have never even seen a dual-gang trim pot.

W. Cambridge published a modification for the Wein bridge that avoids the dual gang pot, by using another opamp to compensate for the loss in the bridge as you vary only one resistor. Since the input to the extra opamp is a virtual earth, the opamp amplifies whatever current flows in the pot and applies this to the negative input of the main oscillator. Ideally it will exactly compensate for the loss in the bridge by simultaneously increasing the gain of the oscillator. Ideally.

In practice, however, it doesn't work. At least, not as well as you would hope. At low frequencies it is excellent, but at high frequencies the gain of the opamp departs from the ideal and the whole thing falls apart. That's why I have the odd feedback path around the extra opamp (which was not in Cambridge's design); it tames the gain a bit and keeps the oscillator from producing a stupidly large output at the highest frequency.

Title: Re: Mini DIY signal generator
Post by: PRR on April 16, 2010, 10:53:29 PM
> never seem to have any dual pots in my spares box

Old (old-old?) stereo hi-fi amps. 1970s Sansui etc. Volume control is dual audio, usually 100K. And you get a really nice knob!

> at high frequencies the gain of the opamp departs from the ideal

You have a 10K:100 ratio, 100:1, amp needs gain of exactly 100 at 10KHz. The gain-bandwidth must be "much greater than" 100*10KHz= 1MHz. If not, not only is gain a bit short, phase-shift messes the bridge frequency.

TL074? or TL061/TL064?

TL061 has GBW of just 1MHz, more or less. So where gain should be 100, it is more like 50, more or less. TL074 has higher GBW, might give gain of ~~80, which fits your 120 ohm fudge resistor. But there is no tolerance zone on GBW. Various-vendor chips may need other values.

It wants a faster amp or a smaller range.

Still a slick trick. Have never seen that one.

> W. Cambridge published a modification for the Wein bridge

Cite? Hint?
Title: Re: Mini DIY signal generator
Post by: merlinb on April 17, 2010, 07:04:31 AM
Quote from: PRR on April 16, 2010, 10:53:29 PM
Old (old-old?) stereo hi-fi amps. 1970s Sansui etc. Volume control is dual audio, usually 100K.
I never seem to have any of them in my spares box either! Plus you want linear, ideally, and there's no way I could fit one in a MXR enclosure.

Quote
TL074? or TL061/TL064?
Both work. I have TL064 in it right now.

Quote
It wants a faster amp or a smaller range.
Um, but it works on the range it has already...

QuoteYou have a 10K:100 ratio, 100:1, amp needs gain of exactly 100 at 10KHz. The gain-bandwidth must be "much greater than" 100*10KHz= 1MHz. If not, not only is gain a bit short, phase-shift messes the bridge frequency.
Incidentally, the problem area is the lower end of the highest range (about 1.8k to 3kHz region), where the amplitude really drops off. Above that the amplitude shoots up instead.

Quote
Cite? Hint?
The source I have is the Newnes Circuit ideas Pocket Book Part Three, p258. Year unknown, probably early 90s.
Title: Re: Mini DIY signal generator
Post by: Gurner on September 05, 2010, 02:30:17 PM
Quote from: merlinb on April 15, 2010, 05:11:24 PM
Since the all-in-one function generator chips seem to be out of production (well, I can't find any here in Britian) I came up with this simple circuit using a quad opamp instead. Thought it might amuse some folks here, plus its small enough to fit into a MXR-style enclosure.

Old(ish) thread I know (referenced by another thread running a couple down from this),   was put onto the XR2206 by Taylor a couple of days ago, from a component count perspective, it's gotta be the way to go if you need a condensed sig gen!

So, for the Brits...

http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6866039



Title: Re: Mini DIY signal generator
Post by: Earthscum on September 06, 2010, 11:39:41 AM
Apparently there are some choices... http://www.siliconfareast.com/waveform-gen.htm (http://www.siliconfareast.com/waveform-gen.htm)
Title: Re: Mini DIY signal generator
Post by: akkar on September 20, 2010, 04:38:05 AM
Sorry but the Schmitt trigger doesn't need a resistor in the positive feedback?
I'm asking this because my builded board doesn't work... ::)
Title: Re: Mini DIY signal generator
Post by: akkar on September 21, 2010, 09:14:05 AM
I've placed a 220k resistor in place of that capacitor, it doesn't work fine anyway... ???
Can anyone help me?
Title: Re: Mini DIY signal generator
Post by: merlinb on September 21, 2010, 09:25:09 AM
Quote from: akkar on September 21, 2010, 09:14:05 AM
I've placed a 220k resistor in place of that capacitor, it doesn't work fine anyway... ???
Can anyone help me?
You don't need capacitor C3, it is optional. (But do not replace it with a resistor).

Does the circuit produce a sine wave?
Title: Re: Mini DIY signal generator
Post by: akkar on September 21, 2010, 12:00:28 PM
yes, but no traces of the square wave... I've made a PCB but some trace were undivided so I've manually divided them with a cutter.. maybe the space between them is not enough (even though they now are not electrically connected).
is the circuit sensitive to this problem?

PS.sorry for my bad english
Title: Re: Mini DIY signal generator
Post by: merlinb on September 21, 2010, 02:53:58 PM
Quote from: akkar on September 21, 2010, 12:00:28 PM
yes, but no traces of the square wave... I've made a PCB but some trace were undivided so I've manually divided them with a cutter.. maybe the space between them is not enough (even though they now are not electrically connected).
is the circuit sensitive to this problem?
The circuit does not require wide space between traces, so I do not think that is the problem. Are you sure your layout / pin connections are correct?
Title: Re: Mini DIY signal generator
Post by: PRR on September 22, 2010, 12:18:27 AM
> the Schmitt trigger doesn't need a resistor

There's no Schmitt in Merlin's post #7 (http://www.diystompboxes.com/smfforum/index.php?topic=83930.msg698413#msg698413).

The square-wave is a plain comparator. That will work.

> doesn't work...

Explain. No output at all? Sine but no square? Sine isn't sine? Plays radio stations?

Review the DEBUGGING POST (http://www.diystompboxes.com/smfforum/index.php?topic=29816.0). Since Merlin's plan uses both + and - 9V power (did you use two batteries?), we expect IC pins to be +9V, -9V, or very nearly zero on the DC meter. Anything else is A Clue.
Title: Re: Mini DIY signal generator
Post by: akkar on September 22, 2010, 01:29:31 PM
Like I've said there's no square wave at all.
the sine wave is present, but it tend to modify its shape :icon_eek:
Anyway the +9V -9V supply is present on the respective ic's pins..

I think there's some problem in the copper traces or in the soldered pins :'(

This is the pcb:

(http://img178.imageshack.us/img178/7613/pcb.jpg) (http://img178.imageshack.us/i/pcb.jpg/)

Title: Re: Mini DIY signal generator
Post by: merlinb on September 23, 2010, 05:26:36 PM
I can't see anything wrong with the layout, so I guess it is a physical problem. (Wrong part / faulty part / short between tracks, etc.)
Title: Re: Mini DIY signal generator
Post by: akkar on September 24, 2010, 03:42:12 AM
i'll make a new board when I have some free time..
thank you for your patience and help!
Title: Re: Mini DIY signal generator
Post by: tubelectron on September 24, 2010, 03:48:47 PM
Hi all,

Just for fun and nothing else : here's my "Maxi non-DIY signal generator from the paleozoic era" (1959 laboratory grade / 23 tubes / 22kg) way to big for matchbox casing...

(http://img10.hostingpics.net/pics/643980IMG_6415.jpg)

More seriously, for a simple DIY 20Hz-20KHz generator, the XR2206 or ICL8038 can work without too much components and give constant output voltage both in sine and square waves. Over this limit, the simplicity vanishes...

A+!
Title: Re: Mini DIY signal generator
Post by: Skruffyhound on September 27, 2010, 04:50:12 PM
That's beautiful Bruno, I've been looking for something similar that will fit with the rest of my ancient analog junk.

Sorry to continue the hijack everyone.

Do you have a good circuit/pcb layout for the XR2206. I've seen Walt's on the forum and the app notes, anything different? When you say "constant output voltage", what do you mean? Can't I vary the peak to peak?
It's quite a while since I looked at the app notes  :icon_redface:, you just got me interested again. Thanks
Title: Re: Mini DIY signal generator
Post by: bacanador on September 27, 2010, 05:21:45 PM

Last year I was looking for Function Generator IC's, and didn't find any, but a couple of months ago I searched again, and found the XR2006 at mouser

http://www.mouser.com/ProductDetail/Exar/XR2206CP-F/?qs=sGAEpiMZZMs2Wv7C45tVfBqaYo2KUdBB

I don't know if they stopped making them and they started making them again, but I bought a few just in case, and made my function generator almost the exact same circuit shown in the datasheet, the circuit was simple enough not to require a layout, I just put the stuff on there and worked.



Title: Re: Mini DIY signal generator
Post by: tubelectron on September 29, 2010, 01:00:19 PM
Quote from: Skruffyhound on September 27, 2010, 04:50:12 PM
That's beautiful Bruno, I've been looking for something similar that will fit with the rest of my ancient analog junk.

Sorry to continue the hijack everyone.

Do you have a good circuit/pcb layout for the XR2206. I've seen Walt's on the forum and the app notes, anything different? When you say "constant output voltage", what do you mean? Can't I vary the peak to peak?
It's quite a while since I looked at the app notes  :icon_redface:, you just got me interested again. Thanks

Hi Skruffyhound,

I made some trials with the ICL8038 and the XR2206 to make a simple and reliable function generator, that is to say :
- giving constant output voltage amplitude no matter the frequency.
- giving acceptable THD, say 2%.
impossible mission for me - remember I am more qualified about tube gear !
the only thing I could release is a 0,1 to 30Hz ICL8038 generator feeding a L165 10W power amp IC that I use to run-in the new speakers and inspect cone/suspensions defects. Nothing more...
So - sorry - I do not have good things about a fair but simple audio generator with a positive experience.

I should say : do not waste much your time and buy one for cheap on eBay !

A+!
Title: Re: Mini DIY signal generator
Post by: merlinb on June 21, 2011, 10:56:34 AM
Here is an improved audio signal generator based on my first posting. This one produces a low-distortion sine wave from about 20Hz to around 15kHz. Maximum output about 2.5Vp-p, constant to within 0.3dB. Distortion less than 0.5% in the higher range, reaching about 1.5% in the lowest range. Not a bad effort for one quad opamp and a single 9V battery.

Incidentally, any LDR should work providing it has a dark resistance in excess of 100k. Enjoy!


(http://i81.photobucket.com/albums/j207/merlinblencowe/Wien_Oscillator.jpg)
(http://i81.photobucket.com/albums/j207/merlinblencowe/MiniSigGenLayout.jpg)
(http://i81.photobucket.com/albums/j207/merlinblencowe/CIMG6345.jpg)
Title: Re: Mini DIY signal generator
Post by: defaced on June 21, 2011, 11:24:59 AM
Found my next project.  I'm not a big fan of using my cell phone as a signal generator for my amp. 
Title: Re: Mini DIY signal generator
Post by: jimmybjj on July 03, 2011, 03:32:42 PM
has anyone made a pcb layout for this yet? Thanks.
Title: Re: Mini DIY signal generator
Post by: defaced on September 20, 2011, 10:37:55 PM
You rang?  Ok, so it's been a couple of months, but I finally got around to doing this.  This has been built and verified by me (ok, I haven't added the switch yet, but the highest range works, so I don't anticipate any issues).  The only change I made between Merlin's schematic and this one is the addition of C9, for on board filtering of the power supply if it's needed.  All part number/values/pinouts match the original schematic/vero layout.  The Eagle TL074 part doesn't use the same opamp identifications as Merlin's schematic (U1a, U1b, etc), so I decided to match the pinout on the vero to the pinout on the PCB.  There are a couple of tight areas on the layout, so I reduced the trace width locally as needed, but I had no issues etching this using the toner transfer method.  Board measures 2.05 inches (52mm) by 1.83 inches (46.5mm).  Center to center distance of the pots is 1.25 inches (31.75mm).  The trace side of the board is shown from like you're looking through the board, so get your toner transfer/photo supplies ready!  

I have also made a project PDF for this (think utilitarian version of madbean/tonepad docs). Might make printing the layout easier.  Merlin do you mind if I post it (assuming I can find a place to host it)?  Credit given, of course.  

(http://img809.imageshack.us/img809/5835/merlinsiggenrev2all.png)

(http://img685.imageshack.us/img685/1024/merlinsiggenrev2layout.png)

(http://img607.imageshack.us/img607/5761/merlinsiggenrev2pcb.png)

(http://img35.imageshack.us/img35/6188/20110920221415922.jpg)

(http://img823.imageshack.us/img823/3976/2011092022144664.jpg)

(http://img221.imageshack.us/img221/4553/20110920221521619.jpg)
Title: Re: Mini DIY signal generator
Post by: merlinb on September 21, 2011, 04:32:28 AM
Quote from: defaced on September 20, 2011, 10:37:55 PMMerlin do you mind if I post it (assuming I can find a place to host it)?  Credit given, of course.
Be my guest!  :D

By the way, put some text on the board to avoid confusion over the orientation. I usually write on the board dimensions, so you can handily check both the print size and orientation.
Title: Re: Mini DIY signal generator
Post by: Perrow on September 21, 2011, 07:39:21 AM
Quote from: defaced on September 20, 2011, 10:37:55 PM
The trace side of the board is shown from like you're looking through the board, so toner transfer guys are ready to go, photo guys will need to mirror it.

No, no, no, photo guys print this way too. We just print this on a transparency and place it with the "ink side" against the board, this way the pattern gets as close as possible to the board  :)
Title: Re: Mini DIY signal generator
Post by: defaced on September 21, 2011, 08:51:19 AM
Thanks Merlin, good suggestions, will do.

Parrow, makes perfect sense.  I'll update my post to reflect.  
Title: Re: Mini DIY signal generator
Post by: sliberty on October 21, 2011, 02:21:59 PM
If anyone is making any of these PCB's, I'd really like to buy 2 of them from you. Please contact me (steve at sliberty dot com).
Title: Re: Mini DIY signal generator
Post by: merlinb on January 25, 2012, 11:39:12 AM
Another PCB for the sig gen circuit. This one allows for up to four frequency ranges using a DP4T rotary switch, covering roughly 20Hz - 100kHz in total. This is the switch I used:
http://www.ebay.com/itm/2-Pole-4-Position-Panel-PCB-Wiring-Rotary-Switch-2P4T-/330588499247?pt=LH_DefaultDomain_0&hash=item4cf89c2d2fpt=UK_BOI_Electrical_Components_Supplies_ET&hash=item4cf8952614

Also added a power indicator LED (D5) and reverse protection for the main LED (D4). The frequency pot is arranged to increase the frequency when rotated anti-clockwise when mounted on the solder side, so that using a log pot gives a linear change in frequency.
http://s81.photobucket.com/albums/j207/merlinblencowe/Sine%20Wave%20Generator/
(http://i81.photobucket.com/albums/j207/merlinblencowe/Sine%20Wave%20Generator/CIMG6902.jpg)
(http://i81.photobucket.com/albums/j207/merlinblencowe/Sine%20Wave%20Generator/CIMG6901.jpg)
Title: Re: Mini DIY signal generator
Post by: merlinb on April 25, 2012, 11:21:06 AM
Finally got this into a proper enclosure.
PCB, schematic and other files are here:
http://s81.photobucket.com/albums/j207/merlinblencowe/Sine%20Wave%20Generator/

(http://i81.photobucket.com/albums/j207/merlinblencowe/Sine%20Wave%20Generator/CIMG7131b.jpg)

(http://i81.photobucket.com/albums/j207/merlinblencowe/Sine%20Wave%20Generator/CIMG7130b.jpg)
Title: Re: Mini DIY signal generator
Post by: iccaros on April 25, 2012, 11:56:47 AM
Good Ideal, Did I miss the schematic for this change?
Title: Re: Sv: Mini DIY signal generator
Post by: Perrow on April 25, 2012, 12:37:49 PM
Mind posting the graphics and/or drill plan? Looks like something I'll have to build.
Title: Re: Sv: Mini DIY signal generator
Post by: merlinb on April 25, 2012, 02:55:38 PM
Quote from: Perrow on April 25, 2012, 12:37:49 PM
Mind posting the graphics and/or drill plan? Looks like something I'll have to build.
Sure, here's the graphic. Dimensions 55 x 105mm

http://dl.dropbox.com/u/57831278/SigGen55x105mm.bmp
Title: Re: Mini DIY signal generator
Post by: PRR on January 09, 2013, 11:38:16 PM
Quote from: diydave on April 16, 2010, 07:34:44 AMWhat's a Cambridge configuration? I understand the principles of a Wien Bridge oscillator, but the Cambridge thing is new.

The Wein Bridge plus one diff-amp makes an oscillator; but to change frequency you must vary two parts or face severe gain-change trouble.

IF you allow two amplifiers, specifically a paraphase (one non-invert one invert common input), there's nine ways to connect the 2Cs and 2Rs and get an oscillator. Two of these allow large frequency change with one part without gain trouble.

http://i.imgur.com/rkmIF.gif

With other multi-amplifier configurations you can get "An Abundance Of Sinusoidal Oscillators" (R.S. Sidorowicz, Proc IEE (London) Mar 1972). This Cambridge/Merlin configuration is probably touched-upon in there (it's dense).
Title: Re: Mini DIY signal generator
Post by: PRR on January 28, 2013, 03:31:33 PM
>>> W. Cambridge published a modification for the Wein bridge
>> Cite? Hint?
> The source I have is the Newnes Circuit ideas Pocket Book Part Three, p258. Year unknown, probably early 90s.


I found the book. Very-very interesting. All these technical projects and then "Guard the vegetables without frying the cat".

Newnes Circuit Ideas Pocket Book
ISBN: 0750623365 / 0-7506-2336-5
Publication Date: September 1995

(FWIW, I can't find any "Part Three".)

I paid $16 on ABE for a copy shipped from the UK. Offers on this side of the pond were $20++. But on ABE today I'm seeing only $40 (to $235!) while Amazon shows five at $25 delivered in USA (http://www.amazon.com/gp/product/0750623365/ref=olp_product_details).

W A Cambridge's 'Circuit Idea' does not include any references.

http://i.imgur.com/XPUfBCv.gif
Title: Re: Mini DIY signal generator
Post by: Thunk on December 12, 2013, 09:39:42 PM
Pardon my ignorance, but why do you use an LDR instead of just a 100k resistor?

I know this thread is old, but it looks like a fun project and I'm curious....


Thanks!
Title: Re: Mini DIY signal generator
Post by: PRR on December 12, 2013, 11:39:08 PM
> why do you use an LDR instead of just a 100k resistor?

Gain around the loop must be *exactly* 1.0000......

If less, it won't sing.

If more, it tries to build-up to infinity, hitting the rails and distorting.

(You know this from waving a microphone around a PA speaker. There's really no stable point below "howl".)

Yes, there are simpler ways. Such as a 110K resistor (gain of 1.1) shunted with diodes and a 500K resistor (ultimate gain of 0.9). When the diodes barely conduct, the wave has a faint flat-top, average gain hovers at 1.0000. You can even build a useful oscillator with initial gain of 1.5 and let it bang itself against a grid and de-bias down to average gain of 1.000. While there is gross distortion inside the loop, sometimes an optimum choice of output point gives acceptably low distortion.

Merlin choose to use the better way. A level detector, a smoothing filter, and a gain control. Filament lamps and FETs are classic gain controllers. The opamp and LDR do the same thing and, in this case, quite neatly.
Title: Re: Mini DIY signal generator
Post by: R.G. on December 13, 2013, 12:05:33 AM
Quote from: PRR on December 12, 2013, 11:39:08 PM
Yes, there are simpler ways... Filament lamps and FETs are classic gain controllers. The opamp and LDR do the same thing and, in this case, quite neatly.
As an interesting (to me, anyway) is that the variable resistance of a filament lamp was the subject of Bill Hewlett's graduate work at Stanford. He and Dave Packard decided to start an electronics company, the first product of which was the HP 200 sine wave oscillator. This was a Wien bridge oscillator that used a filament lamp for keeping gain precisely at the oscillation point.

The garage they worked in is viewed as the birthplace of Silicon Valley - which itself has now passed into history, I fear.

See http://www.hpmuseum.org/garage/garage.htm
Title: Re: Mini DIY signal generator
Post by: Thunk on December 13, 2013, 08:39:13 PM
Thanks for the replies!

Now, I just need to find an LDR and then to get started...



Title: Re: Mini DIY signal generator
Post by: PRR on December 14, 2013, 11:36:15 PM
> Bill Hewlett's graduate work at Stanford.

Was probably Prof/Dean Fred Terman told him what to try. Terman was a giant. I have his main book in my bedroom.

> an electronics company, the first product of which was the HP 200 sine wave oscillator.

There were a couple of "200"s. The early ones were black rack-boxes, sales were slow. What made it the Must-Have! of 1950 is probably the sleek case on the 200AB. (You yourself know how packaging influences sales.)

> keeping gain precisely at the oscillation point.

What's also interesting is that the lamp does NOT work alone. It *needs* nonlinearity in the amplifier. 200AB got it with mis-bias on the 2nd stage. I foolishly "fixed" that, and it wouldn't stabilize. Similar experience with a Heath transistor brige-Tee singer. Once found a tech paper proving the same thing (can't find it again).
Title: Re: Mini DIY signal generator
Post by: merlinb on May 20, 2014, 07:04:52 AM
Quote from: PRR on January 28, 2013, 03:31:33 PM
>> Cite? Hint?
> The source I have is the Newnes Circuit ideas Pocket Book Part Three, p258. Year unknown, probably early 90s.

I found the book. Very-very interesting. All these technical projects and then "Guard the vegetables without frying the cat".

Today I stumbled on this book which has a very interesting collection of single-element-control versions of the Wein bridge oscillator:
https://archive.org/details/CircuitDesigns3CollectedCircards
Title: Re: Mini DIY signal generator
Post by: Morocotopo on May 20, 2014, 09:59:41 AM
I have a DIY sine generator that uses a lamp for stabilizing the gain, it´s funny to watch in the oscilloscope how, when you change frequency, the signal "bounces" up and down till it stabilizes. Uses two batteries, though. A hint for getting exact frequency, since the pots/case will have no precise markings: generate a sine in some audio soft of the frequency you want, loop it, start the gen and tune it as you would tune a guitar string against another one! We are all musicians that know how to tune, right?

:icon_mrgreen:

Nice project Merlin, I´ll give it a try.
Title: Re: Mini DIY signal generator
Post by: deadastronaut on May 20, 2014, 11:11:30 AM
Quote from: merlinb on April 25, 2012, 11:21:06 AM
Finally got this into a proper enclosure.
PCB, schematic and other files are here:
http://s81.photobucket.com/albums/j207/merlinblencowe/Sine%20Wave%20Generator/

(http://i81.photobucket.com/albums/j207/merlinblencowe/Sine%20Wave%20Generator/CIMG7131b.jpg)



i love the look/style of this ...its got that new but old classic look to it, the dial graphics are excellent..very 8)
Title: Re: Mini DIY signal generator
Post by: merlinb on May 20, 2014, 03:33:30 PM
Quote from: deadastronaut on May 20, 2014, 11:11:30 AM
i love the look/style of this ...its got that new but old classic look to it, the dial graphics are excellent..very 8)

Thanks! It was inspired by this:
(http://www.radiomuseum.org/images/radio/triplett_electrical/am_fm_signal_generator_3433_644118.jpg)
Title: Re: Mini DIY signal generator
Post by: tca on May 20, 2014, 04:06:16 PM
There is a Wienbridge oscillator (1kHz) at the LM386 datasheet (pg. 6), if someone would like to play with it ;)
Title: Re: Mini DIY signal generator
Post by: Seljer on May 20, 2014, 04:35:18 PM
I recently made a pretty clean sinewave generator by heterodyning two crystal oscillators against each other. I used two identical crystals and by adding extra capacitance in series with one the crystals I can detune it to about 1khz away from the other one (I used and on-off-on switch for three fixed settings). For a frequency mixer I used a simple 1n914 diode, followed by a low pass filter, leaving me with about 200mV peak to peak of relatively clean sinewave. One NPN transistor is used for each oscillator, and another NPN is used as a buffer after the low pass.

It's an entertaining approach to the final goal  ;D
Title: Re: Mini DIY signal generator
Post by: PRR on May 21, 2014, 07:49:05 PM
> I stumbled on this book which has a very interesting

Wow! Yes, a great collection of basic cook-book blocks.

Thanks for posting.
Title: Re: Mini DIY signal generator
Post by: newperson on May 21, 2014, 11:28:53 PM
Quote from: PRR on January 28, 2013, 03:31:33 PM


"Guard the vegetables without frying the cat".

Newnes Circuit Ideas Pocket Book
ISBN: 0750623365 / 0-7506-2336-5
Publication Date: September 1995


What is this circuit about?  Some sort of replacement electric fence?
Title: Re: Mini DIY signal generator
Post by: PRR on May 22, 2014, 01:22:05 AM
It IS an electric-fence charger, home-brew.

Supposed to "deter squirrels without excessive violence". However it runs straight 230V past an unspecified gas tube, SCR, 1uFd cap, to a 6V/12V ignition coil, and you do something unspecified with the sparky end of the coil.

On further study, it scares the piss out of me.

If you need electric fencing, Tractor Supply et al will sell you a low-power ""SAFE"" fence charger. As with any electric shock, results can be unpredictable.
Title: Re: Mini DIY signal generator
Post by: newperson on May 22, 2014, 02:24:21 AM
That sounds a bit much and perhaps a cat killer.  I was hoping for some imaginative electric replacement.  My wife and I was looking at some low power stuff at Lowes to keep cats/dogs out of our raised beds and felt that the low powered stuff might even cause some 'issues' if a random kid came along.  I told here that it does not hurt too much and it should pulse so it cannot grab and hold onto you.  My brother and I used to dare each other to touch the fence at my aunt's house that kept the goats in.  Since it pulsed it was a 50/50 chance of getting zapped a little. 
Title: Re: Mini DIY signal generator
Post by: PRR on May 22, 2014, 12:30:52 PM
We had our Corgi at a farm and she wanted to play with the piglets. Then a "YELP!!", and I realized it was an electric fence.

This is a student farm and they are all organic and humane, so I assume they don't think the shock will do real harm to the piglets. (On the other hand, they ARE just future bacon.) The dog was confused but showed no lasting harm.

However "random kids" have parents who know lawyers. Outside a farming district, I think an electric fence is probably asking for serious trouble. Some kids don't know what it is, others (you?) will dare each other to touch it. If ANYthing bad happens, it's all your fault.

Also many towns have laws. In the suburb I used to live, barb or electric had to be 8 feet off the ground and angled 45 degrees inside the main fence, as well as placarded. (And today you can not bet that ALL children read english.)

Wire-mesh fence is a pain when you have to cultivate, and won't stop deer, but is cheap and widely accepted as safe. (Except cutting the stuff-- I always bleed.)
Title: Re: Mini DIY signal generator
Post by: Kipper4 on July 24, 2014, 05:57:49 PM
I bit the bullet and built this simple little circuit (famous last words since my usual success with vero has been haphazard) tonight.
I'm looking forward to finishing it up and doing the off board wiring tomorrow after work.
I think it will be fun to use to test pedal reaction using my old scope.
I hope it's not going to be a problem but I used a 100k 200k ,10meg dark LDR. It's one of the Gl 55 series I forget which exactly right now.
Wish me luck fellas :)
Title: Re: Mini DIY signal generator
Post by: Kipper4 on July 25, 2014, 08:34:44 AM
I'm Impressed It worked hot off the iron. Thanks Merlin.
Title: Re: Mini DIY signal generator
Post by: merlinb on July 27, 2014, 04:20:18 PM
Quote from: Kipper4 on July 25, 2014, 08:34:44 AM
I'm Impressed It worked hot off the iron. Thanks Merlin.
;D ;D ;D
Title: Re: Mini DIY signal generator
Post by: PRR on March 27, 2015, 12:58:17 AM
Merlin> probably early 90s.

There is an article about 1-pot RC oscillators in Wireless World, Dec 1980, page 82 of the magazine, page 44 in this scan. So the tricks were known then. Unfortunately there are no citations.

http://www.americanradiohistory.com/Wireless_World_Magazine.htm
Title: Re: Mini DIY signal generator
Post by: PRR on May 05, 2015, 01:10:38 AM
Here's the same thing again.

80MB PDF, you only want page 34 (pg 35 of the PDF)
https://archive.org/details/PrecisionMonolithicsInc-PMI-LinearAndConversionApplicationsHandbook1986

(http://i.imgur.com/ATy2oPk.gif)

To convince myself they *are* the same thing, I pasted them together:

http://i.imgur.com/fixHmKO.gif

MerlinB uses a more sophisticated AGC loop (omitted here), and takes AGC in the vary-gain inverter rather than the output stage (I don't know what difference this makes, if any). And of course the single-supply re-engineering.

Both together give a better idea of what that variable resistor really does.
Title: Re: Mini DIY signal generator
Post by: bluzeyonecat on May 05, 2015, 01:59:02 AM
Thats really cool man! :icon_cool: After I get some more of the basics down, definitely a project Id like to try. Thanks for sharing this.
Title: Re: Mini DIY signal generator
Post by: Jarno on May 25, 2016, 05:55:02 PM
Ping, old thread bump :D

So, I did a layout with four of these sine oscs on a single board, and four VCA's on the same board. I am going to use these in my modular synth in an old school electronic music context (those guys used old HP measurement equipment to make music), to produce a set of partials.

I converted the circuit back to dual supply, since I have that available in my modular (dual 12v).

But, I am getting some weirdness.
For the low end, I am using 2x 470nF caps, and it takes some time for the amplitude to stabilise, sometimes it keeps on wobbling or it takes a bit of fiddling with the pot to get it started. I tried a vactrol, but that didn't work well.
Also, on the mid range (2x100nF), it rises to high amplitude (runs into the -12v rail) and then dies again.
The high range (2x 10nF) works fine (with a vactrol, NSL32-SR2).

So, is the speed of the vactrol important? (gut feel says it should be sloooowwwww)
Furthermore, should the caps be matched? (I am using 10% film caps now)

If the sine is oscillating, it looks pretty damn good, and without trimming :)

Edit:
I will also try to increase the resistor across the LDR, I'll try it tonight.
Title: Re: Mini DIY signal generator
Post by: merlinb on May 26, 2016, 05:28:35 AM
Quote from: Jarno on May 25, 2016, 05:55:02 PM
I converted the circuit back to dual supply, since I have that available in my modular (dual 12v).
But, I am getting some weirdness.
Caps don't need to be matched, and vactrol speed shouldn't be an issue since the feedback servo is even slower (C10). I suspect the problem is that with +/-12V supplies, the servo opamp is trying to drive enormous current into the LED, and failing. Try a beefy opamp like NE5532. Perhaps try increasing R9 too.
Title: Re: Mini DIY signal generator
Post by: Jarno on May 27, 2016, 07:43:09 AM
Hi Merlin, thanks for your reply.

That's a very good point, changing to NE5532 will be hard though :D
(http://i1112.photobucket.com/albums/k482/Solderfool/Quad%20Sine%20VCA_zpsexac6qgv.jpg)

I am using SMT TL074, that indeed has a puny output stage. Judging by the short circuit current, they are comparable though 5532 is 38mA and TL07x is about 40mA. I could go with OPA4227 (expensive!) that has a slightly more beefy output. But I will also change that series resistor to the LED to 220r, those vactrols are pretty sensitive, so driving them to the limit is not necessary I suppose (max 25mA). Maybe I'll go for 390r, that keeps max current within max limits.
Some soldering to do, I'll let you know the proceedings.
Title: Re: Mini DIY signal generator
Post by: merlinb on May 27, 2016, 09:25:39 AM
Quote from: Jarno on May 27, 2016, 07:43:09 AM
But I will also change that series resistor to the LED to 220r, those vactrols are pretty sensitive, so driving them to the limit is not necessary I suppose
Ah, quad opamps. In that case change the resistor before you change the opamp -it may be all that is required. This will increase the output ampliftude of the oscillator too, which is what you'd expect with so much more headroom.
Title: Re: Mini DIY signal generator
Post by: Jarno on May 27, 2016, 09:39:29 AM
thanks!

Yes, common signal level for audio in eurorack modular synths is 10V pp. No worries if it is less though there's always places to adjust in a patch.
Title: Re: Mini DIY signal generator
Post by: Jarno on May 28, 2016, 04:06:51 PM
Well, it appears I was asleep at the wheel when putting in components. Forgot 100k in one of the oscs, and mistakenly put 10k into the 1k position of another osc.

They are all humming along now :D

I get the following ranges:

10nF --> 1.61kHz - 14.44kHz
68nF --> 252.45Hz - 2.36kHz
100nF --> 153.00Hz - 1.47kHz
470nF --> 33.82Hz - 327Hz

I will be using 50k multiturn potmeters in the final build, and have put a 12k tapering resistor over it to get a 10k reverse log response (-ish). It seems to work well on the single turn pots I have on it now.
I used 390r for the resistor in series with the LED (rather than 100r), and 30k across the LDR (rather than 12k).

Right, onto the VCA's!
Title: Re: Mini DIY signal generator
Post by: PRR on August 19, 2016, 01:04:41 AM
>> Cite? Hint?
> Newnes Circuit ideas Pocket Book.., probably early 90s.


Exploring an otherwise useless "3,630 Electronics Circuits" book, I found this from 1974.

(https://s3.postimg.org/pyjr6ijur/1_pot_Wien_1974.gif)

No cap-switch, uses MUCH lower value freq-resistors, takes gain trim in A1 instead of A2, using diode-clip instead of opto. But same base idea of making amp-gain compensate for Bridge loss with tuning.

Now I am wondering how much further it may go. "Most" basic opamp schemes were known in the 1950s, but practice was limited by high op-amp cost. I had thought that with modules, chips, and quad-chips, the marketers dragged the old books for ideas which now made sense (and sold more chips). Certainly all the bi-quad and dual-integrator and gyrator ploys got space in application notes. Yet I had never seen this one until Merlin presented his rendition.
Title: Re: Mini DIY signal generator
Post by: merlinb on July 11, 2018, 08:56:50 AM
Quote from: PRR on January 28, 2013, 03:31:33 PM
I found the book. Very-very interesting. All these technical projects and then "Guard the vegetables without frying the cat".
Newnes Circuit Ideas Pocket Book
ISBN: 0750623365 / 0-7506-2336-5
Publication Date: September 1995
(FWIW, I can't find any "Part Three".)

W A Cambridge's 'Circuit Idea' does not include any references.

FYI by chance I discovered Cambridge's circuit was published in Electronics World, February 1994, p149, before being collected into the Circuit Idea Pocket Book.
PDF available here: https://www.americanradiohistory.com/Wireless_World_Magazine.htm
Title: Re: Mini DIY signal generator
Post by: PRR on July 11, 2018, 03:38:28 PM
Dang bit-rot! Here again is my now-missing image in Reply #74:
(https://s8.postimg.cc/ycupzehwh/1-pot-_Wien-1974.gif) (https://postimg.cc/image/ycupzehwh/)

> Cambridge's circuit was published in Electronics World, February 1994, p149

THANKS!! (A much spiffier reference than the pocket book.) To extract the key bit for convenience:

(https://s8.postimg.cc/zf4whyvkx/Cambridge_Wien-_WW1994.gif) (https://postimg.cc/image/zf4whyvkx/)
Title: Re: Mini DIY signal generator
Post by: amz-fx on July 12, 2018, 11:06:10 AM
If you need an opamp with more drive than a TL072, then try the NJM4556D, which can drive 70ma into a 150 ohm load. Has an 8MHz GPB and voltage noise lower than the TL072. Slew is 3 V/us which is less than the 072 but more than enough for FX projects. Could be a good fit for a sig gen.

It is a dual opamp and can drive most headphones. Available at Mouser for less than $1 each.

regards, Jack
Title: Re: Mini DIY signal generator
Post by: tubegeek on October 28, 2019, 07:59:29 AM
Just finished building one of these, using the vero layout from Sabrotone. https://www.sabrotone.com/?p=2951 (https://www.sabrotone.com/?p=2951) I'm pretty sure I'll box this up nicely - useful little gizmo indeed! Might add one more opamp to provide a balanced XLR output option first.

Merlin's been keeping me busy!
Title: Re: Mini DIY signal generator
Post by: tubegeek on November 05, 2019, 03:29:37 PM
So here's what I've been able to ascertain about my build so far - I tested the frequency ranges in each of my 4 switchable ranges. Range 1 covers 15.5 Hz to 160. Range 2: 150 - 1650. Range 3: 1500 - 14.4K. Range 4: 14K to about 15K.

Range 4 gets a little touchy - tuning upwards past a certain frequency, the amplitude drops out. Tuning back down until the amplitude picks back up to about where it was, I get to 15K. I rolled my own vactrol with an LED and a photoresistor, but I don't think this is the limiting factor for upper ƒ based on what I understand, the vactrol just affects level.

What *does* determine the maximum ƒ?

Anyway, Merlin's specs appear to be spot-on excepyt for the top range, which is said to reach 100KHz. I'm curious to know what might be limiting the top ƒ. I didn't measure level BTW, just sent it into my laptop so I could count peaks per second and determine ƒ's. I was using a 96K sampling rate in my audio interface so I should have seen something above 15K if it was there, I guess.

In all the ranges, at all frequencies (except as mentioned in Range 4) level stays VERY steady and the wave shape looks pretty damn sine-ish to me. If you bump up the frequency within a range, there is a VERY brief period of settling while the level overshoots a tiny bit and comes back down to where it had been.

My only difficulty getting it working at the outset was a brain fart: I wired the two switch poles incorrectly: the caps on one side were going up, while the ones on the other were stepping down. Once I noticed that it was all sweet and dandy. (I only had a 5-position switch, too, so I actually have one range that is just for DC sine waves.)

I'd say this thing is VERY much as advertised. What a useful simple little gadget. (I haven't tried adding a balanced/XLR output just yet BTW.) I'm particularly impressed by the accuracy of the overlap between ranges and their almost-exactly-decade spacing. Merlin, your slide rule appears to be properly lubricated.

I'm really glad I built this.

Thanks again for the wizardry, Merlin!
Title: Re: Mini DIY signal generator
Post by: PRR on November 05, 2019, 04:11:38 PM
Many links have rotted. Here is the project on Merlin's site:
http://www.valvewizard.co.uk/siggen.html
Title: Re: Mini DIY signal generator
Post by: PRR on November 05, 2019, 04:14:32 PM
> What *does* determine the maximum ƒ?

When the open-loop gain is not >> than required closed-loop gain. Because of the resistance ratios, you may need a really fast opamp to get out of the audio band.

However Merlin has far more hands-on experience with this plan and may have further insight.
Title: Re: Mini DIY signal generator
Post by: tubegeek on November 05, 2019, 09:12:26 PM
Thanks, PRR. I think it's a TL072 per the schematic, maybe try a 4558? Certainly swapping a chip is within my skill set. I'll look at the op amp comparison shootout page in The Art for clues....
Title: Re: Mini DIY signal generator
Post by: tubegeek on November 06, 2019, 12:08:30 PM
... seems like the TL072 is not the worst choice based on the features? "High" slew rate of 16, not sure what I'd find that'd better. I hope Merlin has a thought....
Title: Re: Mini DIY signal generator
Post by: merlinb on November 06, 2019, 02:34:01 PM
Quote from: tubegeek on November 05, 2019, 03:29:37 PM
I didn't measure level BTW, just sent it into my laptop so I could count peaks per second and determine ƒ's. I was using a 96K sampling rate in my audio interface so I should have seen something above 15K if it was there, I guess.
Hmm I'm not convinced a standard laptop soundcard is going to have a bandwidth beyond 20kHz?
Title: Re: Mini DIY signal generator
Post by: tubegeek on November 06, 2019, 08:59:29 PM
It's an external (USB) interface, only a cheap Behringer 2-in model but I'd expect it to go higher than 15K with a 96K sample rate. It's a reasonable question though - I'll hook the mini sig gen up to a scope (or run a different sig gen into the same interface) to see if I can narrow that question down. And using the scope I can get a reasonably accurate voltage measurement too.
Title: Re: Mini DIY signal generator
Post by: PRR on November 06, 2019, 09:55:42 PM
'4558 is *slow*. Errors (lack of excess gain) will mount above 1kHz. (It will "pass audio" much higher, but that's an easier job.)

I've seen $13 USB sound "cards" pass 19KHz fine, but I agree it is a point to check. A classic method is to jack line-out to line-in and run tones. I have used RMAA (http://audio.rightmark.org/products/rmaa.shtml) but it may be getting old. PassMark SoundCheck (https://www.passmark.com/products/soundcheck/) is reputable but I'm not sure what tests it does.
Title: Re: Mini DIY signal generator
Post by: tubegeek on November 07, 2019, 12:53:26 PM
Quote from: PRR on November 06, 2019, 09:55:42 PMA classic method is to jack line-out to line-in and run tones.

Great suggestion. Tried that with the computer playing tones out through the interface in one program, jacked into the interface and recording in another program. 50K was no problem, that's where I stopped.

With a fresh battery, I was able to get the Mini Sig Gen as high as 23K and record it but after that the signal again dropped precipitously. Does that tell us anything?
Title: Re: Mini DIY signal generator
Post by: Kevin Mitchell on June 12, 2020, 09:11:04 AM
Here's a layout of the bare bone version.
Link to PDF with transfer layout and bottom view (https://drive.google.com/file/d/1ZND9YOwFxJJNtzxI_yEC9dvnJ4JIs3Qd/view?usp=sharing)
(https://i.postimg.cc/1RqZ0rRX/SIG-GEN.png)


-KM