555 or Op-amp?  - Page 1
Forum section: electronics / beginners

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 17, 2019, 02:33:35 am
content: Hello world!Just a quick one I guess I have been in to function gen's recently, and I want to build one.Feels like a good project to do for a beginner, my question is I have like tonz of 555 timers and a handful of op-amps.I seen a 555 square wave gen 1hz-100khz I assume that's not alot right? i assume an op-amp is better for this sort of thing right? I find alot more designs with op amps and not too much with 555 timers ....I dont know alot about Hertz and i think this will help me understand a little better like Whats faster mhz or hz?anyway...I know im dumb but someone will help me understand some stuff right?

author: james_s
author_rank: Super Contributor
timestamp: March 17, 2019, 03:58:56 am
content: Sounds like you've got some reading to do. Do you have any books on basic electronics?1MHz is 1,000,000 Hz.

author: beanflying
author_rank: Super Contributor
timestamp: March 17, 2019, 04:09:57 am
content: Try this one of Alan's videos for a start as you have some Opamps and 555's to play with. Also do watch a bunch more of his AAA+ rated. This will help you with your own playing/learning on the bench.Some on this search for examplehttps://www.youtube.com/user/w2aew/search?query=generatorshttps://youtu.be/Kqb5zcrgv7sWhen you are ready for something a bit more complete try Scullcom Hobby's videos. The IC it is based on is a fun one to play with on a breadboard at lower frequencies (Breadboads SUCK at higher frequencies!) Pt1 and Pt2 and also a more recent version MKII.https://youtu.be/D3OGcUU1oGE

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 17, 2019, 04:10:52 am
content: You know it ... and yeah i got a few books ... i have a learning disability so sometimes it just does not sink it ya know? ask me about gas fitting and im your man... i mean im not a dumb guy it just takes a good teacher for me to understand ... i grasp alot of things but yeah anyway.... besides the point ....

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 17, 2019, 04:11:55 am
content: Oh wow this looks great!!! Ill look in to this ! Thank you so much!

author: Zero999
author_rank: Super Contributor
timestamp: March 17, 2019, 08:42:06 am
content: Op-amps aren't normally used to generate squarewaves. A comparator is used instead. An op-amp can be used as a comparator, but it's not optimal.A 555 timer is generally better suited to generating a square wave, than an op-amp.

author: nucleopolymere
author_rank: Contributor
timestamp: March 18, 2019, 02:30:05 am
content: Without worrying too much about precision both design with op amp and 555 should work fine at these frequencies.

author: Zero999
author_rank: Super Contributor
timestamp: March 18, 2019, 01:23:20 pm
content: Quote from: nucleopolymere on March 18, 2019, 02:30:05 amThat's a bit of a blanket statement. It's also untrue: an op-amp is no good for squarewaves, above the audio range.Yes, a 555 timer will be fine for a 100kHz squarewave, but many common op-amps will struggle with that higher frequency. The issue is the slew rate needs to be high enough to get decent rise/fall times. A 100kHz signal has a period of 10µs. To get a decent squarewave, the rise and fall times need to be under1/50of that figure, which is 0.2µs or 200ns.What amplitude squarewave do you want? Let's say 5V maximum, to be compatible with TTL digital logic.Calculate the slew rate, i.e. thedv/dtdv/dt= V/t = 5/200*10-9= 25*106V/s or 25V/µsMost jellybean op-amps will not do here. The old 741 has a slew rate of only 0.5V/µs and even the much faster TL072 isn't up to it either at 13V/µs.http://www.ti.com/lit/ds/symlink/lm741.pdfhttp://www.ti.com/lit/ds/slos080n/slos080n.pdfThere are much faster op-amps available but they're more expensive.A comparator will do a much better job, but some attention still needs to be paid to the speed. The LM393 has a rise and fall time of 300ns from 0V to 5V, which is still a bit on the slow side, but much better than any chap op-amp. The LM311 is much better still with rise and fall times of well below 100ns, from 0V to 5V.http://www.ti.com/lit/ds/symlink/lm2903-n.pdfhttp://www.ti.com/lit/ds/symlink/lm311.pdf

author: CatalinaWOW
author_rank: Super Contributor
timestamp: March 18, 2019, 01:42:31 pm
content: I think the real answer to your question is to use both. As you build the circuits and watch how they work you will learn the differences in a way that none of our answers to the questions will provide. At the low frequencies you are working with you may also want to look into other possibilities, the old Exar chip, stored waveforms read from a ROM and generation in software on a microprocessor like the Arduino. There are literally dozens of ways to skin this cat, and all have advantages and disadvantages. Many people find hands on experience the best way to learn. Don't be ashamed of your own differences.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 18, 2019, 09:10:56 pm
content: Hey guys thanks for all the info! I think you guys are very smart ( a 555 has a comparitor inside it maybe thats why is good for the first part?) This pic is i guess what it would look like to put them together .... there is no values just wanna know if the set up is good....I have one ne555 followed by two lm741'swith 2 10KΩ, 3 100KΩ, 22KΩ, 220KΩ resistors33nF, 10nF ceramic capacitorsThis is for the opamp section .... my question is i dont have many ceramic caps .... is there other common ceramic caps i can use? or can i use two electrolytic caps to replace lets say the 10nf? maybe a stupid question ..... most cer caps i have are like 10,20 pico f ? 60, 151,221, 104( i think thats 100nf)

