Instructables

Analog Function Generator

Featured
SDC10016.JPG
Are you sick of 555 timers? I sure am. That's why I decided to build a semi-decent function generator as my term project in my analog electronics course. This design is capable of producing a square, triangle, and approximate sine wave reliably up to a frequency of around 300kHz.

Make It Real Challenge
This project has been entered in the "Make it Real Challenge", which awards a 3D printer to the winner. "To enter, post an Instructable that shows how to turn a virtual item into a tangible object." I believe this project qualifies, since I spent a significant amount of time modeling the circuit on my computer before going on to the build stage. This Instructable does cover how to model a circuit (final step) and it does require the etching of a Printed Circuit Board based on that computer model. If you like my project, please rate it and vote for me!

Yes, there are chips available that achieve MUCH better results with a simpler circuit, but they are essentially "black boxes" that use digital methods to convert a voltage to a frequency. This circuit is fully understandable with algebra and rudimentary calculus and op-amp knowledge. Since this project is for an "analog electronics" course, this fit the bill.

Here's a breakdown of roughly how long it took to complete each stage of the project:
  • 10 Hours: Initial design, including EagleCAD entry, board layout, and computer simulation.
  • 3 Hours: Part sourcing.
  • 5 Hours: Project box design, prep, painting, and labeling.
  • 1 Hour: Initial PCB component placement
  • 2 Hours: Connecting the PCB to the control panel.
  • 20 Hours: Troubleshooting and component revision. Seriously.
  • 1 Hour: Calibration.
  • 1 Hour: Characterization.
This doesn't include the time I spent thinking about it while engaged in some other activity. I have a lot of experience troubleshooting lab equipment so the amount of time it took me to get this thing working surprised me. All the revisions I made are included in this Instructable, so it should work right off the bat, but be prepared to work a little.

This is nothing you'd want to rely on if you need any kind of precision, it's just a cheap, quick and dirty source of time-varying signal. Another reason I wanted to make a function generator is just to have another piece of ghetto lab equipment worthy of my growing collection.


 
Remove these adsRemove these ads by Signing Up

Hi Laserjocky

Ok, I've got the generator working quite well thanks for your advice.

I've simulated it on java and LT-spice and got similar results so I think everything is ok.

I would like some advice on a few points,1)I need to pass a current of 20 amps through the transistors into the primary winding of a (12v)trafo {sinewave}

I've had a look at the data sheets of the TL084CN which can output 1.4-2.8ma,that drives the base of the transistors which in turn pass 250ma through a 35ohm resistor(Tip 31&32 can pass3A).Correct me if I'm wrong.If I lower the resistance,more current passes through but it seems to be distorted on LT-spice,then you exceed the max output of the TL084CN.Are these more or less the limits of your generator?

Is there a way I can achieve this,i am working with Swagatam on his web page[homemadecircuitsandschematics} towards making an inverter

Regards Robin

laserjocky (author)  robinpeter7043 days ago

You want to drive 20 amps? Adjusting resistor values isn't going to cut it. Never try to draw more than a few mA from these small op-amps or other chips in dual in-line packages (DIP). That's probably where your distortion is coming from. You need bigger transistors. TIP35C and TIP36C may be acceptable replacements for the TIP31 and TIP32, respectively, if you stick them on a massive heat sink. If you go much bigger you start having to pay close to $10 per transistor. Most inverters use high speed MOSFETs running on pulse-width-modulated square waves. You can get 50amp MOSFETs for about $5, but you really don't want to drive those with a sine wave. The problem with generating a sine wave at 20A with these transistors is that when the signal isn't completely on or off, the transistor will be dissipating a huge amount of power. 12V x 20A = 240W. These suckers are going to be HOT.

You also need to be careful about hooking the output of this directly to a transformer. Primary windings can have a few tenths of a Henry (unit) of inductance. If you try to drive AC through that with transistors alone you will probably destroy them immediately because of residual current in the winding trying to pass through transistors in their off state. At the very least you need a capacitor across the winding, but that presents its own problems. If you were using a fully offset square wave you could put a reverse biased diode across the winding and that would pretty much solve the problem, but that won't work for a sine wave with no offset.

Hi laserjocky

I made this function generator and it works.

The capacitor that goes to ground after IC2A,is it polar or non polar,text says non-polar diagram says polar?Experiencing a lot of noise at output of IC1B,Square wave at output of IC1A okay,am investigating.

Thanks,will keep you up-dated

Robin

laserjocky (author)  robinpeter70425 days ago

Excellent! I'm glad to hear it's working for you. Yes, the 270pF capacitor should be non-polar. Use a ceramic capacitor there, one of the little brown disc ones. Anything close to 240p should work. That capacitor acts as a frequency cutoff to help smooth the sine wave at higher frequencies. It's not essential so anything close will work. But don't put in something as big as 2400p, or you might cut off too low of a frequency.

