Yet another question about an 8ohm speaker and volume

This last week, I purchased this kit:

http://www.radioshack.com/product/index.jsp?productId=12353398

In the kit is an 8ohm speaker with leads. Since the kit comes with absolutely no instructions, I ended up trying this example: http://arduino.cc/en/Tutorial/Tone.

It sorta works, but the speaker is so quiet it's really hard to hear what tone is playing. I've googled around and found that even with a 100ohm resistor, that speaker is probably pulling enough power to burn out my arduino pin, and that if I want any more volume, I'll need a "simple" amplifier (which, as it turns out, isn't so simple for someone as new as I am).

I guess I just have a hard time believing the kit would include a speaker, but would not also provide means to use it correctly.

What am I missing here?

The best you can build is a an amplifier with an opamp, i made one once an was pleased with the results and the price (a small €10). This gives a few wats and is sufficient to drive even a small hifi speaker. If you search on google "audio amplifier opamp " you find plenty. Watch out for the power supply (most are with positive and negative voltage and then your power supply becomes more expensive then the amp itself.

By the way, an 8 ohm speaker has a inductive resistance of 8 ohm at a frequency of about 1000hz. how higher your frequency the higher the resistance. If you go to zero ( below 20hz) hz the resistance is very low => high current draw.

When you only want to produce "tones" with square wave signals, a transistor like a bc547 should drive you small speaker.

I am indeed only producing toned above 100 hz in this project. Are you saying I’d only need a transistor to drive it for those purposes?

Try one of these. Both work similarly. When transistor switches from off to on, current starts flowing thru the cap until it charges up, moving the speaker voice coil. When the transistor turns off the cap discharges and the speaker voicecoil moves back.
Do run these without a resistor, you’ll burn something up.
I imagine the speaker in the kit is low wattage, so be sure to limit the current that can flow.
If you want something louder, try one of these:

or take the arduino output, go thru a couple of resistors to make a 1V signal, and connect to a powered PC speaker. See my topic “piano tones micros” for an example of how that can sound.

There’s lots of single chips that are designed for this. LM386 is common. If you need more power there’s the LM4861, LM4889, etc.

You could also try the transistor method below.

Arduino_forum_amplifier_query.png

yes, if you only switch on and switch off the output.

Try a NPN transistor, do not forget the transistor

take a resistor from about 1000 ohm from the pin to the Base of the transistor. Connect the emmitor to the ground. Connect the speaker (red wire) to 5 V through a resistor of 100 ohm and the black wire to the collector of the transistor.

The bc547a has a hfe parameter from minimum 110 (dc currrent amplification parameter). So if Your pin gets high, this wil result in a dc current through the base of the transistor 5V (power supply)- 0.65V(emittor base voltage drop) / 1000 (resistor) = 4.35ma

Then your collector current "can" be 4.35( base current) * 110 (hfe parameter) = 435 ma.

This will be limited by the resistance of the speaker and the resistor in serie (100ohm) and also the transistor can only deliver 100ma. +- 5V / (8ohm + 100ohm) = +- 50 ma. You can try to lower the resistor of 100 ohm a simple npn transistor is as cheap saying i'm sorry.

My calculations are not perfect but you can use them as guidance;

Best you try the schematic above, this one is posted while i was typing this one and is certainly correct :).

I would not connect a speaker without a capacitor in series. The capacitor keeps the DC part of the signal out. If your signal goes high & stays there the transistor turns on, and you have DC just pouring thru the voice coil. (5V -Vce)/(Rspeaker + 10 ohm) = high current (5 - 0.7)/(8 + 10) = 239mA.

I have so much to learn!

I do have two caps on the MakerShield for power filtering, but I assume this won't be sufficient since it won't filter the transistor signal?

You should have a cap in series between the speaker and the switching source. 100uF, 220uF, either will allow good sound.

This is the circuit I use to connect a speaker to an Arduino output pin. The resistor R is only needed if the speaker has an impedance of less than 8 ohms.

Ah, I’ve actually seen your diagram, but someone told me “no base resistor is a bit meh”. I have no idea what he meant.

No resistor between the Arduino pin and the transistors?

synic: Ah, I've actually seen your diagram, but someone told me "no base resistor is a bit meh". I have no idea what he meant.

Whose diagram are you talking about?

dc42:

synic: Ah, I've actually seen your diagram, but someone told me "no base resistor is a bit meh". I have no idea what he meant.

Whose diagram are you talking about?

Yours!

I think I just need to get some sort of electronics bible. Every time I think I might be getting somewhere, there's so much more I wouldn't even consider.

I will find a book to buy, read it, and come back if I have more questions.

In my diagram, no resistor is required unless the wires between the transistors and the speaker are long enough to have a large amount of capacitance (e.g. more than 2000pF). This is because the input resistance of the transistors is their hfe multipled by the speaker resistance, which for an 8 ohm speaker will be more than 800 ohms.

If you do have long cables between the transistors and the speaker, you may wish to add a 100 ohm resistor between the Arduino output and the transistors. This will reduce the volume very slightly.

dc42: In my diagram, no resistor is required unless the wires between the transistors and the speaker are long enough to have a large amount of capacitance (e.g. more than 2000pF). This is because the input resistance of the transistors is their hfe multipled by the speaker resistance, which for an 8 ohm speaker will be more than 800 ohms.

If you do have long cables between the transistors and the speaker, you may wish to add a 100 ohm resistor between the Arduino output and the transistors.

Ah, ok. Thank you!

I can recommend mine. Arduino for Teens. Good for those with some programmi ng but little electronics experience.

synic: I think I just need to get some sort of electronics bible. Every time I think I might be getting somewhere, there's so much more I wouldn't even consider.

I will find a book to buy, read it, and come back if I have more questions.

What is wrong with this particular setup here?

http://bryanduxbury.com/2012/01/20/one-transistor-audio-amplifier-for-arduino-projects/

synic: I think I just need to get some sort of electronics bible. Every time I think I might be getting somewhere, there's so much more I wouldn't even consider.

I will find a book to buy, read it, and come back if I have more questions.

It won't help.