Function generator using opamps

adam555

Joined Aug 17, 2013
858
Hie. How can i build a function generator from op-amps
I've also been looking for weeks for a simple one with just opamps or transistors, but I couldn't find any that I liked; as this one for example http://www.circuitstoday.com/simple-function-generator-circuit:



I need one with all the options offered by "real" function generators, and none of those would provide them. For example, this one above doesn't even let you select the frequency.

I decided to make one based on the 8038, which are really easy to understand and tune to suit your particular needs, and you can get them on ebay for just £1.

By the way, I'm trying to attach a display, which consists on a CD4047 multivibrator and some CD4026 with 7-segment LEDs. But when I connect it to the output of the function generator it interferes with the signal -the pulses generated by the CD4047 to measure the frequency messes up the output of the 8038... quite a lot. Anyone knows how can I fix this problem? I was thinking of isolating both circuits with something like optocouplers, but I'm not sure it will work at high frequencies. Which is the best way, or the proper way, to do it?
 
Last edited:

WBahn

Joined Mar 31, 2012
30,062
Have you considered buffering your outputs so that follow-on circuitry can't affect the sensitive analog nodes in the timing circuits?
 

adam555

Joined Aug 17, 2013
858
Thanks WBahn, I don't know what buffering is, so I'll have a look on the internet to see if I can find an example of how to use it in my circuit.

This is basically how it's going so far. I'm combining various circuits together, so the only part I'm using from this one is the display (CD4047, CD4026s, and the 7-seg displays). I'm using a regulated power supply -instead of the one below- and another design based on the 8038 for the core of the frequency generator (though I tested that one exactly as it is, and got the same problem; also tested it with a 555 and with the oscilloscope's calibrating pulse, and also got the same interference):



I noticed that I can sort of minimize the problem by limiting the frequency range; if I add an additional resistor on the low frequency side of the frequency selector pot the interference nearly fades-. But that's not the solution I was hoping for, since there would be a gap on the ranges.

By the way, can anyone please explain what's the function of D1 and R7? I think I understand what C11 does, but what's the purpose of a diode and a resistor in parallel with ground?
 
Last edited:

Nykolas

Joined Aug 27, 2013
115
The problem with the circuit in post #4 is that the 8038, 4047 and the 4026s are obsolete parts. The circuit should be redesigned to use currently available parts. E
 

adam555

Joined Aug 17, 2013
858
I know. :)

There's a notice at the top of the 8038's datasheet that reads:
OBSOLETE PRODUCT
NO RECOMMENDED REPLACEMENT

But after looking for 2 weeks on the internet for a cheap and easy to understand circuit with all the features I wanted, I realised that the 8038 would be perfect for my first function generator.

About the 4047 and the 4026s: to be honest, I didn't search much; I just found in one of those 8038 circuits one with a display and it used those ICs. And they were also cheap and easy to put together.

I'm sure this will not be my last function generator... I'm already finding some drawbacks, and I haven't even built it.
 

adam555

Joined Aug 17, 2013
858
One of the drawbacks, for example... and sorry, but I hope I'm not hijacking the thread... is that the display blinks too slowly. And I mean: really slow. At the lowest range it's 1 second on and 1 second off; and I can't figure out how I'm going to solve it.

I configured it for a range from 50Hz to 300KHz; but at 50Hz, for it to display 50, it needs to count 50 pulses, and obviously, that takes it 1 second; so it's a cycle of 1 second with the display blank while it counts, and then 1 second displaying the frequency. This doesn't happen with higher ranges, as the rate multiplies by 10 on each one (e.g. 0.1s, 10ms, 1ms, and so on).

Is there an easy way to solve this issue without raising the minimum range?
 

Nykolas

Joined Aug 27, 2013
115
It does not blink on /off once per second, it refreshes the display at that rate at the lowest frequency display setting. Also note that the DP at that rate is at 00009.9 Hz. Refresh rate for 0099.99 Hz would be 0.1 sec. E
 
Last edited:

adam555

Joined Aug 17, 2013
858
It's twice as bad; it actually refreshes the display every 2 seconds -1 second on and 1 second off-. I mean, the output is high for 1 second, and low for another one... is there anything I can do?
 

Nykolas

Joined Aug 27, 2013
115
There is little point discussing a circuit for a new build that has obsolete parts (my cmos data book is from 1991 and does not show these parts). Find a design which uses currently available parts and let's start over. There are 100s on the internet! E
 

GopherT

Joined Nov 23, 2012
8,009
There is little point discussing a circuit for a new build that has obsolete parts (my cmos data book is from 1991 and does not show these parts). Find a design which uses currently available parts and let's start over. There are 100s on the internet! E
That is true for production builds, but for a hobby build, that comment makes no sense at all - especially since all he has all the parts - and, because all of these obsolete arts are commonly available as NOS.

Also, "no mention in a 1991 book?" Who is obsolete?

Adam555,
You might want to simplify your devices and make one frequency generator and a separate frequency counter (best done with a PIC).
 
Last edited:

THE_RB

Joined Feb 11, 2008
5,438
Here is one suitable for audio frequencies. It only needs one IC (a PIC micro) and has the benefit of being very easy to build, and makes very accurate frequencies which are all decimal Hz locked (ie 100.00 Hz, 200.00 Hz etc).

The sine wave shape is very nice (as well as being xtal locked to exact frequency!);



http://romanblack.com/onesec/SineDDS.htm

Frequency ranges and adjustment step size;
5Hz to 1kHz, step 5Hz
1kHz to 2kHz, step 10Hz
2kHz to 4kHz, step 20Hz
4kHz to 8kHz, step 50Hz
8kHz to 20kHz, step 100Hz
(The range adjustment is all automatic, all you need to do is adjust the frequency UP/DOWN with the buttons.)

Note- these frequencies are accurate enough to use to calibrate your own frequency meter, if you do build a separate frequency meter. But the meter is usually not needed as the function generator will lock to exact decimal frequencies.
 

adam555

Joined Aug 17, 2013
858
Try adding supply decoupling caps (0.1uF ceramic) directly across the supply pins of each IC.
Yes, someone else already told me to put decoupling caps between the supplies of the ICs, and one cap on the multivibrator fixed the problem.

Adam555,
You might want to simplify your devices and make one frequency generator and a separate frequency counter (best done with a PIC).
Here is one suitable for audio frequencies. It only needs one IC (a PIC micro) and has the benefit of being very easy to build, and makes very accurate frequencies which are all decimal Hz locked (ie 100.00 Hz, 200.00 Hz etc).
I'm planning on getting a PIC programer pretty soon and start learning how to use it, but for now I prefer to stick to basics. The the purpose of this project is to learn as much as making a function generator.

I was also thinking about testing a display through arduino; but not for the final device, just as a test so see how it would work with a PIC.

In any case I'm keeping all the modules separated, in case I decide to modify or change any of them in the future.
 
Last edited:
Top