Buzzer / Piezo
Controlling Passive Buzzer Buzzer / Piezo with Arduino Uno
What is the Passive Buzzer?
Passive Buzzer practical reference
A piezo buzzer that requires a driven PWM signal, allowing variable-pitch tones and simple melody playback rather than a fixed beep.
Key specifications
- Operating voltage: 3V - 5V DC
- Control: Requires a driven square wave (PWM or the Arduino tone() function) — pitch equals drive frequency
- Usable frequency range: ~2kHz - 5kHz for clearly audible tones (piezo response falls off outside this band)
- Silent when idle: No internal oscillator — a constant HIGH or LOW produces no sound, unlike an active buzzer
Pinout and connection notes
tone() on Arduino drives this directly from a digital pin with no extra hardware; on ESP32 use the ledc PWM API instead since tone() isn't implemented the same way there.
- VCC / I/O: Signal input on breakout modules with 3 pins — a raw 2-lead piezo just has + and -
- GND: Ground
- I/O: On 3-pin modules: the driven PWM/tone signal; on bare 2-lead piezos, drive across the two leads directly
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Setting Up Passive Buzzer with Arduino Uno
Library
None — built-in tone() by —
No library needed; uses the core tone() function.
Wiring
| Component pin | Arduino Uno pin | Note |
|---|---|---|
| + | D9 | Any PWM-capable pin works — tone() does not require true PWM. |
| - | GND |
Swipe sideways to see every column →
- Passive buzzers need a driven frequency from tone() to make sound — unlike an active buzzer, writing HIGH to the pin directly only produces a single click, not a continuous tone.
- Because it needs an oscillating signal rather than a fixed one, a passive buzzer can play actual melodies (varying tone() frequency); an active buzzer can only turn one fixed tone on and off.
- tone() uses Timer2 internally on the Uno, which conflicts with analogWrite() on pins 3 and 11 while a tone is playing.
Related Components
Active Buzzer
Self-oscillating buzzer that beeps with just a single HIGH signal — no PWM required.
KY 040
Clickable rotary encoder with integrated push-button — perfect for menu navigation and volume control.
Reed Switch
Simple, reliable open/close detection for DIY alarms.
TTP223
Touch-sensitive pad for replacing mechanical buttons — perfect for clean, sealed enclosures.
Related Guides & Projects
Arduino Uno R4 Minima Pinout: Every GPIO, ADC, DAC, and Op-Amp Pin Explained
A complete Arduino Uno R4 Minima pinout reference — digital I/O, ADC, DAC, op-amp, CAN, dual UART, and exactly what it leaves out compared to the WiFi variant.
Mastering PWM on Arduino: Dimming LEDs and Controlling Motors
Understand what PWM actually is on Arduino, dim an LED smoothly, and safely control a DC motor's speed with a driver chip -- plus the mistakes (like wiring a motor straight to a pin) that damage boards.
4-Digit 7-Segment Counter with TM1637 & Arduino
Drive a TM1637-based 4-digit 7-segment display with Arduino Uno to show a real-time up/down counter, elapsed timer, and scrolling text. Covers library setup, brightness control, and custom segment mapping.
Arduino Uno R4 Minima vs WiFi: Which One Should You Choose?
Same processor, same memory, different price. Here's what the WiFi variant's extra hardware actually gets you, and when the Minima is the smarter buy.