active buzzer/Driving it/07. Quiet at boot
Driving it · 07 of 9

Quiet at boot

The board has no pull-down on SIGNAL, so from power-up until setup() drives the pin, the buzzer does whatever the pin does. On an ESP32-S3 dev board GPIO 0 is pulled HIGH by the BOOT button's resistor and beeps from the moment it gets power, and GPIO 43 rasps along with the boot messages. GPIO 4 floats and is quiet, which is why the book uses it.

Nothing holds SIGNAL down

SIGNAL goes through 1 kΩ to the transistor's base and nowhere else. Many driver boards add a resistor from the base to GND so an input nobody is driving reads as off. This one does not, so the buzzer's state before your sketch runs is decided entirely by your board: whatever its pin does from power-up until setup() takes it, the buzzer does too.

Quiet at boot
SIGNAL on
At reset
10 kΩ pull-up (BOOT button)
Before setup()
pulled up
Beeps unasked
yes
GPIO 0 on ESP32-S3. The TK36 has no resistor from SIGNAL to GND, so until the sketch drives this pin, the buzzer does what the pin does. Press Play to power the board up.

Pick a pin and power the board up. There are three kinds of answer.

Pulled LOW. A Pico starts every GPIO with a weak pull-down on, so GP15, like the rest, holds SIGNAL low and the buzzer stays quiet from the first instant.

Floating. ESP32-S3 GPIO 4 and an Uno's D9 start as inputs with nothing pulling them either way. A floating pin pushes no current into the base, so the transistor stays off and the buzzer is quiet in practice. Not guaranteed: a long loose wire, or a finger on SIGNAL, can make it click.

Pulled HIGH, or driven. These beep before your sketch has a say.

The pins to avoid

GPIO 0 on an ESP32-S3. On a dev board it carries the BOOT button and a 10 kΩ pull-up. Through that resistor and the block's 1 kΩ it feeds the base about 0.24 mA, which is enough to turn the buzzer fully on, so it sounds from power-up. Worse, the base holds GPIO 0 at about 0.9 V, and GPIO 0 is a strapping pin: the chip reads it at reset and needs a HIGH, at least 2.48 V, to run your firmware. It may start in download mode instead, and then setup() never runs to silence it.

GPIO 43 and 44 on an ESP32-S3. They are UART0, pulled up at reset, and the chip's ROM prints its boot messages on 43. The buzzer sounds from power-up and rasps along with the text.

D13 on an Uno. The bootloader blinks the L LED on D13 as it starts, at every reset and every upload, and the buzzer chirps with it. Harmless, and annoying.

Two lines, first

Whatever pin you use, make these the first two lines of setup():

pinMode(BUZZER_PIN, OUTPUT);
digitalWrite(BUZZER_PIN, LOW);

They shorten any noise to the time the board takes to reach them, which is moments. They cannot fix a pin that stops the board reaching them at all, which is the GPIO 0 case. For that, only a different pin will do.

When it does not work

It screams as soon as I plug the board in.

SIGNAL is on a pin that is HIGH or pulled up before your sketch runs: GPIO 0, 43 or 44 on an ESP32-S3, for example. Move it to GPIO 4, and make pinMode and digitalWrite LOW the first two lines of setup().

With the buzzer on GPIO 0 my ESP32-S3 will not run my sketch.

GPIO 0 has to be HIGH at reset for the chip to run its firmware. The block's transistor base drags it down to about 0.9 V through the 1 kΩ, which is not a HIGH, so the chip can start in download mode and wait there, beeping. Move SIGNAL off GPIO 0.

My Uno chirps every time I upload.

SIGNAL is on D13. The Uno's bootloader blinks the L LED on D13 as it starts, which is every reset and every upload, and the buzzer blinks with it. D9 is quiet.

Where this goes next

Patterns that play while the sketch keeps working.

Beeps without delay()

Edit this page — content/books/active-buzzer/quiet-at-boot.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

Active Buzzer

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum