What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
You can make an Arduino play a piezo-buzzer rendition of “Never Gonna Give You Up” with an Arduino Uno Rev3, a passive piezo buzzer, jumper wires, and the Arduino IDE. The sketch uses Arduino’s tone() function to produce separate pitches; it does not play a recording or reproduce full-fidelity audio.
What this Arduino buzzer project does
The Arduino Project Hub tutorial, published January 24, 2022, shares a sketch that plays a melody rendition of “Never Gonna Give You Up” through a piezo buzzer. Its author, Rowan Packard, describes the code as one that “simply plays a Piezo buzzer rendition of the song.” The result is a sequence of electronic pitches, not vocals or a music recording.
Open the Arduino Project Hub tutorial and its schematic for the original project layout and downloadable sketch.
Free tools Windows power users keep installed
One-click scans. No signup required.
Parts and software
- Arduino Uno Rev3
- Passive piezo buzzer
- Jumper wires
- Arduino IDE
The tutorial identifies these parts and the IDE but does not provide enough textual wiring detail to reliably enumerate every connection. Follow the schematic on the project page rather than inferring a complete circuit from the sketch alone.
#1 Best Overall
- Passive Buzzer Module: Generates sound based on input signals, perfect for custom audio alerts in various projects.
- Frequency Adjustable: Control the tone and pitch by adjusting the input frequency, ideal for creating different sound effects.
- Low Power Consumption: Operates efficiently with minimal power, compatible with 3.3V to 5V systems.
- Wide Compatibility: Tutorials for Arduino, ESP32, ESP8266, Raspberry Pi are provided => Search for: DIYables passive buzzer module.
- Compact and Easy to Use: Small form factor, ideal for integrating into compact designs and quick prototyping.
How the sketch makes the melody
The sketch assigns the buzzer to digital pin 9 and configures that pin as an output in setup(). It stores note pitches and rhythm values in separate arrays, with material for the intro, verse, and chorus. The code begins in the chorus section and returns to the start after the final section.
For each non-rest note, the sketch calls tone(piezo, frequency, duration). The listed frequency constants span 208 Hz to 831 Hz. Rhythm values are multiplied by the sketch’s beatlength setting of 100 to calculate note durations. These are settings in this particular sketch, not general performance measurements or universal tempo recommendations.
Rank #2
- Passive Piezo Buzzer Module (2-Pack) – Generates sound based on input signal frequency, allowing for customizable audio tones and sound effects in DIY projects.
- Adjustable Frequency Output – Control pitch and tone using PWM signals from your microcontroller—ideal for creating music or alerts.
- Low Power & Broad Voltage Support – Operates with minimal power and works with 3.3V to 5V systems, including Arduino, ESP32, and Raspberry Pi.
- Compact & Easy to Use – Small, lightweight design with simple wiring makes it perfect for embedded systems, smart devices, or educational kits.
- Tutorials Available Online – Search “DIYables passive buzzer module” for example projects using Arduino, ESP32, ESP8266, and Raspberry Pi.
After each note step, the code waits, calls noTone() to stop the buzzer, turns off the built-in LED, and inserts a pause using the beat-separation constant of 0.3. Together, the pitch, rhythm, and pauses create the recognizable melody as a sequence of buzzer tones.
Recommended Free Tools
Choosing the right buzzer
Use a passive piezo buzzer for this melody project: the sketch needs a component that can produce different pitches when driven at different frequencies. An active buzzer generally produces a fixed tone, so it is not the direct match for a tune built from changing note frequencies. Check the component’s type before wiring it; the project page’s wording and code identify a piezo buzzer, while its title calls it passive.
Rank #3
- Active Piezo Buzzer Module for Arduino, ESP32, ESP8266, Raspberry Pi
- Equipped with fixing bolt holes for easy installation
- Working voltage 3.3V-5V
- Tutorials for Arduino, ESP32, ESP8266, Raspberry Pi are provided (Search for: DIYables active piezo buzzer module)
Build and upload the project
- Gather an Arduino Uno Rev3, passive piezo buzzer, and jumper wires, and install or open the Arduino IDE.
- Use the schematic on the project page to make the circuit. The textual description alone does not establish every wire connection.
- Open the project’s sketch in Arduino IDE and check that the buzzer output is assigned to pin 9, matching the circuit.
- Select the connected Uno board and its port in the IDE, then upload the sketch.
- After uploading, the sketch’s loop plays its stored sections and cycles back to the beginning.
What to check if it does not play
- No sound: Compare the wiring with the project schematic and confirm that the buzzer connection matches digital pin 9 in the sketch.
- Only one steady tone: Confirm that the component is a passive piezo buzzer rather than an active fixed-tone buzzer.
- Upload problems: Verify that the Uno board and correct port are selected in Arduino IDE.
What the project does not establish
The tutorial provides a piezo melody sketch and schematic, but it does not compare buzzer models or Arduino boards, nor does its text establish detailed wiring instructions beyond the schematic. Its disclaimer notes that the song is not the code author’s creative property; that note alone does not establish permissions for using the composition or any recording.
Quick Recap
Best Value
- High-volume boosts alerts with a robust 3-decibel output alert; ideal for Arduino, DIY electronics, and safety alarms
- Alarm pinger 9*5.5mm mini piezo buzzers easy 5V plug & play operation; Works seamlessly with computers and development boards
- Compact & energy efficient design draws <250mA current for versatile project integration
- Superior Sensitivity ensures clear audible signals from electronic toys to equipment
- Mini active piezo buzzer module with 9*5.5mm size, fits snugly in tight spaces without compromising sound quality
Rank #4
- Alarm pinger 12*8.5mm mini piezo buzzers easy 3V 5V 9V 12V 42Ohm resistance plug & play operation; Works seamlessly with computers and development boards
- High-volume boosts 42R 12085 3V-12V common alerts ideal for Arduino, DIY electronics, and safety alarms
- Mini active piezo buzzer module with 12*8.5mm size, fits snugly in tight spaces without compromising sound quality
- Superior Sensitivity ensures clear audible signals from electronic toys to equipment
- 12085 passive buzzer 12mmx8.5mm 42R resistance 3V 5V 9V 12V in common use mini piezo buzzers kit, diameter :12mm, height :8.5mm 42R 12085 3V-12V common
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

