Wav sound playing issue in Arduino Uno

Dear Experts,

I am trying to play a sound from the microSD card using Arduino Uno. I am using the example code from the TMRpcm library ( Code Attached) . Below are the components,

  1. Arduino Uno
  2. MicroSD card Adapter for Arduino
  3. 8 Ohms toys speaker

I removed 8 Ohms speaker from a toy. Before removing the speaker I have tested and it was loud enough. But when I am using the speaker to play the wav file, the sound is much much lower. I able to hear the sound only If I am close to the speaker (just few centimeters).

As per me, the code and Arduino part is fine so I removed the speaker from the Arduino and put back in the old toy and it is loud as earlier. Why the speaker is not able to generate the same quality in terms of db sound as in the toy? Please help me to understand the issue...

basic.ino (992 Bytes)

The Arduino Can't directly drive an speaker. (It can drive a piezo transducer.) 8 Ohms is WAY too low for the Arduino! You are in danger of frying your Arduino!

The speaker is quiet because you are "killing" the Arduino output (hopefully temporarily) and it's not putting-out 5V.

You need an audio "power amplifier" to drive the speaker, or you can use regular powered computer speakers. It can be a little tricky because TMRpcm, not real PCM It's PWM which can "cause trouble" for amplifiers.

The Arduino is rated for 40mA "absolute maximum". [u]Ohm's Law[/u] gives you a MIMIMUM or 125 Ohms at 5V. You can add a series resistor to make it safe but that will also lower the volume.

You can also use a Soundbox like JBL or something similiar with an audio-jack and a aux-to-aux cable.
Then you can use 2 wires:

  • One end of the first wire you tie around the ground-section of one end of the aux-cable. The other end of the wire you put in the ground-pin of your arduino.
  • One end of the second wire you tie around the l/r-section of the aux cable. The other end of the wire you put in the speaker-pin of your arduino

Now you have 2 wires tie around one end of the aux-cable. The other end of aux-cable you put into the speaker.

Now it should work.
If you have a question just ask.

SchnoppDog:
You can also use a Soundbox like JBL or something similiar with an audio-jack and a aux-to-aux cable.

Well you certainly shouldn't feed the 0-5V signal from an Arduino into a input that is expecting the usual audio 1V peak to peak signal.

Thank you so much @DVDdoug and SchnoppDog for the clarification. Now I understood why my Arduino unable to generate enough sound.

Sorry if the below question looks silly to you (I am in learning phase)

How the low-cost toys from china are able to generate good loud sound using 8 ohms speaker with 3.3V battery? Are they using amplifier in the circuit?

How the low-cost toys from china are able to generate good loud sound using 8 ohms speaker with 3.3V battery? Are they using amplifier in the circuit?

Yes, there is some kind of amplifier, usually built-into whatever chip they are using. It's mostly a current-boosting amplifier rather than a voltage-amplifier.

Well you certainly shouldn't feed the 0-5V signal from an Arduino into a input that is expecting the usual audio 1V peak to peak signal.

5V peak-to-peak is a little "hot", for an audio signal but a 5V peak-to-peak sine wave is only ~1.75V RMS and "line level" isn't that tightly controlled in consumer electronics anyway. And, usually, there is a volume control pot on the amplifier input as well as a DC blocking capacitor to remove the DC component. It's the PWM that can be dangerous for audio amplifiers, and I would NOT connect my hi-fi amplifier (or expensive computer speakers).