For a small project, I would like to use a MCP4821 D/A IC for a good quality sound output. I have the following parts which I would like to connect:
Arduino Uno
MCP4821 with SPI
Speaker, 8 Ohm, 0.2W
To connect the MCP4821 with SPI to Arduino is very simple, I already did this. But now I would like to connect the speaker to the output of the MCP4821. I’m unsure about the specs of this D/A chip: http://ww1.microchip.com/downloads/en/devicedoc/21953a.pdf
Is it possible to directly connect the speaker to the output of this chip? Or what do I need to connect the speaker to the output of this D/A chip?
You can't directly connect a speaker. The output is rated for 25mA maximum. (From Ohm's Law, Current = Voltage/Resistance.)
You need a "power amplifier". If you want to build one yourself, the [u]LM386[/u] is a popular low-power power amplifier chip, and it's fairly easy to use. Or, there are [u]other power amplifier chips[/u].
Or, you can plug it into an "Aux" or "Tape" input of your stereo system*, or even your TV. Or, you can get a small amplifier something like [u]this[/u].
If you have a desktop/tower computer you can connect to the line-input on your soundcard. (The mic input on a laptop is too sensitive for regular line-level audio). If you use your soundcard, test your computer's configuration by plugging-in a CD player or DVD player, or something that you know is working before you connect your "unknown" DAC.
If you have a good high-power hi-fi system, be careful when experimenting! An unexpected blast of sound could damage your woofer or tweeter.... It's possible to fry a tweeter with high-power high-freqency test-tones that you can't even hear. A 100W speaker is generally designed to handle music with occasional 100W peaks, and can usually be damaged with constant 100W test-tones. The tweeter in a 100W speaker system can usually be burned-out with 10 or 20W test tones!
DVDdoug: You can't directly connect a speaker. The output is rated for 25mA maximum. (From Ohm's Law, Current = Voltage/Resistance.)
Using an amplifier is a solution, but if you don't need a lot of volume, you can put a resistor in series with the speaker as well.
Voltage/Current=resistance.
6.5V(max voltage)/0.025A(max current) = 260 ohms.
You probably won't find a 260 ohm resistor but you can use the closest next one, 270ohm, to stay under 25mA.
The LM386 seems really to be a good solution, it seems it was built with a 8ohm speaker in mind.
Simpson_Jr:
Using an amplifier is a solution, but if you don't need a lot of volume, you can put a resistor in series with the speaker as well.
Voltage/Current=resistance.
6.5V(max voltage)/0.025A(max current) = 260 ohms.
You probably won't find a 260 ohm resistor but you can use the closest next one, 270ohm, to stay under 25mA.
That would be a good starting point for some tests at least.
So if I use 5V as voltage from the Arduino board, it's 5V/0.025A = 200Ohm - 8Ohm = 192Ohm. So I use the next from e.g. a E12 series, a 220 Ohm resistor. This will keep the current at 22.7mA. Is this correct?
ZVe69:
So if I use 5V as voltage from the Arduino board, it’s 5V/0.025A = 200Ohm - 8Ohm = 192Ohm. So I use the next from e.g. a E12 series, a 220 Ohm resistor. This will keep the current at 22.7mA. Is this correct?
Yes.
I personally might choose an bigger resistor to keep current lower as 60-70% of the maximum. I recently used a 1k resistor with a similar speaker, simply because a smaller resistor resulted in too much noise.
But your calculation is within specs of the chip and should work fine.