Skip to content
E

Buzzer / Piezo

Controlling Active Buzzer Buzzer / Piezo with ESP32

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 ESP32

Wiring

Component pinESP32 pinNote
VCC3.3V or 5VCheck your module's rated voltage — most active buzzer boards work fine at 3.3V, but volume drops
GNDGND
I/OGPIO25Avoid GPIO strapping pins (0, 2, 12, 15) for this to prevent boot issues

Swipe sideways to see every column →

C++

Running the buzzer from 3.3V instead of 5V is fine electrically but noticeably quieter — if volume matters, power VCC from the ESP32's 5V pin (on dev boards that expose one) instead of 3V3, while I/O still connects to a 3.3V-logic GPIO.

Related Components

Related Guides & Projects