# What is this amplifier doing, exactly?

oric_dan:
5V/10ohms = 0.5 Amp.
5V*5V/10ohms = 2.5 Watts.

Brilliant. Thanks for that. Now I see where your signature line comes from.

oric_dan:
Plus, it’s much much worse if you’re not providing enough base drive to saturate transistor.
Worst case, 1.25 watts → transistor=poof!

There is enough drive. You keep talking about situations that, unless your a total zonk, should never occur. What if you attach the power to your Atmega328 backwards? What if you try to monitor a 12V signal directly? There are so many things you could do wrong, so I am not sure where you are coming from on this. That circuit is up a n running in my lab. It does not get hot, explode or glow if used the way it was intended. Just like so many things.

oric_dan:
Read post #43.

Just because you said something from the OneD TenT file earlier does not make it any more realistic if you reference it again. You simply execute a digitalWrite(LOW) to the pin in question once you are done making pretty sounds. This is so obvious I’m embarrassed to have to spell it out.

Again, it you are a total zonk, then I could suggest some small alterations to the circuit that should allow it to deal with your shortcomings.

1. Put a DC blocking capacitor on the input. This will require the addition of a cap and a resistor
2. Use a 3W resistor on the collector

… and … change the base resistor to 500 ohms.

However, none of this is necessary as it works just fine as it is. BTW, any Canadian beer is better than Old Milwaukee!!

Even this guy know what I’m talking about.

On BILLO's circuit. According to the Fairchild datasheet for a 2n2222a, Vce(sat) is 1V for "large" currents. That means that a maximum of 1V will be dropped by the transistor and a minimum of 4V will be dropped by the resistor. That puts the max collector current at 4V / 10R = 400mA. That means the resistor will be dissipating 4V * 400mA = 1.6W which will exceed the resistors max dissipation. The 2n2222a will be dissipating 1V * 400mA = 400mW which will exceed the derated maximum dissipation for the transistor as it heats up. Tell me where I got it wrong please.

I think I've entered the twilight zone.

Okay, one more time.... I did not design the circuit to be turned on and left that way.

So, since every single person who looks at this is assuming that they will be forced against there better judgement to use it incorrectly, I will update the design and test it to make sure it is idiot proof.

BillO: I think I've entered the twilight zone.

Okay, one more time.... I did not design the circuit to be turned on and left that way.

So, since every single person who looks at this is assuming that they will be forced against there better judgement to use it incorrectly, I will update the design and test it to make sure it is idiot proof.

I intended no offense, just offering up my thoughts and trying to be sure that I understand the circuit. :) When it comes to these microcontrollers, anything can happen. The output pin being left high wouldn't be an unusual situation during development, so how else should the circuit be analyzed? I'm thinking that just adding a blocking cap on the base along with a pulldown and it should be well protected from DC. At 50% duty cycle, everything should be fine, but you might want to use a smaller resistor on the base since hfe at large currents is as low as 20, unless I got it all wrong.

I do understand what you are saying, at least partially. I'm not sure where you got the hfe of 20. My spec sheet (Farichild 09/99) states a worst case hfe of 40 @ 500mA and shows a typical of around 80 @ 500ma. The transistor I am using actually measures at 121, but that is besides the point. Looking at DC characteristics in a circuit like this is pointless. The average current through the transistor is much less than 500ma. In fact, at 400hz the circuit only draws about 200ma.

I've come up with a 'better' circuit that will be (almost) idiot proof. I am just going to build it and test it to make sure it meets the design specs. However, I am cannot seem to come up with fool-proof design based on the simple switch we've been discussing here, so the new circuit is an AC-coupled class 'A'. I'll post the schematic when I'm done the tests.

Oops, you’re right the minimum hfe is around 40. But average current isn’t the point, this is about idiot-proof non-self-destructive design. If the average is 200mA then the max is 400mA which will melt things if it gets stuck on.

I don’t see any need for a class A amp, common emitter class B should be plenty good enough and use less power. Sound quality certainly isn’t the issue. An emitter follower would be good enough I think.

Sounds like the discussion has come back around to this.
AC coupled, transistor turns off when Input gets held High or Low, no DC going thru the speaker either.

I have 5 of these running, I have two Tones to make a nice output warble like a loud cell phone ring. Have been running since Jan 2011, so 2+ years. Ignore the header/switch at the top left, just use a series resistor from V+ to the transistor.

This article goes into depth of the single gate amplifier. Scroll down to page 8.

We don’t need it biased to operate in the linear region since the tone output is either on or off - hence the amplifiers output can be on or off as well.

Yeah, like Crossroads showed. Class B and no wasted energy with DC idle currents.

afremont:
Oops, you’re right the minimum hfe is around 40. But average current isn’t the point, this is about idiot-proof non-self-destructive design. If the average is 200mA then the max is 400mA which will melt things if it gets stuck on.

Well, I’m not sure that would be self-destructive. In any case, as I said before, just rate the collector resistor at 3w. Problem solved. But read on…

afremont:
I don’t see any need for a class A amp, common emitter class B should be plenty good enough and use less power. Sound quality certainly isn’t the issue. An emitter follower would be good enough I think.

Class ‘A’ because I’m sure someone will likely find fault with any other solution. Since they have not seen it before, they will assume it just doesn’t work. Not that they won’t find fault with a class ‘A’. Also, class ‘A’ will only require a couple of extra parts. Since the very simple was apparently too simple, why not go the extra step and make it something everyone can look up and wrap their heads around. BTW, I can’t seem to get my head around an emitter follower solution. Not that it won’t work.

So, below is the class ‘A’ I came up with. Draws 210mA @ 5V and delivers 125mw into 8ohms from 20Hz to 6KHz. Has typical single stage class ‘A’ distortion on sine a triangle waveforms and is biased to start clipping more or less symmetrically at Vin = about 4.5V. Square waves produce an expected over-shoot spike which is controlled by C3. If you don’t care about the over-shoot, you can leave C3 out. The over-shoot on square waves causes and appreciable increase in gain at frequencies above 6KHz. Increasing C3 can help with this.

It works as described and does not get hot, explode, glow, kick the dog or beat the wife despite what you may believe. You can leave the drive pin high or low as you wish. If you want to prove it is does anything other than what I’ve stated, build one and show me actual results. So, all you ‘Bash Street Kids’, have at it.

CrossRoads: This article goes into depth of the single gate amplifier. Scroll down to page 8. http://www.ece.ucsb.edu/Faculty/rodwell/Classes/ece2c/labs/Lab_2_2C_2007.pdf We don't need it biased to operate in the linear region since the tone output is either on or off - hence the amplifiers output can be on or off as well.

I agree.

... I will update the design and test it to make sure it is idiot proof.

From a practical viewpoint, this should be Rule #1, since everybody who's ever done anything at all knows how large the idiot population really is.

oric_dan:

... I will update the design and test it to make sure it is idiot proof.

From a practical viewpoint, this should be Rule #1, since everybody who's ever done anything at all knows how large the idiot population really is.

"Make it idiot proof and someone will make a better idiot."

I have a card at home that someone here in the forum sent me 2 years ago that uses a 754410 H-bridge chip as the amplifier.

http://www.ti.com/product/sn754410

retrolefty:

oric_dan:

... I will update the design and test it to make sure it is idiot proof.

From a practical viewpoint, this should be Rule #1, since everybody who's ever done anything at all knows how large the idiot population really is.

"Make it idiot proof and someone will make a better idiot."

Yeah well, such is life in the trenches. OTOH, adding one small feature can have an enormous impact - case in point, the input cap on the ckt being discussed here ad infinitum. Leave off that cap and the consequences can be easily disasterous.

For years, all of my pcbs have used simple series-R protection on the I/O pins, and no one ever blew up one of my boards [at least that owned up to it]. OTOH, back in the days of yore, another guy was selling similar boards with no protection and all smt parts, and every single day on the associated forum, some poor guy came on crying he had blown his xxxx board. Some designs are "more" idiot-proof than others, I guess.

For years, all of my pcbs have used simple series-R protection on the I/O pins, and no one ever blew up one of my boards [at least that owned up to it]. OTOH, back in the days of yore, another guy was selling similar boards with no protection and all smt parts, and every single day on the associated forum, some poor guy came on crying he had blown his xxxx board. Some designs are "more" idiot-proof than others, I guess.

No finer example of design for protection then the Ruggeduino. There is a lot one can learn from reading it's schematic.

http://ruggedcircuits.com/html/ruggeduino.html

http://ruggedcircuits.com/AM010/am010.pdf

There are a lot of good features on the ruggeduino board. One can argue about this, but from my years of experience, the single most important one is the series-Rs in the I/O lines. Those alone save the microcontroller 20 different ways.

oric_dan: From a practical viewpoint, this should be Rule #1, since everybody who's ever done anything at all knows how large the idiot population really is.

While I agree 100% with you on this, this exercise was never meant to be a production item. It was meant as something for Nick to try out as a short term experiment.

To make a short story long, back in the early eighties I ran a small company that wrote software for DEC PDP-11 mini-computers. We had just finished a self maintaining parts/sales/service/accounting package for motorcycle and power equipment dealerships. One of the things we were most proud of was the UI. We had tested that to within a inch of it's life with every imaginable input scenario. It was rock solid and it had the capacity to learn. To reduce the error rate it would analyze the data being input and compare it to what had already been input and verified and suggest auto-completion hints. It really was an achievement. We even had one of a largest customers do beta, release and acceptance testing for 3 months. We did further acceptance testing with 3 additional clients. Everyone was impressed. It improved data entry speed and accuracy by huge amounts.

Shortly after we had put it into full time use at all our customer sites, I took a trip out to see how things were going at our biggest site. I was talking to the accountant about his impressions under actual use conditions and he told me that things were never better. He even told me that he figured out how to run the general journal batch update instantaneously! I was quite surprised at this as it would normally take about 5 minutes to back everything up, do a referential integrity check on the input data tables, commit all the transactions, run all the report transactions and get ready for the month-end adjustments. So I asked him how he did that. So he told me. "Just after selecting 'Update' from the menu I just hit the 'ctrl' key and the 'c' together. Then it flashes "Finished" for a second and returns to the main menu."

It turns out that there was about 10 seconds while the jobs were being submitted to the batch queue that it would accept a ctrl-C and abort the control file. He was essentially just quitting the process before it even got started. No one had imagined that scenario. No one even knew that the ctrl-C trap was being disabled during that short process. When we asked how he figured this out, all he could tell us was that he found it by accident. Luckily is was an accumulative procedure, and could be run as many times as you liked ... as long as it was run at least once before month end. We had to rewrite the UI to all disable input for that 10 seconds.

There is always a more ingenious idiot.