The Direct Answer: Standard Arduino Buzzer Dimensions
When sourcing audio feedback for embedded projects, makers typically encounter three distinct form factors. The exact Arduino buzzer dimensions depend on whether you are using a bare component, a cylindrical through-hole part, or a breakout module. Here are the precise measurements you need for enclosure design and breadboard prototyping:
- Bare Piezo Disc (e.g., 27mm): 27.0 mm diameter, 4.5 mm thick (including brass plate). Pin spacing is flexible, as you solder directly to the ceramic and brass surfaces.
- Cylindrical Electromagnetic/Piezo (e.g., TMB12A05): 12.0 mm diameter, 9.5 mm height. Standard pin spacing is 7.62 mm (0.3 inches), which aligns perfectly with holes 1 and 4 on a standard 0.1-inch breadboard row.
- Breakout Modules (KY-006 Passive / KY-012 Active): PCB dimensions are 33.0 mm x 13.0 mm. They feature a 3-pin male header with standard 2.54 mm (0.1 inch) spacing, occupying exactly 3 holes on a breadboard row.
Component Spec-Sheet Table
| Component Type | Diameter / Width | Height / Thickness | Pin Spacing | Breadboard Holes Occupied |
|---|---|---|---|---|
| Bare Piezo Disc (27mm) | 27.0 mm | 4.5 mm | N/A (Solder pads) | N/A (Requires header/leads) |
| TMB12A05 Cylindrical | 12.0 mm | 9.5 mm | 7.62 mm (0.3") | 2 holes (spans 3 holes total) |
| KY-006 / KY-012 Module | 13.0 mm (PCB) | 22.0 mm (Total w/ buzzer) | 2.54 mm (0.1") | 3 consecutive holes |
A standard solderless breadboard row has 5 holes spaced at 2.54 mm (total 10.16 mm). A 12mm cylindrical buzzer with 7.62 mm pin spacing will plug into holes 1 and 4. This leaves holes 2, 3, and 5 exposed on that specific row, allowing you to route jumper wires underneath or adjacent to the buzzer without removing it. However, the 12mm physical width of the cylinder will overhang and physically block access to the immediate adjacent rows on cheaper, narrow half-size breadboards. Always leave one empty row buffer on either side of a cylindrical buzzer.
Parts List & Breadboard Clearance Requirements
This guide and the accompanying code target the Arduino Uno R3 (AVR ATmega328P), though the physical dimensions and wiring apply equally to the Uno R4 Minima and Nano v3. Pricing reflects 2026 typical hobbyist supplier rates.
- Microcontroller: Arduino Uno R3 or compatible clone ($15.00 - $25.00)
- Passive Buzzer Module: KY-006 (Requires PWM/AC signal, ~$1.50)
- Active Buzzer Module: KY-012 (Built-in oscillator, requires only DC HIGH/LOW, ~$1.50)
- Prototyping: 830-point solderless breadboard and 22 AWG solid core jumper wires
Difficulty Rating: ★☆☆☆☆ (Beginner) | Time to complete: 15 minutes
Pin Mapping & Wiring the KY-006 / KY-012 Modules
Both the KY-006 (passive) and KY-012 (active) share an identical 3-pin footprint, but their internal circuitry differs. The KY-006 routes the signal pin directly to the piezo element, while the KY-012 includes an onboard NPN transistor and oscillator circuit.
Pin Mapping Table
| Module Pin | Silk Screen Label | Arduino Uno R3 Connection | Function |
|---|---|---|---|
| Pin 1 | S / Signal | D8 (Digital Pin 8) | PWM output (Passive) or Digital HIGH/LOW (Active) |
| Pin 2 | VCC / + | 5V | Power supply (Do not exceed 5.5V on KY modules) |
| Pin 3 | GND / - | GND | Common ground reference |
Wiring Steps
- De-energize the board: Ensure the Arduino is unplugged from USB before inserting modules to prevent accidental shorting of the 5V rail.
- Insert the module: Push the 3-pin header of the KY-006 or KY-012 into holes 1, 2, and 3 of row 'a' on the breadboard.
- Connect Ground: Run a jumper from the module's GND pin (row 'a', hole 3) to the Arduino's GND pin.
- Connect Power: Run a jumper from the module's VCC pin (row 'a', hole 2) to the Arduino's 5V pin.
- Connect Signal: Run a jumper from the module's S pin (row 'a', hole 1) to the Arduino's Digital Pin 8.
- Verify KY-006 Jumper (Passive Only): If using the KY-006, inspect the back of the PCB. There is a 2-pin header with a jumper cap. Ensure the jumper is installed to route power correctly; without it, the piezo disc will not resonate properly when driven by the standard
tone()library.
Complete Arduino Code: Driving Passive vs. Active Buzzers
The following sketch is written for the Arduino Uno R3 (AVR architecture). It uses the hardware timer-driven tone() function to generate a square wave for a passive buzzer. It includes compile-time checks to prevent uploading to incompatible architectures without modification, and basic runtime pin validation.
/*
* Passive Buzzer Melody Player
* Target Board: Arduino Uno R3 (AVR ATmega328P) / Nano v3
* Component: KY-006 Passive Buzzer Module
* Author: ElectricalFlux
*/
// Compile-time architecture check to prevent timer mapping errors on non-AVR boards
#if !defined(__AVR__)
#error "This sketch relies on AVR Timer2 for the tone() function. Please adjust for ESP32/RP2040."
#endif
// --- Pin Definitions ---
const uint8_t BUZZER_PIN = 8;
const uint8_t LED_PIN = LED_BUILTIN; // Visual feedback for debugging
// --- Note Frequencies (Hz) ---
#define NOTE_C4 262
#define NOTE_E4 330
#define NOTE_G4 392
#define NOTE_C5 523
void setup() {
Serial.begin(115200);
// Validate pin assignment
if (BUZZER_PIN >= NUM_DIGITAL_PINS) {
Serial.println("FATAL: BUZZER_PIN is out of bounds for this board variant.");
while(1); // Halt execution
}
pinMode(BUZZER_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
Serial.println("Buzzer initialized on Pin 8.");
}
void loop() {
// Play a simple C-Major arpeggio
playTone(NOTE_C4, 200);
playTone(NOTE_E4, 200);
playTone(NOTE_G4, 200);
playTone(NOTE_C5, 400);
// Silence between loops
noTone(BUZZER_PIN);
delay(1000);
}
// Wrapper function with basic safety handling
void playTone(unsigned int frequency, unsigned long duration) {
if (frequency < 31 || frequency > 65535) {
Serial.print("WARNING: Frequency out of AVR tone() bounds: ");
Serial.println(frequency);
return;
}
digitalWrite(LED_PIN, HIGH);
tone(BUZZER_PIN, frequency, duration);
delay(duration); // tone() is non-blocking, so we must delay to sequence notes
digitalWrite(LED_PIN, LOW);
}
Debugging: First Three Things to Check When It Fails
If your buzzer is silent, distorting, or throwing compiler errors, work through this ranked decision tree. These are the most common failure modes observed on the bench.
1. The KY-006 Jumper Pad is Missing or Misconfigured
Symptom: The code uploads successfully, the onboard LED blinks, but the KY-006 passive buzzer emits only a faint, high-pitched hiss or no sound at all.
Fix: Flip the KY-006 module over. You will see two unpopulated header pins near the resistor. If the jumper cap is missing, the piezo element is floating. Bridge the two pins with a jumper cap or solder a blob across the pads to complete the circuit path to ground.
2. Timer Interrupt Conflicts (The '__vector_7' Error)
Symptom: Compilation fails when you add a servo motor or an IR remote library to your sketch.
Exact Error String: core.a(Tone.cpp.o): In function '__vector_7': Tone.cpp:438: multiple definition of '__vector_7'
Cause: On the AVR ATmega328P, the default tone() library hijacks Timer2 (or Timer1 depending on the core version). The standard Servo.h library also demands Timer1. When both are called, the linker crashes on the interrupt vector collision.
Fix: You cannot use tone() and Servo.h simultaneously on an Uno R3. Switch to the toneAC library (which uses Timer1 in a way that can sometimes be multiplexed), or migrate to an ESP32/RP2040 where hardware timers are abundant. Alternatively, replace the passive buzzer with an active buzzer (KY-012) and use simple digitalWrite(), which requires zero hardware timers.
3. Using analogWrite() on a Passive Buzzer
Symptom: The buzzer clicks once on startup, then remains silent, or emits a static crackle without a distinct pitch.
Cause: A passive piezo buzzer requires an alternating current (AC) square wave to vibrate the ceramic element. analogWrite() outputs a DC Pulse Width Modulation (PWM) signal. The piezo disc will physically bend once when the voltage rises, and once when it falls, but it will not oscillate at an audible frequency.
Fix: Ensure you are using tone(pin, frequency) for passive buzzers. If you must use PWM for volume control, you need an H-bridge motor driver to alternate the polarity across the piezo disc.
Extending and Simplifying the Build
Depending on your project constraints, you may need to scale this audio feedback up for industrial environments or down for low-power wearables.
How to Simplify: Switch to an Active Buzzer
If you do not need variable pitches (e.g., you only need a simple 'beep' for a button press or alarm), swap the KY-006 for a KY-012 Active Buzzer. Active buzzers contain an internal oscillator. You simply apply 5V DC to the signal pin, and it sounds at a fixed frequency (usually ~2.3 kHz). This frees up your microcontroller's hardware timers for motor control or RF communication and reduces your code to basic digitalWrite(BUZZER_PIN, HIGH) commands.
How to Extend: Driving a 12V Industrial Piezo Siren
The Arduino's GPIO pins can only source ~20mA safely, and the 5V rail limits your acoustic output. To drive a loud 12V, 120mA industrial piezo siren (like the PUI Audio AI-1223-TF-3), you must use a transistor switch.
- Transistor: Use a 2N2222 NPN bipolar junction transistor (BJT) or an IRLZ44N logic-level MOSFET.
- Base Resistor: For the 2N2222, calculate the base resistor to limit current. (5V logic - 0.7V Vbe) / 10mA base current = 430Ω. Use a standard 470Ω resistor between Arduino Pin 8 and the transistor base.
- Flyback Diode: Electromagnetic buzzers and some piezo circuits generate inductive kickback. Place a 1N4007 diode in reverse bias (cathode to 12V, anode to transistor collector) across the buzzer terminals to protect your transistor from voltage spikes.
For deeper acoustic theory and component selection, refer to the TDK Electronics Buzzers Guide or the official Arduino tone() reference.
Frequently Asked Questions (FAQ)
What are the exact dimensions of a standard 5V Arduino buzzer?
The most common 'standard' 5V buzzer used in Arduino kits is the TMB12A05 electromagnetic cylindrical buzzer. It measures exactly 12.0 mm in diameter and 9.5 mm in height, with two steel pins spaced 7.62 mm (0.3 inches) apart. If you are using a breakout module (like the KY-012), the PCB measures 33.0 mm x 13.0 mm.
Will a 12mm cylindrical buzzer fit on a standard half-size breadboard?
Yes, but with spatial compromises. The pins will plug into the main terminal strips perfectly. However, because the cylinder is 12mm wide, it will physically overhang the center trench and block the adjacent 5-hole rows on narrow, 400-point half-size breadboards. On a full-size 830-point breadboard, it will fit comfortably with room to spare for jumper wires.
Why does my passive buzzer just click instead of playing a tone?
A single 'click' indicates the piezo ceramic is receiving a DC voltage step and bending once, but it is not receiving the rapid alternating square wave required to create resonance. This usually happens if you use digitalWrite() or analogWrite() instead of the tone() function. Ensure your code is calling tone(pin, frequency) to generate the necessary AC square wave.
Can I use an Arduino buzzer module with a 3.3V ESP32?
Active modules (KY-012) will usually trigger at 3.3V, though they will be noticeably quieter than at 5V because the internal oscillator is under-driven. Passive modules (KY-006) will work perfectly with an ESP32's 3.3V logic, as the piezo element simply responds to the voltage delta. However, you must use the ESP32's ledcWriteTone() PWM API instead of the AVR-specific tone() function, as the standard tone() library is not natively supported on ESP32 Arduino cores.






