Buzzer
A buzzer is an audio signaling component that turns electrical control into sound.
Part images
What it is
A buzzer is an audio signaling component that turns electrical control into sound.
How students use it
Students use buzzers for alarms, timers, button feedback, simple music, and sensor warnings. Active buzzers make a tone when powered; passive buzzers need a changing square wave.
Pins and power
Positive and negative pins. SunFounder notes the pin marked '+' is the anode, and the longer pin is also the anode.
DC-powered buzzer. Passive buzzers need a square wave, and SunFounder notes a typical passive-buzzer drive frequency range of 2 kHz to 5 kHz.
Active buzzer: connect with correct polarity and switch it on/off. Passive buzzer: use PWM or a square wave to create a tone.
Voltage and safety
Do not assume a buzzer can be driven directly from a GPIO at any current. Use the lesson circuit and current planning.
Buzzers can be loud up close. Start with short tests and keep it away from ears.
Datasheet notes
SunFounder explains active/passive buzzer behavior but does not identify one exact model number. Match the part marking before using a specific datasheet.
Common libraries
Use machine.Pin for active buzzer on/off. Use machine.PWM for passive buzzer tones.
Common mistakes
Mixing up active and passive buzzers, reversing polarity, using DC on a passive buzzer and expecting sound, and using a PWM frequency outside the useful range.