Free wiring guides
Wire the passive buzzer to the ESP32-C3
Passive piezo buzzer, 12 mm. Plays notes: the sketch sets the pitch.
When buying: Passive, so it can play different notes. An active buzzer only gives one pitch.
Which pin goes where
| On the part | On the ESP32-C3 |
|---|---|
| + | GPIO 10 |
| - | GND |
Wire it with the USB cable unplugged. Follow the names printed on your own part: makers sometimes reorder the pins.
In 3D
Example sketch
// Passive piezo buzzer, 12 mm
// on the ESP32-C3 Super Mini
// https://stem.manusignal.com/en/parts/passive-buzzer-esp32-c3
const int PIN_POS = 10;
const int NOTES[] = {262, 294, 330, 349, 392, 440, 494, 523};
void setup() {
pinMode(PIN_POS, OUTPUT);
}
void loop() {
for (int i = 0; i < 8; i++) {
tone(PIN_POS, NOTES[i], 200);
delay(250);
}
delay(1000);
}
- Tools > Board > ESP32C3 Dev Module (USB CDC On Boot: Enabled), then Tools > Port and choose the board's port.
This sketch is compiled for the board before the page is published. It has not been run on real hardware by us.
What you should see
It plays a rising scale of eight notes, pauses, and repeats.
If it does not work
- The buzzer only clicks.
- It is an active buzzer, or its two legs are reversed.
Build something with it
These Build Packs use this part on this board, with the same pins.
- Tea temperature coasterStand a cup of tea or coffee on it. It reads the cup's temperature without touching it and beeps when the drink is cool enough to sip.
- Banana clockA tiny clock in a banana-shaped case. It sets itself from the internet, shows the date when you press it, and beeps on the hour.
- Motion ghost lampA little ghost that sits dark and quiet until someone walks past. Then it glows and lets out a wail.
- Reminder mugA sleeve for your mug that counts every sip and reminds you to drink when you have gone too long without one.
- Mini distance beeperThe closer something comes, the faster it beeps and the redder its light, like the parking sensor on a car.
- Door sensorBeeps when a door or drawer opens and sends a notification to your phone.
More parts on the ESP32-C3
- ST7789 1.54 in TFT screenESP32-C3 · 7 wires
- ST7789 2.0 in TFT screenESP32-C3 · 7 wires
- GC9A01 round screenESP32-C3 · 7 wires
- SSD1306 OLED 0.96 in screenESP32-C3 · 4 wires
- SSD1306 OLED 0.91 in screenESP32-C3 · 4 wires
- 4.2 in e-paper screenESP32-C3 · 8 wires
- TTP223 touch sensorESP32-C3 · 3 wires
- Push buttonESP32-C3 · 2 wires
- Foot switchESP32-C3 · 2 wires
- Slide switchESP32-C3 · 2 wires
- SW-520D tilt switchESP32-C3 · 2 wires
- MC-38 door switchESP32-C3 · 2 wires
- AM312 PIR motion sensorESP32-C3 · 3 wires
- HC-SR04 ultrasonic sensorESP32-C3 · 4 wires
- Capacitive soil moisture sensorESP32-C3 · 3 wires
- BME280 sensorESP32-C3 · 4 wires
- MLX90614 infrared thermometerESP32-C3 · 4 wires
- SGP30 air quality sensorESP32-C3 · 4 wires
- HX711 load cellESP32-C3 · 4 wires
- KY-040 rotary encoderESP32-C3 · 5 wires
- 3×4 keypadESP32-C3 · 7 wires
- WS2812 LED ringESP32-C3 · 3 wires
- WS2812 LED stickESP32-C3 · 3 wires
- WS2812B LED stripESP32-C3 · 3 wires
- KY-016 RGB LEDESP32-C3 · 4 wires
- 2-channel relay moduleESP32-C3 · 4 wires
- 28BYJ-48 stepper motor (ULN2003)ESP32-C3 · 6 wires
- MAX98357A I2S amplifierESP32-C3 · 5 wires
- SX1262 LoRa module (Ra-01SH)ESP32-C3 · 9 wires