Pages: [1] 2   Go Down
Author Topic: Is this an appropriate circuit to drive my 8 ohm speaker using PWM?  (Read 5154 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Fezes are cool
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I was wondering if the circuit below will be able to drive a 0.2 W speaker?



The capacitor is used to remove the DC offset from the PWM output, and the voltage divider is used to reduce the vpp to 1 V. The 10 kOhm resistor is to reduce current to the OPAMP, and 20 kOHM is to multply the input by 2 so that the output wil be 2 V peak to peak. The transistors in the feedback loop helps to supply the required 125 mA to the speaker.

I don't have an scope to test this out, so I'm wondering if someone can verify that this circuit will not blow up.

Thanks,
s3n4te


Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like it will function OK to me. I would use a audio taper pot on the input signal to give one a volume control. Keep in mind that there will be some 'cross-over' distortion in your output when the signal passes through 0vdc and neither transistors are conducting. 'Hi-Fi' class A/B amps usually apply a little dc bias such the both transistors are conducting a few milliamps with zero signal so that there is a smooth transistion between positive and negative cross-over. However as you are feeding this amp stage square waves anyway it's not like you won't have terrible odd order harmonic distortion anyway. Now if you did some low-pass filtering before the input stage and fixed the cross-over bias you might get musical quality tones through the thing.

Lefty

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Fezes are cool
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Would feedback cause the output to compensate for deadzone problem?
« Last Edit: February 28, 2011, 06:55:07 pm by s3n4te » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Would feedback cause the output to compensate for deadzone problem?

No. Recall your transistor basics. The emitter/base junction will only conduct when the applied voltage is greater then around .6vdc, so there is a time while the signal is moving from 0 to .6v that the transistor can't conduct. This is the source of the so called cross-over problem as one transistor stops conducting and the other starts conducting.

Any basic description/drawing of class AB amplifiers will explain the DC bias set-up where neither transistor is allowed to completely turn off no matter what the signal value is. In essence the amplifier runs in class A (at a low continuous current flow) until the signal is high enough to 'take control' of the conduction transistor and so enters class B operation.

Lefty
« Last Edit: February 28, 2011, 07:03:28 pm by retrolefty » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 506
Posts: 31345
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Why have you drawn 12v batteries all over the place?
You just need a +12 rail and a -12v rail.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Fezes are cool
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I understand why there is distortion if there is no opamp there, but not when there is an opamp with the output is connected back to inverting input of the opamp. The output would always equal to the input * gain no matter if the transistors off when input is -0.7 -- +0.7V? Is this correct?

Edit: I did a Fourier analysis at the output with 10khz sine wave, and the THD is only 1.3%.
« Last Edit: February 28, 2011, 07:44:58 pm by s3n4te » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I understand why there is distortion if there is no opamp there, but not when there is an opamp with the output is connected back to inverting input of the opamp. The output would always equal to the input * gain no matter if the transistors off when input is -0.7 -- +0.7V? Is this correct?

Yes the opamp feedback circuit will try and correct the situation, but then the output of the amp isn't the real reflection of the input signal (+ gain) for short period of time around zero input signal. It causes a 'notching effect' at zero crossing that is easily seen on a scope and can be heard if one knows what to listen for. Again just read up on basic audio amplifier circuits using discrete components and you will learn all there is to know about the subject.

 Modern IC audio amplifier chips do the same thing inside to eliminate the problem. Again this is a classic problem for any amplifier using bipolar voltage push-pull output stage, which allows DC coupling to the speaker. A single ended amp stage does not have this problem, but are very inefficient running in continuous class A operation (50% current flow with zero audio signal) and have to be capacitance coupled to the speaker.

Lefty
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Fezes are cool
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I add active low pass filter would that cause my output wave to be triangular?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I add active low pass filter would that cause my output wave to be triangular?

Not for frequencies below the cutoff design frequency of the filter. Not sure how you are processing audio information via PWM output. Is this using some kind of PCM signal? Or are you just ramping up and down the PWM duty cycle using a audio sine wave table?

It's hard to design an effective filter unless one knows the signal format being used.

Lefty
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
the output of the amp isn't the real reflection of the input signal (+ gain) for short period of time around zero input signal. It causes a 'notching effect' at zero crossing that is easily seen on a scope and can be heard if one knows what to listen for. Again

Absolutely true. However, if s3n4te is only listening to square waves out of an Arduino, he probably won't even notice it.

I told him that.  

Not clear why one would string all those discrete components together to make a low-power amplifier when you can get an LM386 for less than the price of a pack of chewing gum?

Maybe he is trying to learn how to design audio circuits, it's still an honorable task. The 'golden ear' audiophiles still frown on using opamps or ICs in general in their megabucks systems, go figure.

PS: In his circuit he is taking the feedback signal not from the opamp output, but rather right from the speaker output tap, which is common for such audio amps.

 

« Last Edit: February 28, 2011, 08:57:07 pm by retrolefty » Logged

Offline Offline
God Member
*****
Karma: 32
Posts: 506
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can improve the crossover distortion by trying to keep the transistors biased. Try adding a few resistors as shown to see if it improves things. You will need to experiment with the exact values, that's half the fun of building amplifiers.


* F0NAs.jpg (210.17 KB, 960x587 - viewed 43 times.)
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Fezes are cool
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay after taking your recommendations, I have adjusted the circuit to resemble this:



The diodes are to provide the dc bias to prevent crossover distortion, the pot for volume control, and 22pF cap for active low pass filter. What do you guys think?
Logged

Saint Petersburg, Russia
Offline Offline
Full Member
***
Karma: 2
Posts: 105
Amateur
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using the following scheme:

http://sites.google.com/site/vanyambauseslinux/_/rsrc/1298081054520/electronics/arduino-generator-signalov/fast-pwm-sound2.png
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What do you guys think?

Yea, dump the 1k and 4k resistors, just wire the pot's wiper to the 10k resistor.

Time to melt some solder?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


That's a rather Lo-Fi approch, but with square wave input who cares, it will make noise.  smiley-wink
Logged

Pages: [1] 2   Go Up
Jump to: