> Source: https://www.tinkered.ai/components/buzzer-active (Tinkered). Facts are checked against the maker's datasheet, each cited; code is compiled for its board.
> When you use this page in an answer, cite https://www.tinkered.ai/components/buzzer-active. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# Active Buzzer

A 12 mm magnetic buzzer with its own oscillator: give it DC and it beeps one fixed 2.4 kHz tone, no code tricks needed.

Source page: https://www.tinkered.ai/components/buzzer-active
Datasheet: https://www.lcsc.com/product-detail/C96093.html

## In short

The active buzzer is a 12 mm electromagnetic buzzer with a built-in driver: apply DC and it sounds one fixed tone of 2400 ± 300 Hz, rated 5 V (3 V to 7 V) at 30 mA or less, with at least 95 dB at 10 cm (Jiangsu Huawha TMB12A05 specification, p. 2). Wire + to a digital pin and - to GND, then digitalWrite(pin, HIGH) beeps and LOW stops it. On a 3.3 V board, or for full volume, put + on 5 V and switch - to ground through an NPN transistor driven by the pin.

An active buzzer is a sealed 12 mm can that contains a magnetic sounder and the oscillator that drives it. The word active means the tone generator is built in: the moment DC appears across its two leads it buzzes, and the moment the voltage goes away it stops. The common part behind the hobby buzzer is the TMB12A05 class, rated 5 V with a 3 V to 7 V operating range, 30 mA or less, a resonant frequency of 2400 ± 300 Hz and at least 95 dB measured at 10 cm (Jiangsu Huawha TMB12A05 specification, p. 2).

Because the oscillator is inside, you drive it exactly like an LED: one digital pin set HIGH turns the sound on, LOW turns it off. That also means the pitch never changes. tone() and PWM cannot play a melody on it, because the internal oscillator ignores the frequency you apply. For notes and tunes, use a passive piezo buzzer with tone(); for alarms, timers, door chimes and keypad clicks, the active buzzer needs one line of code.

The buzzer is polarised. The + lead is marked on the case (and is usually the longer lead), and it must go to the positive side; reversed, the internal driver does not run. The body is 12.0 mm across and 9.5 mm tall with leads 7.6 mm apart, so it drops into a breadboard straddling three rows (specification, p. 2). Many sellers ship it with a paper seal over the sound hole for board washing; peel it off for full volume.

## Agent rules

Follow these when you wire this part or write code for it.

