Here is a basic tone() amp that I have wired up. Currently, R1 gets really hot even in brief pulsed tones every 5sec. R1 is a somewhat beefy 10w resistor but it still gets hot enough to instantly evaporate water after only 4 or 5 beeps.
I could increase the resistance of R1 to help with heat by reducing current, but the speaker gets quieter, and its already not as loud as i'd like it to be.
Looking for suggestions on how to improve this while still keeping it really simple. I tried using a piezo buzzer wired directly to the digital outs and it just wasn't loud enough. I'm just generating a short, single frequency tone so the amp doesn't need to bee the super efficient and distortion-free. Simplicity, volume, and not getting really hot are my priorities.
Still learning a lot about this and I'm teaching myself online. These forums and helpful people like you are a blessing. Thank you so much for your input, it is much appreciated! Let me know your thoughts!
Try taking-out the resistor and putting the speaker & capacitor in its place. But you might need a resistor in series too, to limit the current (and volume).
One advantage of a linear amplifier is that it usually has a volume control, or you can add one.
It's not a class-A amplifier because the MOSFET isn't biased.
The heat is normal for this scheme...
When mosfet is 'on', 1.2 amp will go through R1.
At 12V that is approx. 15 W.
Half the time is 7.5 W.
That is 1/3 of my soldering iron.
You probably have a resistor that is designed to be that hot. Is it a ceramic resistor (often white block with written specs)?
So my advice: do nothing...
If you want more noise, add another mosfet instead of R1. But then you need to alter your software or add some stuff in hardware to prevent shoot through (both mosfets 'on' for very short period during transition).
at 1kHz the cap reactance is 740 ohm. XXX Correction: 0.74 ohm
suppose the speaker is actually 8ohm at 1kHz.
So lets say you have a 12V square wave
the pk-pk amplitude to the speaker is 12 * 8 / 748 = 0.13V XXX 12V * (8 /18) = 5.3V
so the peak amplitude at the speaker is 2.65V
the POWER at the speaker is ( 2.65) ^2 / 8 = 1600 milliwatts.
The power used is .5* (12V * (12/10) ) + 0.5 * (12V * (12/18) ) = 13 watts.
Sensibly, to get audio power efficiently you need a bridge tied load class D amplifier as @jremington suggested in post #2