Connecting Buzzer with ESP32

The buzzer has two pins: Positive(Signal), Ground; The positive side of the buzzer is typically marked with a + symbol and is the longer pin, while the negative side (ground) is the shorter pin, similar to an LED. However, some passive buzzers may allow for either pin to be connected to ground or signal, depending on the specific model.

By the way, I used an active buzzer in my experiment. A passive buzzer is recommended if you plan to play different sounds, as it provides a better tone.

ESP32 Pin Wire Buzzer Pin Notes
GPIO 33
Positive Pin Receives PWM signals to produce sound.
GND
Ground Pin Connects to ground.
connecting buzzer with esp32