Pages: [1] 2 3 ... 6   Go Down
Author Topic: What is this amplifier doing, exactly?  (Read 4713 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm going to show my ignorance of how transistors work here, but whatever. I'm hoping to improve my understanding. smiley

I built up the audio amplifier from the Arduino Basic Connections thread (http://arduino.cc/forum/index.php/topic,154549.0.html) in particular this:



I didn't have a BC337 so I used a BC546 instead. I connected a 6 ohm speaker from an old portable radio/cassette player.

It worked great in that it gave nice loud amplification of the tones from the Tone library. Measuring the input signal (from the Arduino pin, in yellow) compared to the transistor collector (blue) shows the amplification isn't perfect, but not too bad.



Now my questions are:

  • What is the purpose of the amplifier? Impedance-matching? Current amplification? Voltage amplification?
  • Is the ringing around the rise and fall expected? Could it be improved somehow?
  • Are there any "gotchas" in there? Like, drawing too much current through the transistor, or something?
  • If I wanted to implement a volume control, what would be the recommended way of doing that?
  • Is the purpose of the 100K resistors to bias the transistor base?
  • What is the purpose of the 10 ohm resistor? To limit current?
  • Is the purpose of the 2.2K resistor for impedance-matching?

Logged

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

Quote
What is the purpose of the amplifier? Impedance-matching? Current amplification? Voltage amplification?

Impedance matching and current amplification is the save thing so a bit of all of them.


Is the ringing around the rise and fall expected? Could it be improved somehow?

It is due to the inductance of the speaker, it can be improved by a better transistor or amplifier


Are there any "gotchas" in there? Like, drawing too much current through the transistor, or something?
Yes it is quite a simple amplifier. I would include a 0.1uF cap between the pin input and the amplifier input.

If I wanted to implement a volume control, what would be the recommended way of doing that?
Put a pot directly on the output and connect the wiper through a cap to the input.


Is the purpose of the 100K resistors to bias the transistor base?
Yes


What is the purpose of the 10 ohm resistor? To limit current?
Yes

Is the purpose of the 2.2K resistor for impedance-matching?
No, it is isolating the bias circuit from the DC effects you get from the input pin, that is why I would use a cap because that removes it compleatly
Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I like that ABC guide a lot, but I would not use this circuit. I even think it is really bad.
If the output pin of the Arduino is not set as output, the two 100k resistors will turn the transistor on a little.
The two 100k resistors makes the amplification a little analog, but the Arduino output pin is purely digital.

So I would remove both 100k, and perhaps add a flyback diode over the speaker.

Nick, you can't rely on the measurements. The BC546 can do 100mA, and this circuits requires 278mA. The BC337 is a transistor that can handle 800mA.
« Last Edit: April 01, 2013, 03:33:34 am by Erdin » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The BC337 is a transistor that can handle 800mA.

Och, well I'm about to order a hundred or so. "Cheaper by the dozen" is the motto. smiley-wink
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The BC546 can do 100mA, and this circuits requires 278mA.

If you could explain that calculation I would be grateful.
Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I read the datasheets for the maximum current of the transistors.
The current is 5V / (10 + 8 ohm) = 278mA, assuming no voltage drop of the transistor and the transistor being fully on.
At 278mA the BC337 has Hfe of about 250. So the 2k2 will turn it into saturation.

The NPN BC337 is an old transistor.
The NPN BC639 is a little newer, it can do 1A, and it has the BC640 as complementary PNP.

These are the prices in my country (a piece)
BC547B : 5 euro cents
BC546B : 6 euro cents
BC337 : 10 euro cents
BC639 : 20 euro cents
« Last Edit: April 01, 2013, 03:28:34 am by Erdin » Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2809
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Mike the only point I'd disagree with you on is the input resistor and that is to limit the base current to a safe value. 2K2 is 50 times the "bias'" resistors and as such will have little effect on their operation.. A .1 to 1uF cap (depending on the desired low frequency response) should work well with the 30 k or so input impedance presented at the base lead.

Bob
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Italy
Offline Offline
Edison Member
*
Karma: 112
Posts: 1111
O ti distingui o ti estingui
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ciao,
The initial intentions were to make an amplifier as simple as possible (with only 1 cheap transistor).  smiley-grin
There are several modifications that can be done, especially include a capacitor between the input pin and the amplifier.
In the next few hours, i check it and i put an optimized one (with volume control  smiley-grin)

PighiXXX

Thanks for the support!
Checking diagrams is a good thing from you because for surely there are people better than me in this forum and together we can do a good job for everyone.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am extremely grateful for your insight.

@pighixxx - I am testing to check my knowledge is sufficient to understand your diagrams, and if things don't work perfectly I'm keen to understand why. Perhaps it's my fault.

smiley
Logged

Worst state in America
Offline Offline
God Member
*****
Karma: 23
Posts: 665
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I built up the audio amplifier from the Arduino Basic Connections thread (http://arduino.cc/forum/index.php/topic,154549.0.html) in particular this:

That amplifier is a "Class A" amplifier. Theoretically, it is supposed to be biased so that with no signal, the collector sits at about 1/2 Vcc (so that it can swing UP to VCC and DOWN to GND).

The resistors on the base circuit create a bias (base current * beta = collector current) to keep the transistor conducting (that is, in a Class-A mode).

The top bias resistor is connected to the collector to provide NEGATIVE feedback and stabilize the bias. That is, if the bias is too "strong", the collector will go lower and decrease the base bias, thereby self-stabilizing the circuit.

I would try this for fun: Remove the 2.2K resistor between the Arduino and the transistor base and replace it with a 1 uF (not critical) capacitor (positive side to the transistor base).

Here's a sketch I made for another guy a while back to explain Class A and Class B amplifiers. Hopefully this will help:

(edit to add): If you take the "Class A" sketch and invert it so that the "spring" is at the top, that is basically the same as your circuit - and BJT vs MOSFET doesn't matter - they both do the same jobs - albeit in a different way.

(edit to add more): Notice that the Class B amplifier "rope" needs to be taut, otherwise there will be a small "dead zone" where the speaker doesn't move. The tension on the rope is the bias, and if there isn't enough bias and the rope is loose, the dead zone on the speaker is called "crossover distortion".


* amplifier1.jpg (92.59 KB, 1280x640 - viewed 57 times.)
« Last Edit: April 01, 2013, 07:56:56 am by Krupski » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23739
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Nick,
This is the amplifier I have in my fencing scoring machines, driven by a burst of Tone to make a nice two-tone warble when a touch is scored (sounds like cell phone ring).
Can probably replace the MOSFET with NPN too. (The IFR3707Z apparently went obsolete right after I bought a sleeve of 10.)

When input is Low, transistor is off, cap keeps any DC from flowing into the speaker, but the yellow wire sits high.
When input is High, transistor turns on, pulls cap low to move speaker one direction.
When input goes back high, the cap goes high and the transition thru the cap drives the speaker the other other direction until the cap charges up again.
So Tone makes a nice sound with this MOSFET and speaker. The 68 ohm resistors were an attempt at high/low volume control - my wife says it is still way too loud.


* MOSFET_amplifier.jpg (42.88 KB, 960x495 - viewed 55 times.)
* IRF3707Z.pdf (265.49 KB - downloaded 10 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23739
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the speaker. I am quite happy with them.
http://www.mpja.com/4-Ohm-Mini-Speaker/productinfo/14618%20SP/
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, actually, not "quite" a Class A design. Class A is intended to bias the transistor
into its linear region of operation, but you'll never get that with the ckt as shown.

It looks like the person who designed it had the intent of Class A, but you would need
a resistor in the emitter lead, so the 100Ks on the base have something to bias in
a stable fashion. As it is, they simply turn on the transistor, and whether or not the
collector sits at Vcc/2 is strictly a factor of the hFE [beta] dc current-gain of the
transistor.

But there is a much more serious problem with this design, namely that there will be
a constant dc-bias on the speaker and a non-trivial amount of dc-current continually
running through it. Not good, the speaker can burn up. Instead, speakers should be
AC-coupled through a large capacitor with a ckt like this - ie, attempted Class A. And
unfortunately, that cap needs to be a large value, eg 220 uF, to get proper low-
frequency response, since the speaker impedance is so small.

Also, with a proper Class B, as Krupski mentioned, the positive and negative drive
ckts will be adjusted so the DC current through the speaker is 0, so that takes care of
the problem of continuous current burning up the speaker.

Advice - throw this ckt away, use something better.
« Last Edit: April 01, 2013, 01:32:44 pm by oric_dan » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the comments everyone!

But there is a much more serious problem with this design, namely that there will be
a constant dc-bias on the speaker and a non-trivial amount of dc-current continually
running through it.

Why is there that current (which incidentally the scope trace appears to agree with)?

If the transistor is "off" it shouldn't be conducting, should it? Or does the biasing keep it on? I guess it must be that, because on the scope it looks like when the input signal is off, the output signal is around 2.2V.
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the comments everyone!

But there is a much more serious problem with this design, namely that there will be
a constant dc-bias on the speaker and a non-trivial amount of dc-current continually
running through it.

Why is there that current (which incidentally the scope trace appears to agree with)?

If the transistor is "off" it shouldn't be conducting, should it? Or does the biasing keep it on? I guess it must be that, because on the scope it looks like when the input signal is off, the output signal is around 2.2V.
Yes, that's it. If you remove the 100K pullup, and keep the 100K pulldown - to keep
the transistor turned off, and then capacitively couple the input signal, as others have
mentioned, then the transistor will stay off when no signal is present. Then, you also
don't need to capacitor-couple the speaker.

However, you'll only ever get square-wave outputs [ie, rasty sounding things] from
your speaker.

It is possible to get sweeter sounding audio using the Arduino. Would require going to
a true Class A amplifier ckt [or more complex Class B, etc, as Krupski mentioned], and
then using high-frequency PWM, modulated at a lower audio rate, and then using
low-pass filters ahead of the amplifier to smooth out and anti-alias the PWM. 
 
Logged

Pages: [1] 2 3 ... 6   Go Up
Jump to: