Function Generator - Page 1
Forum section: electronics / projects

author: aryasridhar
author_rank: Regular Contributor
timestamp: April 27, 2015, 07:47:04 am
content: Hi Guys,I checked various options for a function generator, but then I do not see anything that I can get without overly spending. I decided to go with building one for myself, I test frequency response of my guitar effects pedals so all I need is a good generator that can give me about 100Hz to 10Khz, that's my range requirement, however anything more is always goodCould someone advice a schematic, which is not overly complicated, since I need a simple build for the generator and I also need a Square/Sine/Triangle wave outs.Would highly appreciate if I could get some information on this please...also if the transistor/IC used is generic enough would be great, since availability of components is a pain in the arse here locally, and for one part I do not want to look up and get something imported.Some parts that I have at hand are, 2n2222, 3904, TL072, 2n5088 etc...

author: Thor-Arne
author_rank: Unknown
timestamp: April 27, 2015, 08:07:49 am
content: Something likethisperhaps ?

author: KJDS
author_rank: Super Contributor
timestamp: April 27, 2015, 08:08:20 am
content: Does your PC have a sound card?

author: smjcuk
author_rank: Frequent Contributor
timestamp: April 27, 2015, 08:37:50 am
content: Don't use a sound card - they're horrid.Quote from: Thor-Arne on April 27, 2015, 08:07:49 amNever managed to get a decently shaped wave out of the old three op amp circuits. Mathematically speaking, they work but the output leaves a lot to be desired.If you want an AF sine only generator, I've been using this for a number of years successfully powered off 2x 9v batteries or 24v DC linear wall wart and another 741 used as a virtual ground. Don't worry too much about the precisely specified bulb - it's pretty damn stable with any typical 12v bulb too. Does 7Hz to 70kHz and can be knocked up from junk box parts - TL072 should work fine:... distortion ~1%. I can't cite the source for this as I have no idea where it came from so if it's copyright, please let me know and I'll remove it and/or redraw it. If you need impedance conversion you can use any complimentary pair of transistors to buffer the output, else stick a pot as a voltage divider on the output to get it down to 1v p-p for audio and pump it straight into your pedal.I tend to just use a 555 RC timer or logic with a crystal and divider circuit for square wave, build a new oscillator for anything higher that kicks out sine waves from scratch (takes 5 mins with some practice) and never needed a triangle wave.Another great source of cheap/DIY function generator circuits is service manuals. The LG scope here has one on page 68. You can probably leave a lot of parts out and get away with it:http://freepdfhosting.com/f9744ba778.pdf

author: HKJ
author_rank: Super Contributor
timestamp: April 27, 2015, 08:53:27 am
content: On Ebay you can find some function generators for less than $30

author: JBaughb
author_rank: Regular Contributor
timestamp: April 27, 2015, 08:58:01 am
content: http://www.ebay.com/itm/1PC-DDS-Function-Signal-Generator-Module-Sine-Square-Sawtooth-Triangle-Wave-Kit-/251768575779?pt=LH_DefaultDomain_0&hash=item3a9e939723ECG = electrocardiogram wave (in the OFF state, the "left "and "right" keys to set the output frequency. Middle button start, all of the following waveform set)Rev Sawtooth = reverse sawtoothSawTooth = sawtoothTriangle = triangle waveSquare = square waveSpecification:Operating voltage: DC7-9VDDS frequency range: 1HZ-65534HzHigh-speed frequency (HS) output up to 8MHzDDS signal amplitude of the offset amount can be adjusted separately by two potentiometersDDS signals: sine wave, square wave, sawtooth, reverse sawtooth, triangle wave, the ECG wave and noise wave1602 LCD menuIntuitive keyboardSection into the value: 1,10,100,1000,10000 HzThe power automatically restore the last used configurationOffset: 0.5pp-5VppAmplitude amount: 0.5Vpp-14VppWeight: 120gColor: White

author: dom0
author_rank: Super Contributor
timestamp: April 27, 2015, 09:07:53 am
content: - Filter based sine oscillator (i.e. wien bridge, twin-T, state variable, ...)- You probably want electronic gain control instead of a light bulb, at least if you want good amplitude flatness down to lower frequencies- Switch ranges by switching filter caps- Tune with pot. Select one out of several with good matching- Square wave with fast comparator (easily done with a discrete differential amplifier)- For audio use a step attenuator and 0 ? output impedance is probably most usefulJust use NE5532/NE5534 for all op amps ; they're excellent. TL0xx are not overly good op amps for general purpose use, but will suffice, too.If you search thoroughly you'll probably find a used generator on eBay for less than you'd have to pay for a bunch of switches and a case alone, so I'd recommend going with that approach. If the performance isn't up to what you expect you can replace the oscillator core with something better...

author: smjcuk
author_rank: Frequent Contributor
timestamp: April 27, 2015, 09:32:24 am
content: Good recommendations.Amplitude is rather unstable across the frequency range on the design I provided. 1970s state of the art for youThe incandescent bulb works far better than any other circuit I tried including tempco resistors for frequency stability versus temperature and supply voltage though - was rather surprised. Can leave it a couple of hours in the sun and it'll hardly drift at all.

author: paulie
author_rank: Frequent Contributor
timestamp: April 27, 2015, 12:10:27 pm
content: So far suggestions are probably more expensive and complicated than necessary. The circuit below works very well from 10hz-100khz and with addition of a couple diodes produces excellent sine. Personally since there is virtually no perceptible difference between the two, I find no need for sine and find triangle adequate for audio work.If true sine is required then a simpler version of that light bulb phase shift circuit will do but IMO only for the purist.

author: aryasridhar
author_rank: Regular Contributor
timestamp: April 27, 2015, 03:41:25 pm
content: Quote from: JBaughb on April 27, 2015, 08:58:01 amWOW, i just placed an order for this, this particularly for the price suits me just well enough...I was in the local electronics market today trying to find one and found some cheapass ones, which were not at all good, just got back home and saw the replies...Thank You So Much all you guys.....

author: aryasridhar
author_rank: Regular Contributor
timestamp: April 27, 2015, 03:42:58 pm
content: Also, I sure am going to work on the circuits mentioned out here, especially the 2n3904 based one and the LG scope document one....just to try my hands at it....Infact I am working on one right now, i shall post more details here once I get it up and running, it is on the breadboard at the moment....

author: Lightages
author_rank: Unknown
timestamp: April 27, 2015, 06:04:41 pm
content: I don't know why you wouldn't just use the sound output of your computer. You get so much more flexibility and it costs you nothing.Visual analyzer is a good program:http://www.sillanumsoft.org/and it is free

author: dom0
author_rank: Super Contributor
timestamp: April 27, 2015, 06:40:17 pm
content: Some on-board sound cards are surprisingly bad in many aspects (mainly noise and jitter, THD seems to be a non-issue for nearly all devices).

author: ajb
author_rank: Super Contributor
timestamp: April 27, 2015, 07:16:18 pm
content: There are a surprising number of MCUs available these days with one or more onboard 12-bit 1MSps DACs, and plenty of flash to store lookup tables. For audio frequency purposes, that'd be a very tempting way to go for a small standalone device. In fact, I'd be surprised if there isn't already something out there for the Arduino Due.

author: Sigmoid
author_rank: Frequent Contributor
timestamp: April 27, 2015, 07:37:57 pm
content: While it's a cool project, you can in fact get a pretty usable Goldstar analog sweep function generator off of eBay for about $50. It's nothing to write home about, but at this price it's virtually free. There are lots of these things floating around, I got mine for $40.

author: aryasridhar
author_rank: Regular Contributor
timestamp: April 28, 2015, 05:14:49 am
content: Quote from: Sigmoid on April 27, 2015, 07:37:57 pmLiving in US has its advantages I guess, I can not find one at that price shipped to me

author: aryasridhar
author_rank: Regular Contributor
timestamp: April 28, 2015, 05:41:12 am
content: Quote from: Lightages on April 27, 2015, 06:04:41 pmWell, I have been using my android phone as a function generator so far, and it gets tough when I have to capture a reading or do a clip while taking measurements, also attending calls is an issue, my laptop is a company provided one and I cannot install any softwares on it other than what is needed by me at work..and now I am left with my iMac, which I can install stuff on, but having an iMac near my workbench is another issue...It is always good to have a dedicated device doing the thing for me...if it is cheap, that makes it much better..

author: ez24
author_rank: Super Contributor
timestamp: May 03, 2015, 04:07:48 am
content: Pls keep me updated on the ebay DDS generator if you are getting one - I ordered one and want to test it out[url=http://www.ebay.com/itm/1PC-DDS-Function-Signal-Generator-Module-Sine-Square-Sawtooth-Triangle-Wave-Kit-/251768575779?pt=LH_DefaultDomain_0&hash=item3a9e939723]http://www.ebay.com/itm/1PC-DDS-Function-Signal-Generator-Module-Sine-Square-Sawtooth-Triangle-Wave-Kit-/251768575779?pt=LH_DefaultDomain_0&hash=item3a9e939723

author: Maximus
author_rank: Contributor
timestamp: May 03, 2015, 10:04:50 pm
content: Im surprised no one has mentioned EXAR's 2206 IC. They are pretty easy to set up and use and cost about $2.http://www.uni-kl.de/elektronik-lager/416623

author: smjcuk
author_rank: Frequent Contributor
timestamp: May 03, 2015, 10:39:45 pm
content: Quote from: Maximus on May 03, 2015, 10:04:50 pmThey were pretty hard to get hold of a while back. Supply might have loosened up a bit now.

author: ez24
author_rank: Super Contributor
timestamp: May 03, 2015, 10:45:32 pm
content: I also have been looking at the XR-2206 but no cheap kits or pcbsbut I am going to order parts to build one on a 170 socket breadboard using small components (the pots and switches)FYI[url=https://www.jameco.com/Jameco/Products/ProdDS/20685%20Manual.pdf]https://www.jameco.com/Jameco/Products/ProdDS/20685%20Manual.pdf[url=https://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_20685_-1]https://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_20685_-1

author: rdl
author_rank: Super Contributor
timestamp: May 04, 2015, 12:45:49 am
content: I thought the XR-2206 was discontinued years ago. I wonder where they're coming from.edit: I just checked and they EOLed it in 2011.http://www.exar.com/files/changenotifications/pdn_11-0112-01-xr2206d-1033.pdf

author: yramgu
author_rank: Contributor
timestamp: May 05, 2015, 07:29:21 pm
content: The Wien-bridge oscillator is perfect for that. I built one as a school project back when I was a student, with a double-pot to tune the frequency. Works like a charm at audio frequencies! It produces a very clean sinewave (I was quite amazed by the result back then^^). Use a double op-amp and you can add a gain (or attenuator) stage to set the gain. Very educative project!The classic square/triangle generator suggested by paulie would also work: the spectrum of a triangle is very close to that of a sinewave. You wouldn't hear a difference, especially in guitar gear

author: Maximus
author_rank: Contributor
timestamp: May 12, 2015, 06:07:34 am
content: Quote from: rdl on May 04, 2015, 12:45:49 amNow Im sad, I liked that IC.