Go Down

Topic: Op-Amps as Sine wave generator (Read 2430 times) previous topic - next topic

BabyGeezer

Going a bit off-topic, but you did mention Fourier and the joy of learning...

These videos from 3Blue1Brown's channel on YouTube are a real delight:
But what is the Fourier Transform? A visual introduction
and Uncertainty principle? It's not about quantum
ahh, 3Blue1Brown - i've watched some of his "easier" videos - introducing complex numbers and various pi-related concepts - i really like his delivery style, thanks for those - i'm probably a bit better prepared now to start watching those !


No most op-amps are not suitable for driving a speaker. There are specific audio amplifier chips like the LM1785T, LM386 or the TDA2030A. But these need components round them and most need a large decoupling capacitor on the supply. Download the data sheets to see recommended circuits
that YouTube guy also had a tutorial on making a simple amp with the LM386 chip; thanks for those ref. nos. - will check them out and study the datasheet and try to learn what the LM324 lacks.


You might want to look at this:- https://www.maximintegrated.com/en/app-notes/index.mvp/id/5590
wow  - that looks good, thanks !
(didn't know the Class-es went beyond 'D' !)

Hi,
Can you post a picture of your current circuit, so we can see your component layout and a copy of the schematic?

Thanks..  Tom... :)
as you wish Mr. George :)
not sure how much you can make out though;


TomGeorge

Hi thanks;
Which circuit is it?
The original LM324 circuit?

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

BabyGeezer

#32
Feb 25, 2018, 02:30 pm Last Edit: Feb 25, 2018, 02:40 pm by BabyGeezer
Hi thanks;
Which circuit is it?
The original LM324 circuit?

Tom... :)
the attempted replication of the original (Quadrature Oscillator) circuit as per my schematic in reply #2.
(sorry, forgot to mention this in the earlier reply)

have been trying to make sense of the datasheets and it seems the LM324 is really quite "weak" with no mention of Watt-age anywhere, or Power Output - closest i could find is 40mA "Output Current".

whereas the LM386N-1 at Vs=6V and RL = 8 Ohm puts out a 'typical' 325mW.

i guess the LM324 isn't really meant to be used for audio circuits. (just re-watched the video and realized the circuit is never actually shown, just a mention of "connect via earphones" :/ )


EDIT:
FWIW - this is from the video ;

sneaky fella doesn't show the circuit with the speaker :(

runaway_pancake

"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

Grumpy_Mike

Quote
just a mention of "connect via earphones"
The thing is that earphones are not all the same. These days they tend to be the same sort of impedance as speakers, but their are other types that are much high impedance. There are the "crystal" earphones like this:- https://en.wikipedia.org/wiki/Crystal_earpiece

and high impedance diaphragm earphones similar to the handset you used to get on land line telephones, or from army surplus stores High impedance earphones

Even so these present an inductive load and might stop your oscillator from working because of this.

Best get something like this :- https://en.wikipedia.org/wiki/Computer_speakers

allanhurst

See enclosed for a 'quick an dirty' loudspeaker driver.

It has lousy distortion, but will make a noise....


Allan

Grumpy_Mike

Well it has a lowish input impedance, that might affect the oscillator.

allanhurst

#37
Feb 26, 2018, 04:56 am Last Edit: Feb 26, 2018, 05:12 am by allanhurst
True. It'll take < +/- 10mA peak - most opamps should handle that. Could increase the resistor value .

Worth a try if you've got a few common components knocking about?

Obviously you'd need a 5v supply capable of > 1/2 amp or so  to drive it.

Allan

TomGeorge

#38
Feb 26, 2018, 09:45 am Last Edit: Feb 26, 2018, 09:49 am by TomGeorge
Hi,
I built this circuit;

I got it to work, but even with a good new protoboard, I ended up mounting the major components close to the board with trimmed leads.
For Rs I used a 10K fixed resistor.
Use 5V from USB to UNO.

My meter measured about 1.44kHz, and using the 1uF output cap into an el-cheapo flat 16R speaker, it was not loud, but the speaker could be heard.

Some pics.



Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

TomGeorge

#39
Feb 26, 2018, 11:19 am Last Edit: Feb 26, 2018, 11:22 am by TomGeorge
Hi,
I downloaded this real simple Arduino Scope prog;

https://electronicsforu.com/electronics-projects/pc-based-oscilloscope-using-arduino

Just used as 5V on A0.
Scope display of pin1 of LM324

It looks like most of the readings are in the right ball park.

Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

BabyGeezer

