Single buzzer

cable

Single buzzer

cable

cable Wire buzzers

A three single colour LEDs are connected to the Raspberry Pi Pico using GP5, GP8, and GP13 each also using the nearest GND pins.
1. Connect the short (negative) leg to GND.
2. Connect the long (positive) leg to a GP pin.
3. A + symbol is sometimes used to show the positive leg.

play_circle stop_circle
# Import the Speaker component
from picozero import Speaker
from time import sleep

# Set up the buzzer with correct pin number
speaker = Speaker(5)

# Control the buzzer
speaker.play('c4') # play middle c for 1s
sleep(1) # speaker off for 1s
speaker.play('c4') # play middle c for 1s

bug_report My buzzer doesn't play a sound

  • Check the long (positive) leg is connected to GP5.
  • Check your connections.
  • Check the pin numbers in your code.