3
\$\begingroup\$

I'm creating a simple circuit, where a microcontroller drives a piezo speaker. I couldn't find a datasheet for the piezo (the part number is HKDZ-G) but I know it has a internal oscillator and it's rated at 3V.

The speaker beeps are loud and clear 80% of the time. Occasionally, however, the sound will come out distorted (with a non-fixed higher pitch and lower volume, much like a teenager changing his voice). I can't really identify why.

This is the circuit schematic:

Circuit

This is the circuit:

Circuit

And this is the back of the circuit. The green wire is the one that leads from the MC to the speaker. While my soldering job is not so good, I tested all connections to see if their are not crossing. I also tried replacing the green wire (the photo is before the replacement) but with no success.

Circuit back

What causes the sound to come out distorted? Is it possible that there is some interference going on here? (I don't have an oscilloscope to test)

EDIT: I don't know if it's important to mention, but since the piezo has a internal oscillator, I'm not oscillating my signal, just plugging "1" on the MC pin output for a few hundred microseconds.

\$\endgroup\$
  • \$\begingroup\$ It would be interesting to know what the current draw of your piezo self-oscillator module is. If you don't have the data sheet, you might experiment with powering it through various resistors to get an approximate idea. Also, as a general principle you should additionally have a small bypass cap on the processor power rails to provide a lower impedance charge reservoir to power switching draw, since your electrolytic cap will have a fairly high ESR. \$\endgroup\$ – Chris Stratton Apr 30 '13 at 20:02
4
\$\begingroup\$

A likely cause for the occasional sound distortion is that the CR2032 cell is unable to sustain the current draw of the piezo buzzer plus the ATTiny for extended periods. This would be likely if:

  1. The buzzer is operated several times in quick succession, not giving the cell a chance to recover
  2. The ATTiny itself is consuming more power at certain times due to parts of its code

This hypothesis can be validated by running the buzzer directly off a partly depleted CR2032 for a few minutes - If the buzzer sound distorts like in the circuit after a bit, then the culprit has been identified.

Possible Solutions:

  1. Use two or three CR2032 cells in parallel for greater current sourcing capacity
  2. Use a reservoir capacitor of a relatively large value, to tide over the high load periods - This won't solve the problem, just alleviate it a bit
  3. Use a battery with more current delivery capacity
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I tested the battery directly, and the buzzer didn't seem to falter like it did with the MC. However, adding a 10uF capacitor to the buzzer seem to have done the trick! \$\endgroup\$ – André Wagner May 1 '13 at 18:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.