I'd like to install a bunch of audio synthesizers (see Auduino) in an art installation, using various kinds of sensors to make noise, and would like to find out how loud of a speaker I can power using only the Arduino, and no external amplifier or circuitry.
In the past, I have used 8ohm, .5W speakers (not piezo, more like this Speaker - 0.5W (8 Ohm) - COM-09151 - SparkFun Electronics). In small, quiet rooms, they worked okay, but in the gallery with lots of people scuffling around and talking, it might not work too well.
If need be, I can probably run multiple Auduino's through a cheap mixer and patch them all into a single sound system, but then people might be a little more confused about which sounds are coming from which devices.
Theoretically, you can't get more power, than state by Ohm Law:
P = R x I^2 / 2 = 8 x 0.04 x 0.04 / 2 = 6.4 mW.
It sounds a little louder than that due presence high harmonics components and high efficiency
speaker on middle frequency range.
To drive more power you have to amplify current, using at least one transistor TIP120,
and simple schematic: http://www.techlib.com/electronics/graphics/classa1.gif
You can make it even more simple, with one resistor between arduino output and base of transistor and speaker in collector circuitry.
my only experience with this was making a sound effect for a pumpkin one Halloween. I used a small external speaker/amp that was left over from something. maybe you could find a few battery powered mini-amps.
@Magician: I might give that a shot, I think i've built simple amplifiers like that before in an electronics class, and they worked very well. We definitely used TIP120s there. Thanks!
@bill2009: Definitely a good option, but we're thinking of making between 10-20 of these devices, so the price starts to climb up there with even cheap external amps. But if the home-made amp idea from magician doesn't work, we'll scale back and check those things out. thanks!
I'd like to order this speaker from MPJA, but I see it is a 4 ohm speaker. The schematic posted shows different resistors for different speaker impedances, but doesn't mention 4ohm. How can I calculate the required resistor value?
Schematic has negative feedback implemented in it, so it's not really affected by changes in R of load, and resistors don't have to be adjusted.
The same time, it'd make sense to decrease value of both resistors to 10 - 50 k ohms, in order to get more power with less distortions for more powerful speaker.
As amplifier shown on schematic is class A, it will provide maximum undistorted output power when voltage distributed equally, between transistor and speaker.
Vp / 2 = 2.5 V
And electrical power dissipated in speaker coil:
P = U^2 / R = 1.56 W
This value should be less than speaker is design for. In other words, optimum balance voltage 2.5 V is "out of reach" for speaker with less than 2W power.
Summing all this up, resistors have to be adjusted not according R of speaker (4/8/16 Ohm)
but rather wattage of available speaker.
Exact formula to calculate resistors is little bit complicated, approximate values for 0.25 W:
25 k (upper) and 10 k (lower), and 10 k and 10 k for 2 W speaker.
That is a very nice speaker, I drive it from a 12V supply with a MOSFET controlling the switching.
You should be able to get 6W from it, with an amplifier like this:
Adjust the 68 ohm for the volume you want with a 5v supply,
and a logic level MOSFET
And here are the code pieces that I make a cellphone like warble with.
[code]
// info on alarm sound
#include "e_pitch.h"
// notes in the melody to play when a touch is scored:
int thisNote = 0;
int noteDuration = 0;
int pauseBetweenNotes = 0;
int melody[] = {
NOTE_B5, NOTE_G5, NOTE_B5, NOTE_G5, NOTE_B5, NOTE_G5, NOTE_B5};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
12,12,12,12,12,12,4};
Within loop, if a sound is to be made then buzzer is set to 1:
***********************************************************************************************
// Buzzer section - connect pin D17 to speaker driver
// ***********************************************************************************************
if ((buzzer == 1)) // code above started buzz
{
buzzer = 0; // reset for next pass thru
// use ledPin for feedback for now
//digitalWrite(ledPin, LOW); //LED on
// create a warble once
for (thisNote = 0; thisNote < 8; thisNote++)
{
// to calculate the note duration, take one second
// divided by the note type.
//e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
noteDuration = 1000/noteDurations[thisNote];
noTone(17); //apparent known bug - need this for the tone to play next.
tone(17, melody[thisNote],noteDuration);
// to distinguish the notes, set a minimum time between them.
// using the note's duration + 10%:
pauseBetweenNotes = noteDuration * 1.10;
delay(pauseBetweenNotes);
// stop the tone playing:
noTone(17);
}
}
include this, I have it as a tab in the IDE called e_pitch.h
probably just need the notes actually used
Nope, still the most efficient SPL/watt transducer available even after many decades. However they are huge in size, have a rather sharp sound and have always had a rather small but loyal following.
Oh, I wish. We were out of town. On the fourth day, when the neighbors noticed the problem, water was running under our front door and down an outside wall like a waterfall. By the time we arrived, the speaker cabinets had ruptured. That was a painful end to a very good vacation.
How can I add a quick and easy volume control to this type of amplifier? Can I replace one of the resistors with something like a 100k audio taper pot?
I was thinking how to minimize numbers of components, as circuitry getting bigger with volume control, and come up with this. You can use any pot in range 220 ohm - 10 k ohm.