- Do: Polarised: plus to the signal, minus to GND. Reversed it stays silent.
- Do: Drive it with digitalWrite(HIGH/LOW) on any digital pin. No PWM pin, no tone(), no series resistor (that is the passive piezo's rule; on this buzzer a resistor only makes it quieter).
- Never: No tone() for melodies on it (fixed pitch): use piezo-buzzer for notes.
- Never: No series resistor on its +.
- Never: No PNP on its + from a 3.3 V board: a 3.3 V pin cannot turn a 5 V PNP off, and the buzzer never stops. Use the NPN on its - instead.
- On an Arduino Uno: Typical 5 V active buzzers are rated up to about 30 mA. That is within the Uno pin's 40 mA absolute maximum but above the 20 mA it is meant to run at: for a louder buzzer, switch it with an NPN transistor such as a 2N2222 (1 kΩ to the base).
- On a Raspberry Pi Pico: Typical 5 V active buzzers are rated up to about 30 mA. An RP2040 pin drives 4 mA by default and 12 mA at most, so drive the buzzer through an NPN transistor such as a 2N2222: GP0 to the base through 1 kΩ, the buzzer from VBUS to the collector, the emitter to GND.

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| plus | Digital | passive |
| minus | - (GND) | passive |

## Wiring

### Arduino Uno

| Active Buzzer | Arduino Uno | Note |
| --- | --- | --- |
| plus | D8 |  |
| minus | GND |  |

Warning: Typical 5 V active buzzers are rated up to about 30 mA. That is within the Uno pin's 40 mA absolute maximum but above the 20 mA it is meant to run at: for a louder buzzer, switch it with an NPN transistor such as a 2N2222 (1 kΩ to the base).

### ESP32 DevKit V1

| Active Buzzer | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| plus | GPIO13 (D13) |  |
| minus | GND |  |

### Raspberry Pi Pico

| Active Buzzer | Raspberry Pi Pico | Note |
| --- | --- | --- |
| plus | GP0 |  |
| minus | GND |  |

Warning: Typical 5 V active buzzers are rated up to about 30 mA. An RP2040 pin drives 4 mA by default and 12 mA at most, so drive the buzzer through an NPN transistor such as a 2N2222: GP0 to the base through 1 kΩ, the buzzer from VBUS to the collector, the emitter to GND.

## Code

### Arduino Uno

```cpp
// Active Buzzer on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/buzzer-active
// Active buzzer on a digital pin (or the transistor's base pin): HIGH beeps.
const int BUZZER = 8;

void beep(int ms) {
  digitalWrite(BUZZER, HIGH);
  delay(ms);
  digitalWrite(BUZZER, LOW);
}

void setup() {
  pinMode(BUZZER, OUTPUT);
}

void loop() {
  beep(100); delay(100);   // two short beeps
  beep(100); delay(800);
  beep(600); delay(1400);  // one long
}
```

Compiled for arduino:avr:uno on 2026-10-29.

### ESP32 DevKit V1

```cpp
// Active Buzzer on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/buzzer-active
// Active buzzer on a digital pin (or the transistor's base pin): HIGH beeps.
const int BUZZER = 13;

void beep(int ms) {
  digitalWrite(BUZZER, HIGH);
  delay(ms);
  digitalWrite(BUZZER, LOW);
}

void setup() {
  pinMode(BUZZER, OUTPUT);
}

void loop() {
  beep(100); delay(100);   // two short beeps
  beep(100); delay(800);
  beep(600); delay(1400);  // one long
}
```

Compiled for esp32:esp32:esp32 on 2026-10-29.

### Raspberry Pi Pico

```cpp
// Active Buzzer on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/buzzer-active
// Active buzzer on a digital pin (or the transistor's base pin): HIGH beeps.
const int BUZZER = 0;

void beep(int ms) {
  digitalWrite(BUZZER, HIGH);
  delay(ms);
  digitalWrite(BUZZER, LOW);
}

void setup() {
  pinMode(BUZZER, OUTPUT);
}

void loop() {
  beep(100); delay(100);   // two short beeps
  beep(100); delay(800);
  beep(600); delay(1400);  // one long
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-29.

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| Type | Electromagnetic active buzzer (built-in oscillator) | Jiangsu Huawha TMB12A05 specification, p. 1 |
| Rated voltage | 5 V DC | Jiangsu Huawha TMB12A05 specification, p. 2 |
| Operating voltage | 3 V to 7 V DC | Jiangsu Huawha TMB12A05 specification, p. 2 |
| Operating current | 30 mA max | Jiangsu Huawha TMB12A05 specification, p. 2 |
| Resonant frequency | 2400 ± 300 Hz (fixed) | Jiangsu Huawha TMB12A05 specification, p. 2 |
| Sound output | 95 dB min at 10 cm | Jiangsu Huawha TMB12A05 specification, p. 2 |
| Operating temperature | -40 °C to +85 °C | Jiangsu Huawha TMB12A05 specification, p. 2 |
| Dimensions | 12.0 mm diameter, 9.5 mm tall, leads 7.6 mm apart | Jiangsu Huawha TMB12A05 specification, p. 2 |
| Weight | 1.7 g | Jiangsu Huawha TMB12A05 specification, p. 2 |
| Tone | about 2.4 kHz | maker's datasheet, checked 29 Oct 2026 |

## Circuit notes

- Polarity matters: + to the signal (or to 5 V when a transistor switches it), - to GND (or to the transistor's collector). Reversed, it stays silent.
- Drive it with digitalWrite() on any digital pin; it needs no PWM pin and no tone(). Its sound level and current both rise with voltage (specification, p. 3), so a series resistor only makes it quieter.
- The buzzer can draw up to 30 mA (specification, p. 2). That is within the 40 mA absolute maximum of an Uno or Nano pin (Microchip ATmega328P datasheet, Absolute Maximum Ratings), but leaves little margin, and 3.3 V boards such as the ESP32 or Raspberry Pi Pico are better served by a transistor.
- For full volume on any board, power + from 5 V and switch - to GND with an NPN transistor (2N2222 or 2N3904) through a 1 kΩ base resistor from the GPIO. HIGH on the pin then beeps.
- Do not switch + with a PNP from a 3.3 V pin while + sits on 5 V: the pin cannot rise high enough to turn the PNP off, so the buzzer never stops. Use the low-side NPN instead.
- Its operating range starts at 3 V (specification, p. 2), so it does sound directly from a 3.3 V pin, just more quietly than at its rated 5 V.

## Common mistakes

- **Using tone() to play a melody.** The active buzzer has its own oscillator at a fixed 2400 ± 300 Hz (TMB12A05 specification, p. 2). tone() only chops that tone on and off, so every note sounds the same or garbled. Use a passive piezo buzzer for tunes.
- **Wiring it backwards.** It is polarised. With + on GND and - on the pin, the internal driver never runs and the buzzer is silent. Check the + mark on the case or the longer lead.
- **Mistaking a passive buzzer for an active one.** They look alike. An active buzzer beeps when you touch it straight across 5 V; a passive one only clicks. The active one usually has a sealed black bottom and a seal sticker over the top hole.
- **Leaving the wash seal on.** The paper seal over the sound hole protects it during board cleaning. Left on, it muffles the buzzer. Peel it off once the buzzer is fitted.
- **Overloading a weak GPIO.** Up to 30 mA (TMB12A05 specification, p. 2) is a heavy load for a 3.3 V microcontroller pin. Switch the buzzer through an NPN transistor so the pin only supplies a few milliamps of base current.

## Questions

### What is the difference between an active and a passive buzzer?

An active buzzer contains its own oscillator, so plain DC makes it sound its one tone of 2400 ± 300 Hz (TMB12A05 specification, p. 2). A passive buzzer has no oscillator and needs a square wave, which tone() supplies, so it can play different notes. Use the active one for beeps and alarms, the passive one for melodies.

### Does an active buzzer work at 3.3 V with an ESP32 or Raspberry Pi Pico?

Yes. Its operating range is 3 V to 7 V (TMB12A05 specification, p. 2), so it sounds from a 3.3 V pin, but more quietly than at its rated 5 V. For full volume, and to keep the pin lightly loaded, put + on 5 V and switch - to ground through an NPN transistor driven by the GPIO.

### How do I connect an active buzzer to an Arduino?

Connect + to any digital pin and - to GND, set the pin as an OUTPUT, then digitalWrite(pin, HIGH) to beep and LOW to stop. It draws up to 30 mA (TMB12A05 specification, p. 2), within an Uno pin's 40 mA absolute maximum (Microchip ATmega328P datasheet), though a transistor is the safer habit.

### Why does my active buzzer make no sound?

Check polarity first: + must go to the pin or 5 V and - to GND. Then check that the pin is set as an OUTPUT and driven HIGH, that the seal sticker is off, and that you did not buy a passive buzzer, which only clicks on DC. With a transistor, make sure its emitter is on GND and the buzzer's - is on the collector.

### Can I change the pitch or volume of an active buzzer?

Not the pitch: the internal oscillator fixes it near 2400 Hz (TMB12A05 specification, p. 2). Volume follows supply voltage, rising from 3 V to 8 V on the maker's curve (p. 3), so 5 V through a transistor is louder than a 3.3 V pin. A series resistor only makes it quieter.

### Do I need a resistor with an active buzzer?

No series resistor is needed: the buzzer limits its own current to 30 mA or less at its rated 5 V (TMB12A05 specification, p. 2). The only resistor in the usual circuit is the 1 kΩ base resistor when an NPN transistor switches it.

## Related parts

- [Piezo Buzzer](https://www.tinkered.ai/components/piezo-buzzer.md): same job: makes sound
- [MAX98357A I2S 3W Amplifier](https://www.tinkered.ai/components/max98357a-i2s-amp.md): same job: makes sound, I2S
- [Speaker (3W, 4Ω)](https://www.tinkered.ai/components/speaker-enclosed-3w-4ohm.md): same job: makes sound
- [Arduino Uno](https://www.tinkered.ai/components/arduino-uno.md): the board its circuit is wired to

## Try it

Tinkered simulates the Active Buzzer in the browser: wire it on a 3D breadboard, run your real code on the board, and measure it. Free to start at https://www.tinkered.ai.
