DIY Function Generator consideration - Page 1
Forum section: electronics / beginners

author: Fcolor04
author_rank: Contributor
timestamp: May 21, 2023, 11:59:18 am
content: Hello, I'd like to ask for advice, youtube videos, written articles, anything that can help me with designing a function generator, I saw some projects during my search that use MAX083 as a brain of their function generators, I don't think I will be able to get my hands on one and even if I did I'd like to make a more involved solution, my considerations are to either use high bandwidth opamps or 2x 8bit SRAM with a microcontroller & 2x shift registers to set it up each boot. The problem is that I don't have much of practical experience with electronics I've only built a barely working class D amplifier and my knowledge is like a swiss cheese so I have no clue if any of these is actually going to work, with experimentation I found that I have no idea what value C should be in integrator circuit and how it limits the bandwidth and I have little idea how op amp bandwidth is decreased as the opamp gain increases, with sram & microcontroller I'd like to have 1MHz and 16bits output but as I said I dont know how possible is that, with opamp solution I'd aim for 10-100MHz max output frequency, is this too ambitious of a project for a begginner? Should I buy some EE books first? Can I learn this on teh internet? plz help

author: Kleinstein
author_rank: Super Contributor
timestamp: May 21, 2023, 01:35:55 pm
content: 10 - 100 MHz is too ambitious, not just for a beginner.For a start I would more think about 0.1 to 1 MHz. Another point to likely compromse is with the output amplitude - it gets a lot easier with some 10Vpp instead of the old days 20 Vpp.The max038 is obsolete for a long time - never was really available for a significant time. The prior ICL8038 is also obsolete. The 3rd classic Fgen chip XR2206 is also obesolete as an original, but there seem to be an Chinese copy / revival that is available in kits. It seems to have some problems (with higher supply) but could be a way for a simpley DIY solution.If really needed one could build a similar generator from separate parts, but it is quite some effort.Modern generator usually use DDS for the sine signal. One could get board with chips like AD9850 to use for a sine generator to some 20 MHz. There are also some minor issues with some of the boards, but they should at least run. The DDS was often does not support triangle wave and the square wave may need an extra comparator.

author: Anthocyanina
author_rank: Frequent Contributor
timestamp: May 21, 2023, 02:20:41 pm
content: you might want to look at this project. I built it, and built a discrete class A amplifier for it and got around 20MHz of usable bandwidth.https://www.instructables.com/Arbitrary-Wave-Generator-With-the-Raspberry-Pi-Pic/

author: MrAl
author_rank: Super Contributor
timestamp: May 22, 2023, 05:22:27 pm
content: Quote from: Fcolor04 on May 21, 2023, 11:59:18 amHello there,As a beginner i would recommend starting off with a smaller, simpler project, and go from there. This is the usual way people learn electronics anyway. I'd say even start with a 555 timer chip and just get it up and running, either on a prototype PC board or a solderless breadboard. The last option there is faster and you can disassemble when you are done if you like. You do have to get familiar with soldering however.The 555 timer chip is very versatile, so you can use it for other things, even a square wave generator, that's what made me think of this chip because you are after a function generator.Of all the waveforms, the sine is the most complex to generate. That's because it needs to be smooth and curvy while other waveforms are pretty much just straight lines. There are different ways to generate a sine wave, but i think you should save this for after you've done some simpler projects like that 555 timer and maybe some simple op amp amplifiers.Not sure how much math you had so far. Algebra will get you pretty far before you have to get into calculus and differential equations. Algebra is commonly used for formulas and general circuit analysis and computing the values of resistors, capacitors, and the like. If you buy an EE book it should be based on the highest math you know right now. I can recommend some but i dont know how much math you have had yet.You can always keep asking questions here too i see there are many people willing to help.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: May 22, 2023, 07:35:11 pm
content: XR2206. You can find plenty of Chinese clones, with write up’s on how to make it right and get the specified results. Or you can find originals at Jameco.

