Problem with buzzer on Arduino Nano

Hi Guys

I bought this buzzer Recommendations For You - DealeXtreme and I connected to digital pin #3, + to 3.3V and - to grn. I did not use any resistors. To be honest I do not know do I need use resistor :frowning:

This is code I used:

int ledPin = 3;                
void setup()
{
  pinMode(ledPin, OUTPUT);     
}

void loop()
{
  digitalWrite(ledPin, HIGH);   
  delay(1000);                  
  digitalWrite(ledPin, LOW);    
  delay(1000);                  
}

I have sound but I'm not happy with that. I attach sound file. Is anybody could give me some tips to resolve problem?

Regards


Sorry guys I can not attach sound file. I can say this sound like clicks.

If you read the customer review of the device you will see that it is a piezo type device and not a true buzzer. You must apply an oscillating signal on the S line to get it to sound. At present you are switching logic levels with 1 second intervals and what you are hearing is the transition from high to low Might I suggest you use the PWM output (set to 50%) as the signal "S" and switch that on and off as desired.

Hi jackrae

Yes, you right. I've seen this review now. Could you please point me to apply an oscillating signal on the S line. I have no idea how I should do that.

Regards

Use the tone function