Filter out DC component

Hello,

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!

What's the datasheet on the buzzer say?

CrossRoads: What's the datasheet on the buzzer say?

http://www.sparkfun.com/datasheets/Components/CEM-1203.pdf

Thanks in advance!

For that frequency, 2khz, a .5ufd cap would work. Not sure having a constant DC voltage hurts that kind of transducer at all as it should be non-conductive when at a steady +5vdc high voltage. Why don't you measure the current draw with just a steady high and see if it is drawing any current.

Lefty

retrolefty: For that frequency, 2khz, a .5ufd cap would work

Do you mean 0.5 uF / 500 pF? Sorry if this is an obvious question but I just want to be sure... Where exactly should I put the capacitor in the schematics?

Thanks!

lotte1990: Do you mean 0.5 uF / 500 pF?

Of course I mean 0.5 uF / 500 nF! :*

lotte1990:

lotte1990: Do you mean 0.5 uF / 500 pF?

Of course I mean 0.5 uF / 500 nF! :*

Yes, 0.5 uf, .47uf is a commonly avalible size that would work fine. It could go in series between the output pin and the rest of the circuit. Again I'm not at all sure it buys you anything at all. Have you tried measureing the DC idle current as it is now?

Lefty

The 0.47 uF capacitor made the buzzer sound very very very weak…
So I decided to get rid of the potentiometer.
The idle current is now (without potentiometer) 30 mA WITHOUT capacitor and 0.0 mA WITH capacitor.
(At least my multimeter says to 0.0 mA idle current.)
What does this mean?

ps. The buzzer makes a weak and strange sound when I don’t play a tone. That’s the reason I wanted to get rid of the DC component. When I set the I/O pin to LOW (which I don’t want in the actual design) the buzzer doesn’t make this noise so I figured I just needed to get rid of this DC component. This stange sound is also weaker with capacitor.

Any ideas? Thanks!

The idle current is now (without potentiometer) 30 mA WITHOUT capacitor and 0.0 mA WITH capacitor. (At least my multimeter says to 0.0 mA idle current.) What does this mean?

That's as it should be as a series capacitor blocks DC current and only allows AC current to flow through it. You can try and take a AC current measurement with your meter with a tone active, however unless your meter is rated for frequencies up to 2khz the number displayed will probably not be accurate.

As far as the "The buzzer makes a weak and strange sound when I don't play a tone." , I dont have anything for you, just not much experiance with those kinds of sound transducers.

Maybe you could change the wiring around and wire the far end of the transducer to +5vdc instead of ground, tone should still work that way. Be sure to reverse the diode around if you try this way.

Lefty

Its a loudspeaker, not piezo, from that datasheet, so yes its needs a blocking capacitor and of about 22uF or so for 2kHz, more if lower frequencies are used. 0.5uF is way too small.

Yes the multimeter current reading should be zero, that's what DC blocking means.

retrolefty: Maybe you could change the wiring around and wire the far end of the transducer to +5vdc instead of ground, tone should still work that way. Be sure to reverse the diode around if you try this way.

I don't think I can do that because there are a + and - sign on the buzzer.

You misunderstand.

See Figure 3 of the datasheet. Wire transducer + to 5v, wire transducer - to resister to arduino pin, which acts as the transister. This way you are "pulling" current thru the part, vs "pushing" current.

If the arduino pin is commanded low via digitalWrite (pin, LOW); then there is no current flow.

This works perfectly! Thanks a lot! You really helped me out! :)