Buzzer: all about this device for sound


Generating a sound signal is something that is sought in several DIY projects, so the makers must use various devices to be able to generate such a sound. One of the devices that you can use is a small speaker, although that is not the most suitable if the only thing you send is an electrical signal, since it will generate a very characteristic crackle or snap due to the vibration of the membrane, but little sound. That’s why it’s best to use a buzzer.

The size is usually much smaller than conventional speakers, and best of all, the buzzer will generate a beep or sound that will attract more attention than that sound from a speaker if no audio signal is supplied. So if you are a maker and want to generate any alert for an event in your project, the device we present today will come as a ring to your fingertips…

What is a buzzer?

buzzer symbol

The buzzer or buzzer is an electronic device that acts as a transducer. Its function is to produce a high-pitched sound or buzzer while power is being supplied to it. That’s why it is ideal to integrate with Arduino, because when an event is generated that you want to warn or alert about, you could program the microcontroller to send a signal to the buzzer if that event happens and it will warn you with that sound.

By example, if you have used a temperature sensor and you want it to warn you when it exceeds 100ºC, then you can use the buzzer as an alert element and Arduino will send an electrical signal to the buzzer when the temperature sensor makes those measurements. Obviously, the applications you’ll find for it are very varied…

In your house, there are many devices where you can find buzzers, for example in alarm clocks. Many of these clocks use buzzers to emit the sounds, especially the small ones, although some may use speakers to wake you up with the radio, with some melody, etc. The truth is that you don’t have to disassemble anything to , in fact it’s very cheap and easy to find.

Types of buzzers

You can find several types, apart from those using electromagnet coils or piezoelectric disks:

  • Those that integrate oscillator: in this case an external oscillator is required to work well.
  • The ones without oscillator: the integrated oscillator makes the operation easier, you just have to apply a voltage to the buzzer terminals and you will have the sound.Important to remember that there are also special modules for Arduino with the buzzer and everything you need for an easy connection to your favorite DIY board.


Its constitution is simple, it only has an electromagnet or piezoelectric disk (depending on the type of buzzer) and a steel sheet. This is enough to emit the sound when the piezoelectric or electromagnet is supplied with power and it vibrates the metal sheet.

The most common ones are the piezoelectric type, in this case they have a metal sheet attached to a ceramic plate. When a tension between the two is applied, it arches with a click. When the voltage supplied ceases, they return to their normal state. But if clock or alternate pulses are generated, it will emit the sound beeps we are looking for.

Integration with Arduino

Buzzer connected to Arduino

Its integration with Arduino couldn’t be simpler, whether you buy a normal buzzer or a passive module for Arduino can be connected very easily and the code you have to write in Arduino IDE is really simple too (the basis, then it depends on what you want to add).

As for a simple code example, it could be the following one, in which the buzzer emits sound 1 second and stops, produces again 1 second, and so on:

/* Simple program to emit intermittent 1 second beeps */

const int buzzer = 9; //The pin to which the buzzer is connected is 9

void setup(){
  pinMode(buzzer, OUTPUT); // Pin 9 declared as output


void loop(){
  tone(buzzer, 50); // Sends 1Khz signal to the buzzer
  noTone(buzzer); // Stops the buzzer
  delay(1000); //Wait a second and repeat the loop

More information – Arduino programming manual

Leave a Comment