Small piezo speaker (passive buzzer) amplifier (headphone/aux cable)

Hi there,

I'm trying to make a small passive buzzer play a sound from my headphone cable louder than if I just connect them.

quick summary: I'm trying to make a headphone jack speaker.

I tried using just a transistor, but that didn't work.

preferably I'd like to use a circuit, maybe even some code. Write some other solutions too, I would like to hear them as well :slight_smile:

edit : by circuit i mean something like a transistor.

sorry if I'm a bit unclear, I can give you additional info if needed.

Very unclear. Please post a link to the speaker/buzzer you are using.

Please describe how you want to use this, what will it be connected to.

Why would code be required?

1 Like

the buzzer came with an Arduino kit, and it's just called "passive buzzer". It's a centimeter in radius.

I'm looking for a way to boost the sound of it because when I connected the two pins from my headphone cable with the two pins of the speaker, it made a very quiet but good quality sound.

I want the headphone cable to be plugged into some breadboard-built amplifier and then send the amplified sound to the speaker.

code could take the very complicated but small sound wave, and make it bigger, maybe using the map() function.

Code and your Arduino ONLY deal in numbers. How do envision changing from a sound wave to a series of numbers?

im thinking of a very fast code simply taking the current value of the sound, making it multiplying it by 2, and sending it to a pin.

very fast code.

You'll have to increase the voltage, which means you need a higher voltage power supply and transistor, MOSFET, or audio amplifier.

The regular Arduino puts-out 5V pulses or square waves. The tone() function puts-out a square wave. Piezo transducers are usually most-efficient at about 2kHz and your hearing is also most-sensitive at about 2kHz so a 2kHz tone is as loud as you can get with 5V.

Piezos can't put-out low frequencies (bass).

The Arduino can't put out 5V into a regular 4 or 8-Ohm speaker because it can't supply the current (Ohm's Law) and you can burn-up the Arduino by trying. Again, some kind of driver or amplifier is required but 5V might be enough.

Problem... The regular Arduino doesn't have a true-analog output. (1)

That could work If you had a digital-analog converter, and if the input is less than 2.5V (since you can only get 5V out). Multiplication is exactly-how digital amplification works, but it's normally used to adjust volume or as a volume control, not to replace an analog amplifier.
BTW - Doubling the voltage (or the digital value) is an increase of +5
6dB.)

An analog amplifier is a LOT easier to build and you can EASILY get better quality than with an Arduino.

I don't know if this applies to what you're doing, but the Audacity Website has a little tutorial about how digital audio works. (It's mostly about sampling. They don't talk about amplification.)

(1) To some extent analog can be "faked" with PWM, such as analogWrite(), but the PWM frequency has to be increased because standard PWM is in the lower part of the audio range (about 500Hz) so you can hear the PWM itself and it can't reproduce high frequency sounds. There is a library called tmrPCM that can "fake" analog audio from an Arduino.

1 Like

thank you a TON, you really helped me. im reading your post carefully, and i may ask some questions in a moment.

so i should make an analog amplifier or use the pwm + library enabled code?

Texas Instruments makes all kinds of amplifier chips and of course they have all the data for building a working amplifier circuit.

Or you can buy an Amplifier Board.

1 Like

If you just want an analog amplifier use an analog amplifier! :wink:

1 Like

oh yeah, how can i build one ?

and how do i use the library?

If you can output the anitphase on another pin, then you would get 10V across the piezo.

You don't build things these days, you buy a module to do it. :grin:

Like all your others.

There is in fact, a library for that.

1 Like

well paul, I live in a country where you can either buy a module for a toilet bowl or import anything and everything from America, at the price of two times the product cost itself. (just joking)

so i cant just buy it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.