0

I've looted this speaker from my old PC and trying to understand how to connect it to Arduino to produce simple sound notification (and not fry anything in the process).

As far as I understand this is a piezo speaker, there is no markings on it. Here is how it looks:

speaker front speaker back

How do I connect\control it?

Should I connect it to PWM pin? If so, what are the safe values to output on PWM pin?

Should I use resistor when connecting speaker? What resistor should I use?

asked Mar 13, 2015 at 15:20
2
  • Take a look at the tone() function, it may suit your purpose. Commented Mar 13, 2015 at 15:40
  • As far as connections go, I would connect the red wire to a PWM pin and the black one to a GND pin, but I'm not sure if a resistor is needed, wait for someone more expert than me to answer. :) Commented Mar 13, 2015 at 15:43

1 Answer 1

2

No need for a resistor. Just connect black to ground, and red to a IO pin. Use the tone function to specify a frequency.

answered Mar 13, 2015 at 15:50
4
  • I'd recommend using a resistor. The piezo conducts quite well and might fry the pin. arduino.cc/en/Tutorial/Tone Also see uchobby.com/index.php/2007/11/11/arduino-sound-part-1 Commented Mar 13, 2015 at 19:07
  • @MrJones A resistor might be needed for (electromagnetic) speakers, not for piezos. A piezo is more like a capacitor, and doesn't conduct any current. Commented Mar 13, 2015 at 20:34
  • Why is no resistor needed? I don't exactly know OP's speaker, but my speaker says 8 Ohm. 8 Ohm at 5V is much more than an Arduino can handle, isn't it? Commented Oct 10, 2021 at 9:37
  • @ThomasWeller OPs "Speaker" is actually a piezo. A piezo you can drive with an Arduino pin. With a (8-ohm) speaker, you can't do that. Commented Oct 10, 2021 at 12:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.