कोशिश गोल्ड - मुक्त
MakerSpace Buzzer music: Simple melodies with the Pi Pico Buzz It, Baby!
Linux Magazine
|#297/August 2025: Cleaning Up
Use the buzzer to have your MCU play small wake-up melodies, signals, or music to accompany LED animations. The sound might not be a feast for the ears, but it does give your projects a great retro feel.

Every PC has at least a small beeper for signal tones. In the case of microcontrollers, you need to retrofit a buzzer to do this, but buzzers are too good for just outputting beeps. They are available for a small amount from the typical marketplaces, and you can choose between two basic types: active and passive. The active relies on a builtin oscillator to generate sound and only require two pins, while you need to feed a PWM signal to the passive. Besides voltage and earth, they require another pin for the signal.
The buzzers themselves look like small black pots with two pins (Figure 1, center and right). For active buzzers, you just need the component itself, but for passive buzzers, it makes sense to use a breakout with the required circuitry (Figure 1, left). There are also breakouts for active buzzers with three pins, but one of them is not assigned in this case. When purchasing, you can use the designation as a guide: Passive buzzers will be known as KY-006 or HW-508, while an active variant often has KY-012 in its name.
Because the parts are inexpensive, it’s a good idea to grab a handful of them. A single buzzer is fine for simple tone sequences, but it’s more fun if you have several of them so that you can create entire chords instead of just individual tones.
Pulse Width Modulation
PWM signals are levels that are switched on and off at fixed intervals, resulting in a typical square wave curve (Figure 2). The pitch of the buzzer output depends on the frequency. You could simply generate these PWM signals by switching a GPIO pin, but that would be painstaking and unnecessary. All microcontrollers have builtin hardware units for this; you just have to feed them the right parameters. In addition to the frequency, which is decisive for the pitch, this also includes the duty cycle, i.e., the proportion of active time that determines the volume.
यह कहानी Linux Magazine के #297/August 2025: Cleaning Up संस्करण से ली गई है।
हजारों चुनिंदा प्रीमियम कहानियों और 9,500 से अधिक पत्रिकाओं और समाचार पत्रों तक पहुंचने के लिए मैगज़्टर गोल्ड की सदस्यता लें।
क्या आप पहले से ही ग्राहक हैं? साइन इन करें
Linux Magazine से और कहानियाँ
Linux Magazine
Exercise Place
The GRUB 2 boot manager might seem intimidating at first glance. All the more reason to spin up a virtual playground so you can practice.
10 mins
#298/September 2025: Indie Game Studio
Linux Magazine
Terminal Mosaic
What's better than one command line? Many command lines that never die. Take the terminal to new places with Zellij.
9 mins
#298/September 2025: Indie Game Studio

Linux Magazine
MakerSpace
Build a Long-Range Sensor Network with ChirpStack Sensor Symphony
14 mins
#298/September 2025: Indie Game Studio

Linux Magazine
How Flatpak, AppImage, and Snap are changing software distribution Ship It!
Modern-day package systems solve some problems posed by classic formats like DEB and RPM. We look at Flatpak, AppImage, and Snap and describe how they differ.
12 mins
#298/September 2025: Indie Game Studio

Linux Magazine
Dashboard Delight
Simplify the chaos of self-hosted services with Homepage, a customizable dashboard with widgets that put service statistics at your fingertips.
9 mins
#298/September 2025: Indie Game Studio

Linux Magazine
MADDOG'S DOGHOUSE
Free software, and the FOSS community, can help technology students get the education they desire in Brazil and elsewhere.
3 mins
#298/September 2025: Indie Game Studio

Linux Magazine
Rethinking the Terminal
The Warp AI agent takes the guesswork out of working at the command line. We show you how to build a simple website with one prompt.
4 mins
#298/September 2025: Indie Game Studio
Linux Magazine
Just in Time
Just is a command runner that lets you define project-specific tasks in a declarative justfile.
7 mins
#298/September 2025: Indie Game Studio

Linux Magazine
The Watcher
This versatile security app checks for vulnerabilities, watches logs, and acts as a single interface for other tools.
7 mins
#298/September 2025: Indie Game Studio

Linux Magazine
NO INTERNETREQUIRED
This new utility lets you update a system that is notconnected to the Internet.
4 mins
#298/September 2025: Indie Game Studio
Listen
Translate
Change font size