If pin 1 of IC1A is behaving well then pin 7 of IC1B should be ok. Make sure your connections on R3, R4 and TR2 are good. Sometimes trimpots (variable resistors) can have grit in them that makes the signal noisy. Try moving the knob a little. Also make sure you have the resistor values correct. The gain of IC1B should be g = R4/(R3+TR2). You want g ~ 1/10.

Hi Laserjocky

Wonderful design,Could you tell me what you connect across the internal gain select of the intergrator,I put a capacitor there as it must integrate?

Regards Rob

laserjocky (author)  robinpeter7041 month ago

Yes, that's right. Further in the instructions I describe making a 2-deck rotary switch to change the capacitance across the INT GAIN SELECT pins and FREQ SELECT pins simultaneously. To get the full frequency range of this project to show up as a sine wave it's important to be able to change the capacitance of the integrator, since op-amp integrator gain is inversely proportional to both input frequency and capacitance, i.e. g = 1/(wRC).

In the schematic, R5 is the R considered in the gain term, C is implied by INT FREQ SELECT, and R6 is put in to eliminate non-ideal integration drift.

Hi Laserjocky

Wonderful design,Could you tell me what you connect across the internal gain select of the intergrator,I put a capacitor there as it must integrate?

Regards Rob

Samimy2 years ago
great project ! awesome, i love it even more while you used the pc power supply casing for that project. that is cool and strong.
laserjocky (author)  Samimy2 years ago
Thanks! Yeah these things are great. They'd be perfect for RF projects since they're basically a Faraday cage. I'm thinking of making a solid state tesla coil with one in the near future too. No more fried electronics.

did you start the work on the solid state tesla coil, and is there a link to this work please thanks

laserjocky (author)  kevtoms491 month ago

I started working on it a long time ago. I managed to get a few small sparks from the top coil but nothing amazing. The project fell into disrepair after I got tired of blowing pairs of $5 MOSFETs every half hour. I think I had looked at http://www.instructables.com/id/Solid-State-Tesla-Coil/ for help in building it.

tadusmc1 year ago
Great Job! One question that I need clarified - on the 2 deck 6 position switch - not sure what you mean by "notch the ring". Please explain further thanks
oppie2 years ago
I assume that your Eagle files were version 6 (opened the files with notepad++ and saw the leading XML declaration). I have a registered copy of eagle professional version 5 and have refrained from loading version 6 until I can cough up the license fee. I know that there is a freeware version but the danger for us users of version 5 is that (accidentally) opening a v5 file with eagle 6 will convert it to the V6 format and is non-reversible. Most of my files are too large to edit in freeware mode. So... will stick to you PDF files for now.

Last time I played with a function generator, I used the ICL8038 chip. Alas, that, the X2206 and the MAX038 are no longer available. That leaves only variations of what you designed. The new wave (pun intended) is frequency generation with DDS.
you can simply make a copy somewhere else and open the copy with V6, that way only that version is converted into v6... voilá problem solved
laserjocky (author)  oppie2 years ago
Let me know if you need a reprint of anything, I didn't take the version discrepancy into account.

Yeah, I've used a chip called an NTE864 that's similar to the one you listed. They're definitely easier to use if you just need a function generator. But I'm still trying to break the habit of wanting to understand everything :)
wgerstmann2 years ago
I am 73. I began fixing computers in 1960 - 64k memory, only paper tape input and output. Machine language programming.
My point is analog computers are the future! Digital computers will get faster and smaller but still must simulate analog situations, like traffic control.
You are on the right track! Stay with the basics and keep avoiding black boxes - they are dead-ends but are useful timesavers after you have mastered the basics.
sonrie692 years ago
awesome, man... i was looking for this kind of project for a while... one question: is posible to index or to change the freq selector to make it CV (voltage controller)?? could you help me ???
laserjocky (author)  sonrie692 years ago
I'm not sure what you mean, you want something that changes the frequency based on a reference voltage instead of an RC rise time? I don't know off hand of an analog method for doing that, but there are digital-based chips called voltage controlled oscillators that do that kind of thing.
shinyshadow2 years ago
Great little project, although I'd guess you'd be getting cross over distortion without any bias on the two output transistors. If the generator is to be used as an audio gen' then perhaps you could use a TDA2030 chip or some lower power chip even, also have you solved the spiking problem, perghaps a 100nF cap across the supply lines as close to the TL084 as possible might do the trick.

Great again, all the best :)
laserjocky (author)  shinyshadow2 years ago
Thanks shadow! That's true, I was expecting to see quite a bit of crossover at higher frequencies where the negative feedback begins to break down, but it actually does very well. The whole project functions almost flawlessly over the human audible range, and only gets really messy towards 100-200kHz. The spiking problem was greatly reduced but not eliminated by decreasing the order of magnitude of the offset potentiometer. The power transistors are kind of a hack so using a chip that's actually designed for audio output would probably be a good idea.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!