Skip to content
R

Buzzer / Piezo

Controlling Active Buzzer Buzzer / Piezo with Raspberry Pi

What is the Active Buzzer?

Active Buzzer practical reference

A buzzer with a built-in oscillator — just apply power to get a fixed-tone beep, no PWM signal generation required.

Key specifications

  • Operating voltage: 3V - 5V DC (5V typical on breakout modules)
  • Current draw: ~25-30 mA
  • Tone: Fixed frequency, ~2-4kHz — set by the buzzer's internal oscillator, not by your code
  • Control: Digital HIGH/LOW only — a plain digitalWrite() is enough, no tone() or PWM needed

Pinout and connection notes

Easy to tell apart from a passive buzzer without a multimeter: tap 5V straight to the pin briefly — an active buzzer beeps immediately, a passive one just clicks.

  • VCC: Power, 3V-5V DC
  • GND: Ground
  • I/O: Signal input — HIGH turns the tone on, LOW turns it off

Integration checklist

  1. Confirm the exact part number and breakout-board revision.
  2. Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
  3. Check controller pin assignments and bus address or interface mode against the example code.
  4. Power up with external loads disconnected, then test signals before full integration.
  5. 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 Active Buzzer with Raspberry Pi

Library

gpiozero by Ben Nuttall / Raspberry Pi Foundation

pip3 install gpiozero

Wiring

Component pinRaspberry Pi pinNote
VCC5V (physical pin 2)
GNDGND (physical pin 6)
I/OGPIO18 (physical pin 12)

Swipe sideways to see every column →

Python

gpiozero's Buzzer class is written for exactly this kind of active buzzer — it is just a named wrapper around a digital output pin, same idea as the Arduino/ESP32 sketches.

Related Components

Related Guides & Projects