Introduction: Active Buzzer Raspberry Pi Pico

You can use a buzzer whenever you want to make some noise.

Supplies

Step 1: Princple

As a type of electronic buzzer with an integrated structure, buzzers, which are supplied by DC power, are widely used in computers, printers, photocopiers, alarms, electronic toys, automotive electronic devices, telephones, timers and other electronic products for voice devices. Buzzers can be active or passive

Step 2: Schematic Diagram

connect - to ground pin and + to gpio pin 16

Step 3: Source Code

# Active Buzzer micro python by Cryp7o

import utime

from machine import Pin


# Create a Pin object named "buzzer" connected to GPIO pin 16 as an output

buzzer = Pin(16, Pin.OUT)



while True:

  # Turn the buzzer on

  buzzer.high()


  # Pause the program execution for 1 second

  utime.sleep(1)


  # Turn the buzzer off

  buzzer.low()


  # Pause the program execution for 1 second

  utime.sleep(1)