author: MarkF
author_rank: Super Contributor
timestamp: March 18, 2019, 09:55:59 pm
content: If you would like something more advanced, take a look at a function generator I did with a PIC18F2550 microcontroller, AD9834 DDS chip and a MCP4812 Dual 10-Bit DAC. 1Hz to 10MHz at 5Vpp. Output sine, triangle, square, sine sweep, triangle sweep and PWM waveforms. (Still working on PWM waveform. I may not be able to get the code to fit in the PIC.)

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 18, 2019, 10:08:50 pm
content: Quote from: MarkF on March 18, 2019, 09:55:59 pmI have seen a few with atmegs 328 and i seen one with an atmega16 I was kinna hoping to do this analog style .... DDS its called right?http://www.electronics-lab.com/project/dds-function-generator/This is the one i saw it looked very nice !If i was going to add an atmega328 i would only like to use it for a LCD displayPic is still out of my capability ... i have a k150 and i have never been able to get it to work....I tought since i have alot of 555's and a few op-amps i would go analog ...If you have seen any designs that good let me know ....Yours looks very neat tho....im have never messed around with a DAC before i dont think Thats a digital to analog converter right?So I guess you get the wave from the pic and the DAC changes it to an analog signal and feeds it to the op amps... and the op-amp amplifies the signal?https://hackaday.com/2018/03/02/tiny-function-generator-on-the-attiny85-complete-with-oled/this one uses a attiny85 ... thats cool

author: MarkF
author_rank: Super Contributor
timestamp: March 18, 2019, 10:38:59 pm
content: Quote from: Kilroywashere on March 18, 2019, 10:08:50 pmA DAC is a digital-to-analog converter as you say. It performs the same function as the R2R resistor ladder network that feeds the op-amps in the circuit you linked to.The MCP9812 has two DACs and is controlled via a SPI interface. The DACs in my design control the amplitude and DC offset of the analog output.The AD9834 generates the sine, triangle and square wave set by the PIC.The PIC also generates the frequency sweep, sweep start trigger and PWM outputs (at TTL levels).There is no reason my design could not use an Arduino instead of the PIC.Here is a picture of my prototype.

author: MarkF
author_rank: Super Contributor
timestamp: March 18, 2019, 10:48:19 pm
content: The ATTiny example is very flexible in the number of waveforms it generates. Essentially, an arbitrary waveform generator. I did it with a PIC16F877A some time ago. However, it is very limited in the frequency that it can generate. I seem to remember that I was only able to generate a maximum frequency of 15KHz with the PIC's max clock freq of 8MHz.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 18, 2019, 10:55:20 pm
content: Quote from: MarkF on March 18, 2019, 09:55:59 pmIs the 10 or 12 bit DAC on the attiny85 Good enough for your design, could i use that in place of the MCP4812 ?? and can i use a 16x2 lcd screen ?I could use the atmega328p in place of the pic ....

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 18, 2019, 10:59:49 pm
content: Quote from: MarkF on March 18, 2019, 10:48:19 pmthe issue i have with that one is i dont have a 4pin pot .... yours look great tho.... would like to build it just dont have a dds chip...!

author: MarkF
author_rank: Super Contributor
timestamp: March 19, 2019, 12:33:14 am
content: Quote from: Kilroywashere on March 18, 2019, 10:55:20 pm

author: bd139
author_rank: Super Contributor
timestamp: March 19, 2019, 08:17:16 am
content: One good starting point for building a function generator is the old Heathkit ET3100 design. It’s basically an opamp wein bridge oscillator and a power amplifier on the output. The thing also has a simple square output. Schematic here:https://www.nostalgickitscentral.com/heath/schematics/heathkit_schema_et3100.pdfAfter you’ve built it you can add a couple of useful features very easily by adding a pot and opamp: offset and amplitude control.The IC in the design is an LM741 for ref. That’s good to about 20Khz. Most things will work here (don’t use an LM358 though). An LF356 will get you up to about 100KHz or so. The light bulb can be pretty much anything under about 20 volts. You just have to adjust the trimmer for lowest distortion.The difference between this and other designs is it’s actually quite useable as a real bit of test gear. Before I had any money I used this design for about 5 years assembled from scrap.