I connected a piezo buzzer to my arduino (see attachment) and the I/O port the buzzer is connected to is always high, except when I play a tone on the buzzer (square wave). I know the buzzer doesn’t like this constant DC component and I want to filter it out of the signal i.e. I want there to be 0 V over the buzzer when I don’t play a tone. I thought about putting a capacitator in series with the buzzer. Will this work? Will the buzzer still play a tone? What capacitator should I use? Where exactly should I put the capacitator? Does this harm the arduino or buzzer? Please let me know!
ps. I don’t want to set the output to low when I don’t play a tone, so that’s not an option.
Thanks for your help!