...
and high impedance diaphragm earphones similar to the handset you used to get on land line telephones,
...
Even so these present an inductive load and might stop your oscillator from working because of this.
BINGO !!
i knew keeping that old phone would come in handy !
(even has a 32 Ohm speaker as a speaker-phone, bonus electret microphone too !)

i also measured the speaker in the handset itself and it registered about 100 Ohm on the multimeter.

both speakers functioned (finally!!) when i connected it to the 555-square wave generator, adding a 0.1 uF cap in series between 555-output pin and the speaker.

*BUT* :(

still fails on the 'Quadrature Oscillator' circuit - even tried switching the cap from 1 uF to 0.1 uF.


See enclosed for a 'quick an dirty' loudspeaker driver.

It has lousy distortion, but will make a noise....
thanks - will get the components and give that a go.
the Arduino pin is just to be able to control "on/off", "high/low" "sound/silence", right ?
the current power supply i'm using gives out 500mA.

Hi,
I built this circuit;
...
I got it to work, but even with a good new protoboard, I ended up mounting the major components close to the board with trimmed leads.
For Rs I used a 10K fixed resistor.
Use 5V from USB to UNO.

My meter measured about 1.44kHz, and using the 1uF output cap into an el-cheapo flat 16R speaker, it was not loud, but the speaker could be heard.

great that it worked for you !

i see you added an extra (1 uF?) cap on the power rail for decoupling.

i suppose i should also trim my leads, they're really extra long on the caps.



Hi,
I downloaded this real simple Arduino Scope prog;

https://electronicsforu.com/electronics-projects/pc-based-oscilloscope-using-arduino
that looks good - will definitely give that a go !
Thanks !

Grumpy_Mike

Quote
i also measured the speaker in the handset itself and it registered about 100 Ohm on the multimeter.
The sort of headphones I was thinking of had an input impedance of 1K.

When you tried the 100R and it did not work, did you look at the oscillator on the scope thingie? Was it still oscillating?

BabyGeezer

The sort of headphones I was thinking of had an input impedance of 1K.
i see - even higher, huh ?

what spec should i be looking at (comparing the 555 with the LM324) when one can produce sound, and the other cannot - are we talking about power output here ?


When you tried the 100R and it did not work, did you look at the oscillator on the scope thingie? Was it still oscillating?
argh - i'd forgotten about monitoring it with the Arduinoscilloscope...
anyway, i checked it again - without the speaker, and then migrated to the PCscope program - *again* thanks a big bunch, TomGeorge - it really saves the extra step in having to plot it in the spreadsheet !!

it was all still, until i "jiggled the pot" - quite the finicky circuit as you hinted at earlier.

then some oscillation sprung to life - plotted several wave forms coming out of Pin1 (of LM324) but nothing changed when connecting the speaker (100R) - not even a sparkle - there's just no (very little) current(?) coming through ? (i tried measuring with the multimeter on AC mode and it didn't even make it to "1 V" :/ )

here are those 3 different plots at various pot-positions - maybe some of you experts recognize what is going on there.



i'm assuming that there is no need to change the circuit anymore - i was thinking of trying to replicate the positions exactly as TomGeorge built his - but since we can confirm the waveforms are coming through confirming oscillation, it means the circuit is working - just not providing an output recognizable by any speaker i have at the moment.

would trimming leads and rebuilding the circuit more compactly, squeeze more juice out of it ? (if 'insufficient juice' is indeed the issue at hand)

Grumpy_Mike

Quote
would trimming leads and rebuilding the circuit more compactly, squeeze more juice out of it ?
No.

Quote
it means the circuit is working - just not providing an output recognizable by any speaker i have at the moment.
Yes the "at the moment" seems to be the problem. There is no reason why you should not hear something if the speaker is not loading the oscillator AND it is connected correctly. Get yourself an ACTIVE speaker, that is one that needs a power supply.

I would check your speaker wiring again while all the time monitoring the signal using the Arduinoscilloscope. You can even try moving the input of the Arduinoscilloscope to measure across the speaker to measure what the speaker is seeing, swap over the speaker and capacitor so one end of the speaker goes to ground. If you still get a healthy voltage across it and you can't here it either the speaker is broken or your ears are.  ;)

TomGeorge

#44
Mar 04, 2018, 08:06 am Last Edit: Mar 04, 2018, 08:10 am by TomGeorge
Hi,
Did you try replacing the pot with a 10K resistor?

I think the protoboard may be the problem, I had trouble until I shortened the leads, so its more a mechanical connection symptom than a layout problem.

Tom... :)
PS. That simple Oscilloscope is good isn't it.
Everything runs on smoke, let the smoke out, it stops running....

Go Up