Amplifier circuit for 12V piezo speaker

Hey all,

I’ve been working on designing an amplifier circuit for my 12V speaker. I can’t seem to get this design to actually produce any noise when I wire it all up and try to feed it a signal, however. Here is the sketch I am using to test my speaker:

const int speakerPin = 2;

void setup() {
  // initialize the speaker pin as an output:
  pinMode(speakerPin, OUTPUT);
}

void loop() {
  tone(speakerPin, 1000);
  delay(1000);
  noTone(speakerPin);
  delay(1000);
}

I’ve attached a picture of my circuit as I have it wired up currently to this post as well as the circuit diagram that I modeled it on (note that I’ve replaced the MOSFET shown here with an IRLB8748, the 68 ohm for a 56 ohm, and the 220uF for a 330 uF purely because the originals were unavailable). Ground and power to the speaker are connected to a power supply set to 12V. Let me know what you think. I’m sure it’s rather basic. I’m new to amplifier design…

Hello nekomancer,

A lot of people here, myself included, don't like following links to unknown external sites because of the risk of malware. Please read items #8 and #9 in 'how to use this forum - please read' and post your images here.

Thank you.

It seems you're driving the gate with positive pulses of only 2.3volt.

Remove that gate capacitor, so you drive the gate with 5volt PWM instead of ±2.5volt PWM.

Remove that 1k2 resistor, and add a 10k resistor from Arduino pin to ground, so you don't have a voltage divider on the gate.

Are you sure that's a piezo speaker?
Do you have a link to the product page or datasheet.
A common piezo can also be driven between two Arduino pins (in bridge mode) with the toneAC library.
Leo..

PerryBebbington:
Hello nekomancer,

A lot of people here, myself included, don't like following links to unknown external sites because of the risk of malware. Please read items #8 and #9 in 'how to use this forum - please read' and post your images here.

Thank you.

Understood. Thank you for pointing that out to me kindly even though I should have known before posting. Had to compress one of the images for it to fit, but they are now included as attachments. If you have any ideas for me I'd still be happy to hear them.

If you have any ideas for me I'd still be happy to hear them.

Obviously Wawa is less bothered about going to other sites than me! I have nothing to add to what Wawa has said, I think he's right. However, I would expect some sound from the speaker, even if it's not what you expect, not silence. I would wonder if you have a bad connection or a faulty component.

Wawa:
It seems you're driving the gate with positive pulses of only 2.3volt.

Remove that gate capacitor, so you drive the gate with 5volt PWM instead of ±2.5volt PWM.

Remove that 1k2 resistor, and add a 10k resistor from Arduino pin to ground, so you don't have a voltage divider on the gate.

Are you sure that's a piezo speaker?
Do you have a link to the product page or datasheet.
A common piezo can also be driven between two Arduino pins (in bridge mode) with the toneAC library.
Leo..

Yes, it is a piezo speaker. Though it is a bit more heavy duty as I needed something that could output around 120db because the environment it is being installed in is VERY noisy. Standard piezos seem to settle at aorund 80db and 5V, which is convenient for Arduino projects, but I need a little bit more. Hence this elaborate design with a separate 12v supply and amplifier circuit.

Link to product page:
https://www.digikey.com/product-detail/en/pui-audio-inc/X-5735-LW350-S-2-R/668-1648-ND/3189916

In case you don't want to follow a link, here is the digikey part #: 668-1648-ND
and here is the manufacturer's part #: X-5735-LW350-S-2-R
and the datasheet as well: http://www.puiaudio.com/pdf/X-5735-LW350-S-2-R.pdf

I will give your modified circuit design a try and report back with what I find. Thanks again!

PerryBebbington:
Obviously Wawa is less bothered about going to other sites than me! I have nothing to add to what Wawa has said, I think he's right. However, I would expect some sound from the speaker, even if it's not what you expect, not silence. I would wonder if you have a bad connection or a faulty component.

Yeah, I'm not sure. I DO get a very brief chirp from the speaker when I popped in the 330uF capacitor, but that's about it! It did make SOME sound then, but otherwise I have yet to have it make another. I'm honestly not sure if any f the connections are bad, or if it is shot. Perhaps I should try testing the voltage to the speaker? I agree I should hear something even at a lower voltage. But even holding it up to my ear while it should be running, I can't hear a thing!

The IRF37072 has long been obsolete and does not appear to be available. What are you really using?

If not a logic level MOSFET, use one like this instead.

Never mind, I see that you are using the IRLB8748. But make the changes suggested by Wawa above.

https://www.digikey.com/product-detail/en/pui-audio-inc/X-5735-LW350-S-2-R/668-1648-ND/3189916

That's NOT a "speaker" or "transducer". It's a "siren" with it's own built-in sound generator circuit. You power it with 12VDC and it makes noise.

So, just hook it up to your battery/power supply first to confirm it makes noise.

The re-build your circuit as a regular [u]DC driver circuit[/u] and activate it with digitalWrite() instead of tone().

(You can leave-out the diode since your device is non-inductive.)

DVDdoug:
That's NOT a "speaker" or "transducer". It's a "siren" with it's own built-in sound generator circuit. You power it with 12VDC and it makes noise.

So, just hook it up to your battery/power supply first to confirm it makes noise.

The re-build your circuit as a regular [u]DC driver circuit[/u] and activate it with digitalWrite() instead of tone().

(You can leave-out the diode since your device is non-inductive.)

Thank you for pointing that out. I wasn't aware. I tried your test. It works when connected to 12V source. Though I am struggling with the low side circuit. It seems to start blaring immediately even though I programmed a delay into my code before I turn the speaker signal high(using digitalWrite now as you suggested). Have I wired anything incorrectly? Here is how I have it now if you don't mind the use of links:

The externally linked photo of your setup is hopeless for debugging.

Please post a schematic, like that shown below (which is for motor control, but also could be used for a siren -- leave out the diode). Image posting guide

The externally linked photo of your setup is hopeless for debugging. Please post a schematic

I recreated my circuit with this tool. This is how I had it set up before you posted the schematic for the motor control circuit. It is intended to be based on Wawa's design here. I hope this is more useful for debugging even if it isn't quite the same kind of schematic...

Fritzing is usually misleading. Better to post a real photo and/or a pencil drawing.
That Fritzing layout won’t work, because you have shorted the gate to ground with the small blue line on the left of the mosfet.
Leo…

Better to post a real photo and/or a pencil drawing.
That Fritzing layout won't work, because you have shorted the gate to ground with the small blue line on the left of the mosfet.

Fair enough. I attached a hand drawing (it's not great, but it's something) since photos seem to not work for everyone in this thread. Hopefully this is more clear. Also, I see what you mean about shorting the gate to ground. So I took that connection out. Unfortunately, my circuit still doesn't seem to produce any sound. DO you have any other suggestions?

You seem to have swapped source and gate.
Rebuild, or just flip the fet around.

I meant a pencil drawing of the circuit diagram, not breadboard view.
Looks artistic though :slight_smile:
A real picture (posted inline) of the layout would also have shown the problem.
Leo..

You seem to have swapped source and gate.
Rebuild, or just flip the fet around.

My bad! I appreciate your patience & compliments though. I flipped the fet around and it does actually produce noise now, but when I set the pin that the speaker is connected to low, it continues to blare sound, just in a different pitch. Could this have to do with the 12v power going to the speaker?

Here's a photo of the circuit right now:

It seems you plugged the fet in the wrong holes.
Leo..

Wawa:
It seems you plugged the fet in the wrong holes.
Leo..

I forgot to retake the photo. I scooted the MOSFET over a pin so that it was lined up properly and I am having the issue I previously described with the MOSFET properly lined up.

Unplug the yellow wire from the Arduino, and plug it into the ground rail (top/blue rail) of your breadboard.
You might have toasted your mosfet if the siren doesn't stop then.

Connecting things wrong is never good. Always tripple-check.
You must also have noticed the diode across the load in post#10.
It's there to protect the mosfet from kickback spikes from an inductive load. You didn't use one.
Handling a mosfet without ESD precautions can also destroy a mosfet.
Leo..

Wawa:
You must also have noticed the diode across the load in post#10.
It's there to protect the mosfet from kickback spikes from an inductive load. You didn't use one.

Are you suggesting he should?

As jremington pointed out, it is not necessary as it is not an inductive load.

It contains a built-in (transistor) driver. If a diode were needed, that would necessarily already be incorporated to protect the built-in driver, wouldn't it? :roll_eyes: