Hello guys, I bought high power speaker (in the pictures bellow) I don't know its voltage, But under the speaker there's a number (20) I don't know what does that number refers to. So, here is the problem :
I cant control it with arduino. I controlled two smaller speakers and they were working fine but the volume was very low. So I bought this one.
Any ideas to get it working ? (without buying a new battery if possible.)
Hello guys, I bought high power speaker (in the pictures bellow)
The pictures are not showing up.
You can't directly drive a 4-Ohm or 8-Ohm speaker from the Arduino. (The minimum impedance is 125 Ohms). You need an amplifier to drive a speaker.
However you can drive any "powered" or "active" speakers, such as regular powered computer speakers.
Speakers are not rated by "voltage", they are rated by wattage.
Power in Watts = Voltage2/Resistance = Voltage x Current. = Current2 x Resistance.
Powered speakers operate at approximately audio line-level which is about 1V and it's what comes-out of from your DVD player's analog audio jacks. The Arduino puts-out 5V, and that will work with a line-input as long as there's a volume control. And, it's a good idea to put a capacitor in series since the Arduino can't go negative and the signal is "biased". (The signal coming-out of the capacitor will go negative.)
[u]Here[/u] is a solenoid driver. Your transistor should be rated for 1A or more. The same circuit would "work" with a speaker, but there are advantages to using an amplifier. You can't put a volume control on a one-transistor driver like that. And, the driver circuit doesn't put-out a "proper" AC voltage. (You'll probably need to reduce the resistor to about 200 Ohms. The transistor in the example is a Darlington pair with more current gain than a regular transistor.)
A "bigger" or higher-wattage speaker isn't necessarily louder, but a larger speaker can usually put-out louder bass, especially in the correct cabinet. (i.e. Woofers are bigger than tweeters.)
And, the power rating (wattage) on a speaker is it's maximum. If you replace a 5W speaker with a 20W speaker, you don't get more power unless you use a higher-powered amplifier.
I've got a little amplifier [u]like this[/u] that I use for TV sound in my bedroom. (That amp doesn't come with a power supply. You have to buy it separately.)
You can build an amplifier from an audio amplifier chip, but I'd recommend you start-out buying one.
Look at Fig 10 on the [u]LM386 datasheet[/u]. The LM386 is an easy-to use low-power amplifier chip. (The default gain is a little high for what you need, but with the volume control you can turn it down.)
If you don't know how to build the circuit from the example schematic, buy an amplifier. Or, buy some [u]powered computer speakers[/u].
You should really try-out whatever you're trying to do before you go build an amplifier. I'd hate to see you build an amplifier only to discover that you weren't getting the sound quality you need, or discover that your amplifier isn't powerful enough, etc.
#include <SD.h> // need to include the SD library
#define SD_ChipSelectPin 53 //example uses hardware SS pin 53 on Mega2560
#include <TMRpcm.h> // also need to include this library...
#include <SPI.h>
TMRpcm tmrpcm; // create an object for use in this sketch
void setup(){
tmrpcm.speakerPin = 46; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
Serial.println("SD fail");
return; // don't do anything more if not
}
else{
Serial.println("SD ok");
}
tmrpcm.setVolume (5);
tmrpcm.play ("imf.wav");
}
void loop(){
}
That library (TMRpcm) uses high frequency PWM and programs one of the 16 bit timers to do this.
Add an RC low pass filter composed of a 10k resistor and 1.5nF capacitor to pin 46 and that will produce
an analog signal for the amplifier. If the outputs too large, you can try using
33k from the pin to 1.5nF in parallel with 10k to ground, which will attenuate as well as low-pass-filter.
But that won't do much with a simple switching-transistor circuit. You'd need a regular-linear amplifier. Fltering the input to your transistor-boost circuit will probably make it WORSE! If the PWM is fast-enough the transistor circuit might be OK but I wouldn't try to amplify speech or music that way. (You CAN amplify a square wave generated by the tone() function with a non-linear circuit like that.)
I don't know how good the TMRpcm sound quality is... I've never tried it, but I wouldn't expect "CD quality".
It might have sounded OK when it was "too quiet" because the volume was too low to hear the noise & distortion...
Do you have a stereo system or a TV with Audio/Video inputs? If you can plug it into your stereo system and it sounds OK, you know the sound from the Arduino/TMR is OK and the problems are with your amplifier circuit.
If you get poor sound quality from you stereo (or TV) then you need to re-think your design and use an [u]audio shield[/u] with a real digital-to-analog converter.
If you're not getting "clean" sound out of your Arduino, you're wasting your time trying to build an amplifier...