[SOLVED] problem with arduino buzzer module

I bought this buzzer module:

This module presents 3 pins, /ground/IO/vcc/
And simply use a transistor to providing buzz.

board is pro mini 3.3v
my problem appear after calling:

analogWrite(3, 20):
delay(50);
analogWrite(3, 0):
delay(50);

after that Seems Buzz is finished but some quiet noises still sense able, which ended after i cut the i/o wire. This noises come back again when i touch the i/o pin of the module or connect it to the ground.

Is it a reverse flow trough the pin#3 (i decided pin3 for sending analog) which comes from module to arduino?

does it damage my output pin or even arduino board?

What is wrong and how can i solve it

P.s:/ also i used a zener diode between arduino and module but no success.

I can attach some schematics if realky needed.

That shouldn't be happening.

Is the buzzer ground connected to the Arduino ground?

What does the (unwanted) noise sound like? Is it similar to what you're hearing with analogWrite()? Or higher/lower pitch, or hiss or crackle, etc?

Are you sure the noise is coming from the piezo speaker?

Is that a "buzzer" or a "transducer"? A buzzer makes noise when you apply DC. A transducer/speaker is driven by an AC audio signal... If it makes a tone/buzz (not just background noise) with digitalWrite() it's a buzzer.

What are you using for a power supply? i.e. If you can try running if off a battery that can tell you if the noise is coming from the power supply.

Noise wouldn't be unusual with a normal-linear amplifier, but the transistor won't switch-on until you get nearly 1/2 of a volt and that would be a LOT of noise. And, you should get "dead silence" with the input grounded.

BTW - Is there a reason you're using analogWrite()? That can "work", but the default PWM frequency is a little low for a piezo. Normally, you'd use tone() with a transducer and digitalWrite() with a buzzer. With a transducer analogWrite(128) will give you a square wave for the loudest sound.

DVDdoug:
Is the buzzer ground connected to the Arduino ground?

Thank you for response.
yes sir.

DVDdoug:
What does the (unwanted) noise sound like? Is it similar to what you're hearing with analogWrite()? Or higher/lower pitch, or hiss or crackle, etc?

attached an amplified record of this noise (recorded by phone).

DVDdoug:
Are you sure the noise is coming from the piezo speaker?

Is that a "buzzer" or a "transducer"? A buzzer makes noise when you apply DC. A transducer/speaker is driven by an AC audio signal... If it makes a tone/buzz (not just background noise) with digitalWrite() it's a buzzer.

this buzzer uses DC voltage as input and analogWrite just charge its transistor to acting like a switch. there is a short "CHICK" like sound when i use digitalWrite(#pin, HIGH) which ended very fast.

DVDdoug:
What are you using for a power supply? i.e. If you can try running if off a battery that can tell you if the noise is coming from the power supply.

i used a wall adapter 5v, but i connected module VCC to arduino vcc for a 3.3v how ever this module is compatible with both 3.3 and 5 volts. BUT this noise can be sensed via USB powering.

DVDdoug:
Noise wouldn't be unusual with a normal-linear amplifier, but the transistor won't switch-on until you get nearly 1/2 of a volt and that would be a LOT of noise. And, you should get "dead silence" with the input grounded.

i used Arduino Ground for module GND-PIN,
this dead silence just occur when i disconnecting I/O pin of the module.

DVDdoug:
BTW - Is there a reason you're using analogWrite()? That can "work", but the default PWM frequency is a little low for a piezo. Normally, you'd use tone() with a transducer and digitalWrite() with a buzzer. With a transducer analogWrite(128) will give you a square wave for the loudest sound.

as i tested right now, when i use Tone(pin#3, Frequency, 50ms) that noise will be sense able, this occurs after digitalWrite(pin#3, LOW) !!

please help me to understand the reason of this noise! why my body cause this too when touching that I/O pin of module :o :fearful:

buzzer_noise.zip (26.3 KB)

why my body cause this too when touching that I/O pin of module

Your body will pick up a 50 or 60 Hz signal from the nearby AC wiring by capacitive coupling, and that signal is apparently enough to trigger the transistor on the buzzer module.

jremington:
Your body will pick up a 50 or 60 Hz signal from the nearby AC wiring by capacitive coupling, and that signal is apparently enough to trigger the transistor on the buzzer module.

Thanks,
I guess analogWrite(..., 0) also provide some less Hz signals because connecting buzzer base to other pins does not cause any noise.

//!\ also arduino ground also generate some noises

analogWrite(..., 0) actually produces a digitalWrite(..., 0).

Below the beginning of the analogWrite function in wiring_analog.c

void analogWrite(uint8_t pin, int val)
{
  pinMode(pin, OUTPUT);
  if (val == 0)
  {
    digitalWrite(pin, LOW);
  }
  else if (val == 255)
  {
    digitalWrite(pin, HIGH);
  }
  ...
  ...

sterretje:
analogWrite(..., 0) actually produces a digitalWrite(..., 0).

Below the beginning of the analogWrite function in wiring_analog.c

void analogWrite(uint8_t pin, int val)

{
  pinMode(pin, OUTPUT);
  if (val == 0)
  {
    digitalWrite(pin, LOW);
  }
  else if (val == 255)
  {
    digitalWrite(pin, HIGH);
  }
  ...
  ...

Well... is there any way to fully stop this signals instead of the "LOW"?

IF NOT : Is there any good practice to filtering this LOW noises?

ELSE : can sone one please tell me how many current maybe wasted or tell me the risk of damages when buzzer do noises for a long time (years) of work

Shall i use capacitor on IO pin to reduce small noises?

If yes, please tell me how.
Tnx

If you add a capacitor to an 'output' pin, you may damage the pin as the capacitor is initially a short.

.

its not the best solution but as no one did not offer any solution i have to solve this by self.

the problem mentioned in this thread was not ignore able because buzzer module was working anyway (without load sound) and takes valuable heat even with analogWrite(..., 0).

i solved this by using a transistor as switch to turning off the Buzzer when it is not used and simply connect its base to a digital PIN and before using buzzer via PIN3, i just activate it by digitalWrite(7, HIGH) and then after playing buzz normally, i deactivate it again with digitalWrite(7, LOW).

Hi,

I faced this buzzer hissing sound even after a call to noTone(pin);
The module was getting hot.

I figured out the buzzer module control pin is active low.

the inbuilt noTone() code is:

void noTone(uint8_t _pin)
{
 int8_t _timer = -1;
 
 for (int i = 0; i < AVAILABLE_TONE_PINS; i++) {
   if (tone_pins[i] == _pin) {
     _timer = pgm_read_byte(tone_pin_to_timer_PGM + i);
     tone_pins[i] = 255;
   }
 }
 
 disableTimer(_timer);

 digitalWrite(_pin, 0);
}

According to this code the buzzer control is made low, which is active in this buzzer module.

The solution would be to call digitalWrite(pin, HIGH);

This stopped the hissing sound and no heating of the buzzer module.