Electronic components: Buzzers
By Flavio Copes
Understand the difference between active and passive buzzers: active buzzers make one tone from DC power, while passive buzzers need a changing signal.
Buzzers are components that generate a sound.
There are 2 main kinds: active buzzers and passive buzzers.
In my set, the passive buzzer is on the left and the active buzzer is on the right:


An active buzzer contains its own oscillator. Apply its rated DC voltage and it produces a fixed tone. You can turn it on and off to create a beep pattern, but you normally cannot choose its pitch.
A passive buzzer does not contain that oscillator. It needs a changing signal at the frequency you want to hear. On Arduino, the simplest way to produce this signal is the tone() function.
The physical appearance is not a reliable way to identify every buzzer. Check the part number or datasheet when possible.
Also check its rated voltage and current. Do not power a buzzer directly from an Arduino pin if it needs more current than the pin can safely provide. Use a transistor driver in that case.
Use an active buzzer when you only need a beep. Use a passive buzzer when you want to play different notes.
Related posts about electronics: