Pages: [1] 2   Go Down
Author Topic: Real Speaker (not Piezo)  (Read 7023 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, since I haven't received my Arduino yet I can't poke around with electronics, so I was wondering:

We can play melodies through the Piezo, but what about playing music through a real speaker? Is that factible?
Logged

SF Bay Area (USA)
Online Online
Tesla Member
***
Karma: 134
Posts: 6763
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure.  Keep in mind the max output current of around 20mA, which means you'll need significant current limiting resistors with a standard 8 ohm speaker.  But 20mA through an 8 ohm speaker is a decent bit of noise...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I haven't got much electronic knoledgwe. So what should I do to successfully connect a speaker to the Arduino?
And, how could I output sound?
Logged

Connecticut, US
Offline Offline
Edison Member
*
Karma: 2
Posts: 1036
Whatduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Read the three parts of this article.

http://www.uchobby.com/index.php/2007/11/11/arduino-sound-part-1/

Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have a small amplifier (anything from PC-style amplified speaker up to a guitar amp), it's possible to connect that to the Arduino.  However, in that case, you would need to reduce the signal level from 0-5V to maybe 0-0.5V before feeding it to the amplifier.  An attenuator would do that, just a voltage divider: http://en.wikipedia.org/wiki/Voltage_divider
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I have a Guitar Amp. How do I connect the arduino to it?
Logged

SF Bay Area (USA)
Online Online
Tesla Member
***
Karma: 134
Posts: 6763
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Connect one end of a 200ohm resistor an arduino digital output pin.  Connect  the other end of the resistor to one side of your speaker.  Connect the other side of the speaker to ground.  That should get you some noise.  Not LOUD noise (for which you'll need some kind of amplification), but enough to tell it's working.
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, to connect a guitar amp, use one of the less sensitive inputs (something that you'd use for a synth, say, or a line-level CD input).  Wire a voltage divider from the Arduino pin to the amp.  That means, put a large resistor in series with the pin, then a smaller resistor to ground.  Take the signal from the junction of the two resistors (there's a diagram on that Wikipedia page).  To reduce the signal sufficiently, you'll probably need the larger resistor to be at least ten times the smaller one.  Maybe twenty or fifty times, depending on the amp.

To start with, try 10k and 1k Ohms, and if that's too loud (start with volume turned down), try 22k and 1k, or 47k and 1k.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a related question:

I picked up an 8 Ohm, 1.5W speaker.  Connecting it to the Arduino, powered over USB, it is just too quiet even with very low resistance.  Are there any simple, cheap options for making it louder?  

* I don't care about sound quality, I am only driving square waves.  
* Also, it doesn't need to be that much louder.  The volume of my alarm clock radio would be fine.  (I opened it up and it uses a 16 Ohm, 1.5W speaker, but on 120 VAC of course.)  

Would a 0.5W speaker be louder?  If I used 9V power to the Arduino, would that get louder?  Any simple amplifier solutions when quality is totally irrelevant?  

Hmm, maybe I should hook up a 9V battery to the speaker, with some resistance, and somehow use an SCR to switch it on and off quickly.  Does that sound reasonable?  To avoid blowing out the speaker, I guess I should choose R so that I=9V/R makes P = I^2 * 8Ohm < 1.5W?  Thus R around 20 Ohms total (counting the speaker's impedance).  Can this hurt the Arduino at all?  
« Last Edit: October 07, 2010, 10:53:18 am by breic » Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

get a lm386, they are cheap low powered amps (you can even get at radio shack if your in the USA) which is what a lot of alarm clocks and awnsering machines / speakerphones use

if you want to use a higher voltage (I doubt it would be much louder) you can use a transistor
« Last Edit: October 07, 2010, 12:41:15 pm by Osgeld » Logged


Manchester (England England)
Online Online
Brattain Member
*****
Karma: 627
Posts: 34220
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Hmm, maybe I should hook up a 9V battery to the speaker, with some resistance, and somehow use an SCR to switch it on and off quickly.  Does that sound reasonable?
No, it's totally wrong.

The simplest way is to use a transistor, with a lowish collector resistor say 100R. Then couple it into the speaker with a capacitor. That will stop excessive DC current through the coils but still allow AC to get through. The bigger the capacitor the louder it will be. Start off with 1uF.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your advice.  I was hoping to avoid that because I don't have good access to electronics stores here, but if that's what it takes I'll do it.  

Shouldn't the volume only be a function of the current going through the speaker, though?  It seems like it should be really easy to max out this current with a 9V battery separate from the Arduino.  I guess I don't understand how an amplifier would work better.  
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 627
Posts: 34220
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Shouldn't the volume only be a function of the current going through the speaker, though

Yes it is and the capacitor allows more or less to flow. A capacitor has an impedance for AC signals. That's a sort of resistance, the bigger the capacitor the lower the impedance for a given frequency and so the more current flows.

The really simple way is to get some active speakers, the type you plug into your computer or MP3 player. They are chep and contain an amplifier.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Grumpy_Mike.  I saw that you posted similar advice here but didn't appreciate it.  

I still find this very confusing, and Google/Wikipedia aren't a great teachers. smiley  

It sounds like I should be hooking up 120 VAC to the speaker, using an NPN transistor and a strong capacitor to control with the Arduino.  I will have to look a lot more into "push-pull circuits" because I don't want to screw up 120 VAC.  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oops, we keep posting over each other.  Active speakers is a good idea, too, I will see if I can find some around.  
Logged

Pages: [1] 2   Go Up
Jump to: