Author Topic: 555 or Op-amp?  (Read 4924 times)

0 Members and 1 Guest are viewing this topic.

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ca
  • He has the stink of oil and electric circuitry...
555 or Op-amp?
« on: March 17, 2019, 02:33:35 am »
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? :horse:
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 555 or Op-amp?
« Reply #1 on: March 17, 2019, 03:58:56 am »
Sounds like you've got some reading to do. Do you have any books on basic electronics?

1MHz is 1,000,000 Hz.
 

Offline beanflying

  • Super Contributor
  • ***
  • Posts: 7375
  • Country: au
  • Toys so very many Toys.
Re: 555 or Op-amp?
« Reply #2 on: March 17, 2019, 04:09:57 am »
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 example https://www.youtube.com/user/w2aew/search?query=generators

https://youtu.be/Kqb5zcrgv7s

When 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




Coffee, Food, R/C and electronics nerd in no particular order. Also CNC wannabe, 3D printer and Laser Cutter Junkie and just don't mention my TEA addiction....
 
The following users thanked this post: Kilroywashere, SM3VLC

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: 555 or Op-amp?
« Reply #3 on: March 17, 2019, 04:10:52 am »
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 ....
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: 555 or Op-amp?
« Reply #4 on: March 17, 2019, 04:11:55 am »
Oh wow this looks great!!! Ill look in to this ! Thank you so much!
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: 555 or Op-amp?
« Reply #5 on: March 17, 2019, 08:42:06 am »
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.
 

Offline nucleopolymere

  • Contributor
  • Posts: 21
  • Country: ca
Re: 555 or Op-amp?
« Reply #6 on: March 18, 2019, 02:30:05 am »
Without worrying too much about precision both design with op amp and 555 should work fine at these frequencies.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: 555 or Op-amp?
« Reply #7 on: March 18, 2019, 01:23:20 pm »
Without worrying too much about precision both design with op amp and 555 should work fine at these frequencies.
That'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 under 1/50 of 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. the dv/dt

dv/dt = V/t = 5/200*10-9 = 25*106V/s or 25V/µs

Most 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.pdf
http://www.ti.com/lit/ds/slos080n/slos080n.pdf

There 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.pdf
http://www.ti.com/lit/ds/symlink/lm311.pdf
 
The following users thanked this post: Moriambar

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5569
  • Country: us
Re: 555 or Op-amp?
« Reply #8 on: March 18, 2019, 01:42:31 pm »
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.
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: 555 or Op-amp?
« Reply #9 on: March 18, 2019, 09:10:56 pm »
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's

with 2 10KΩ, 3 100KΩ, 22KΩ, 220KΩ resistors
33nF, 10nF ceramic capacitors


This 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)
« Last Edit: March 18, 2019, 09:18:17 pm by Kilroywashere »
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2762
  • Country: us
Re: 555 or Op-amp?
« Reply #10 on: March 18, 2019, 09:55:59 pm »
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.)

   
« Last Edit: June 05, 2019, 10:09:07 pm by MarkF »
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: 555 or Op-amp?
« Reply #11 on: March 18, 2019, 10:08:50 pm »
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.  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.)



I 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 display


Pic 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
« Last Edit: March 18, 2019, 10:37:43 pm by Kilroywashere »
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2762
  • Country: us
Re: 555 or Op-amp?
« Reply #12 on: March 18, 2019, 10:38:59 pm »
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.  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.)


I 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 display

Pic 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?

A 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.
 

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2762
  • Country: us
Re: 555 or Op-amp?
« Reply #13 on: March 18, 2019, 10:48:19 pm »
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.
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: 555 or Op-amp?
« Reply #14 on: March 18, 2019, 10:55:20 pm »
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.)

   



Is 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 ....
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: 555 or Op-amp?
« Reply #15 on: March 18, 2019, 10:59:49 pm »
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.

the 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...!
« Last Edit: March 18, 2019, 11:07:09 pm by Kilroywashere »
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2762
  • Country: us
Re: 555 or Op-amp?
« Reply #16 on: March 19, 2019, 12:33:14 am »
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.)

  . . .

Is 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 ....

It would but I don't think the ATTiny has a DAC. ??   Also, you will need two DACs.  One for amplitude and one for the DC offset.  The MCP4812 has two DACs inside.
My prototype used a MCP4802 which are 8-bit DACs.  I went with the 10-bit version because I wanted a little finer control.  They are not very expensive.  The killer in the design is the $12USD AD9834 DDS chip.

You can use any size screen you want.  A 16x2 screen seems small.  You would need to scroll through all the inputs required and you would not be able to display all the settings at one time.  It's whatever you like and how creative you are at displaying and getting the user inputs.  The rotary encoder I use has a push button to change between 'input' mode and 'item selection' mode.

The PIC18F2550 has 32KB of memory and the C code is currently using 93% of it.
« Last Edit: April 19, 2019, 12:10:49 am by MarkF »
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23099
  • Country: gb
Re: 555 or Op-amp?
« Reply #17 on: March 19, 2019, 08:17:16 am »
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.pdf

After 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.
« Last Edit: March 19, 2019, 08:22:04 am by bd139 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf