Hello, I want to ask the input given to this Piezo speaker is an analogue signal or digital signal? This is because I am using digital output pin of Arduino Uno board to connect this speaker, is that okay?
Besides, if this speaker require an input analogue signal, then should I use Digital to Analogue Converter where convert the digital output pin of Arduino into analogue signal first and then feed to speaker?
The diagram of the connection between Arduino and speaker is shown in this attachment.
A piezo element can be represented by an equivalent circuit of capacitors, inductors and resistors. So yes, it is analog by nature. But as a digital signal (square wave) is a sum of many sinewaves (the base tone and all it’s odd overtones) it should behave just as well. It may just sound a bit different. More mechanical, less like a pure string.
The output of the Arduino in this drawing is suggesting the output is a PWM signal, so not realy a square wave but a rectangular wave with varying dutycycle. That is not really going to give a nice sinewave, unless it is producing low frequency waveforms by aproximating the intermediate positions in the sinewave.