Active Buzzer Raspberry Pi Pico

by cryp7o in Circuits > Raspberry Pi

679 Views, 1 Favorites, 0 Comments

Active Buzzer Raspberry Pi Pico

Screenshot 2023-09-21 151720.png

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

Supplies

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

Schematic Diagram

FGH3YWALMT6NQEH.png
Screenshot 2023-09-21 153435.png

connect - to ground pin and + to gpio pin 16

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)