author: coromonadalix
author_rank: Super Contributor
timestamp: May 22, 2023, 09:48:42 pm
content: i have all of them loll originals not the crapina fakesxr2206xr8038aaaaaaaaand the Max038 4x of themthere was a time you could get some samples from them ... managed to get 4x, never made projects ...yes you can build some basic dds projects .... there was one with an Arduino due i think, very powerfull but not much on output amplitude levelstons of dds boards on ebay ... arduino codes etc ... but you still miss an output amplifier ...

author: radiolistener
author_rank: Super Contributor
timestamp: May 23, 2023, 12:35:47 pm
content: Quote from: Fcolor04 on May 21, 2023, 11:59:18 amyes, that is ambitious even for equipment manufacturers. You can count manufacturers who produce such function generators on your fingers.You can start with 10-100 kHz. Build generator with clean output for 10-100 kHz is also not trivial task, but at least you can omit many complicated issues related with RF and other questions and it will be much more easier.Note, that generators such as XR2206 has serious issues with glitches, so their output is not clean.The good way is to build generator based on Wien bridge sine wave oscillator.For example:https://www.analog.com/en/technical-articles/injection-lock-a-wien-bridge-oscillator.html

author: Kleinstein
author_rank: Super Contributor
timestamp: May 23, 2023, 04:02:17 pm
content: There are different generator options.1) the triangle based generator like XR2206 and similar or a discrete solution (many older good solutions). These have a not so great sine quality and a good triangle wave. There is also the option to have frequency modulation.2) Wien bridge (or similar) based generator produce a clean sine wave. Depending on the effort used this can be a very clean one.However there is no triangle wave and already a square wave needs an extra comparator.3) DDS based generators (as special chips like AD9850) or low low speed also in software with a µC. These can provide a very stable frequency, but primarily only a sine wave with an often relatively good quality. If they offfer a triangle of saw tooth it is usually of relatively poor quality. A good square wave would need an extra comparator. FM modulation is possible from the digital side.Depending on what the generator is used for the typical glitch found in nearly all XR2206 based Fgens looks a bit funny but is often not a big issue and in times of 1 channel scopes even had its positive side as a phase marker.

author: MathWizard
author_rank: Super Contributor
timestamp: May 24, 2023, 12:16:42 am
content: Here's a good video series on making a DIY or mostly DIY (you might want to order a PCB) signal gen. I can't remember the spec's, but it's made with ADC's and DAC's and with an LCD screen and MCU, etc (maybe I'm mixing that up with their PSU tho). Nothing too expensive. But that video says it only uses the XR2206. Some good ideas either way.

author: jwet
author_rank: Frequent Contributor
timestamp: May 24, 2023, 04:23:07 pm
content: My 2 cents worth of comments-The XR2206 and ICL8038 were limited to about 2 Mhz and used a multisegment triangle to sine converter that could just barely muster 1% THD.The MAX038 is indeed very long gone. It was made as a custom to supply an auxilliary sweep or modulation generator for Wavetek IIRC. It was priced ridiculously and wasn't sampled because every college student sampled them in the beginning and tied up the apps lines at Maxim. It was withdrawn for similar reason- no one really bought them. I was at Maxim when it released.DDS is the way to go and very clever. The ADI parts only generate sines and squares, you have to roll your own if want more versatility- usually using an FPGA- not a terribly hard problem in VHDL. There are prepackaged little chinese generators like this (Feeltech) that use an FPGA, a discrete "12 bit" R-2R DAC, a color display and a decent output driver for about $75. Amazing. I put the 12 bits in quote because its not really...My other advice is to get a service manual for a near modern generator like the HP33120A or the like. This uses DDS techniques and has a very nice output stage using pretty generic parts that I would copy- I think it tops out at 15 Mhz IIRC. A 100 Mhz signal generate is extremely ambitious.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: May 25, 2023, 12:00:18 am
content: As OP statedQuoteIMO anything beyond the 2206 is too ambitious. Plenty of learning opportunity to get a 2206 hobby gen right. Also gives a good runway to work with oscilloscope.

author: schmitt trigger
author_rank: Super Contributor
timestamp: May 25, 2023, 01:15:17 am
content: My exact opinion, too.One must learn to walk before running a marathon.My first fun-gen employed an XR2206. It was an excellent challenge which takes a while to tweak it right. But very achievable for an electronics novice.