For the project I am currently working on, I'm using a Lilypad Arduino and the Lilypad buzzer to play a couple of different melodies. However, the buzzer is not nearly loud enough. Currently I am only using 1 AAA battery to power the Arduino. If I up the voltage will the speaker be much louder? (Can only take up to 5V anyway) Is there any other way that I can play melodies louder? Like by using a relay to give a speaker more voltage? But where can I find a speaker that I can program directly to play melodies?
Yes, if you increase the voltage the output will get louder (depending on the buzzer). But you might want to try different buzzers though. Another option would be to add an amplifier (i.e. LM386) and use a speaker.
How would the amplifier work? Sorry I'm trying to teach myself all this stuff and I've not really done anything like this before. The lilypad outputs current in a sin function to make the lilypad buzzer play different pitches. Would the amplifier mess with that?
lm386 is a small low powered amp in a 8 pin chip, you add power some filtering caps, input and it has an output, its pretty easy to deal with and national semi has some of the best documentation in the biz
just looking up the part on their website will give you a basic example, the datasheet has all kinds of variations
The NXP TDA7052 is a modern device, and much better than the 30 year old LM386.
Even with the amplifier, does anyone know the maximum volume that the lilypad buzzer is capable of? I can't find specs for it anywhere.
And does anyone know other buzzer/speakers that would be louder? The lilypad buzzer is programed to play different pitches based on a step function output signal from the arduino. But is there any kind of speaker that I could program seperately to play melodies (maybe midi files) just based on a single output from the arduino?
Would you post a link to the buzzer you have? Someone may recognise it.
Is it this one LilyPad Buzzer - DEV-08463 - SparkFun Electronics?
I typed the part number on the Sparkfun picture (CCV084) into google and got this datasheet:
It's peak sound level is 3kHz to 6kHz.
They give a little circuit with one transistor and a resistor, for their testing, so that might be an easy place to start.
The spec sheet does say the "mean current" is 110mA, which is way above the abilty of the Arduino, so the transistor is well worth trying. They use a transistor capable of handling a current of 500mA. These are about $0.10 at somewhere like Newark.com. Radio shack likely sell something suitable.
The same piezo buzzer at a higher voltage will be louder.
Typically, these things are optimised for a set of parameters. Armed with that datasheet, you'd probably find something louder at a component supplier, but try the transistor and a higher voltage first.
The lilypad buzzer is programed to play different pitches based on a step function output signal from the arduino.
Yes, the buzzer plays different pitches because the Arduino pin outputs a square wave (wiggles between LOW and HIGH) at different frequencies.
But is there any kind of speaker that I could program seperately to play melodies (maybe midi files) just based on a single output from the arduino?
I don't think I understand the question.
Melodies are a sequence of pitches, and the Arduino can do that. There is a program in File->Examples->Digital->Melody
Midi files need to be interpreted to play a note or melody.
Is the question, "how can the Arduino interpret midi files to play a note", or is it "is there something, which can drive a speaker, that the Arduino can send midi files to" or something else?
There are bits of electronics to interpret midi files (e.g. synthesisers). There are more louder speakers. Use an amplifier, e.g. like a LM386, or TDA7052, and a small speaker, even some of the low-cost sort that people use next to the PC.
HTH
GB
Yes, the link you posted is the buzzer that we are using.
And I guess my question was how to use a synthesizer along with an arduino to play a midi file on a speaker. For now I think we will try using an amp to make the buzzer we have play louder, but eventually we might want to be able to somehow play midi files so that we can play a wider variety of sounds instead of just a series of different pitches. Is that any clearer?
Is that any clearer?
Sorry to be a bit thick, but not really.
Do you want to send midi data from the synthesiser to the Arduino to be played by the Arduino directly to the buzzer, or vice versa, with the synthesiser playing the midi data to a speaker?
You said the Arduino is being power with 1 AAA battery, which is 1.5V.
This LilyPad can be run at a voltage of upto 5V LilyPad Arduino 328 Main Board - DEV-13342 - SparkFun Electronics
so that would make the buzzer louder.
BUT the datasheet says the buzzer needs an average current of 110mA, so it shouldn't be driven at that voltage directly, but via a transistor or some other form of amplification.
A transistor used in the way shown in the buzzers datasheet is an amplifier. It'll cost about $0.10. The datasheet shows the buzzer shouldn't be drive any higher than 4.5V, which will be perfect with a transistor at 5V. So if it still isn't loud enough, at 5V, it'll need a different speaker.
HTH
GB