Arduino Sound and Music Projects: Buzzer, Melodies and Piano
With a buzzer and a few lines of code you can make your Arduino sing. In these projects you'll learn to play notes with the tone() function, build a piano with buttons and set up audible alert systems. Remember that you need a passive buzzer to play melodies.

Using a Buzzer
Ever wondered how a doorbell or an alarm makes its sound? The Arduino makes a small buzzer beep at short intervals: beep, pause, beep, pause. You see how sound is made with electricity and take the fi

Frequency Setting with Buzzer
You control the sound of a buzzer with four buttons: one starts the sound, one silences it, and the other two make it higher or lower. Hold the up or down button and the pitch changes step by step, sl

Turkish National Anthem with Buzzer
Press the button and a small buzzer starts playing the Turkish National Anthem, note by note. The Arduino plays every note at the right pitch and for the right length, performing two verses of the ant

Playing Melodies with an IR Remote and Buzzer
Build a music box that plays tunes with the buttons of a TV remote. An infrared receiver catches the remote's signal; one button plays a lively video game tune through the buzzer, another a familiar c

Doorbell and Light with Motion Sensor
When someone comes up to your door, you know before they even ring. As soon as the motion sensor spots someone, the LED lights up and the buzzer plays a three-note chime from high to low; when the tun

Simple Piano with Buzzer and Button
Build your own little piano with eight buttons. Each button is one note, from low to high: do, re, mi, fa, sol, la, ti and high do. The note plays through the buzzer as long as you hold the button and

Parking Sensor with HC-SR04
A mini version of a car's parking sensor: the closer something gets, the faster the beeps. The distance sensor measures the object in front of it; if it is more than 20 centimetres away the green LED

Bomb Animation with 4-Digit 7-Segment Display
The ticking bomb scene from the films, right on your desk and completely harmless: the 4-digit display counts down from 1:05, the buzzer beeps every second and the red LED blinks. You decide which of

Arduino Reaction Time Test with Sound Cue: Measure Your Reflexes in Milliseconds (LCD + Buzzer + 3 LEDs)
How fast are your reflexes? Press the button: the red LED says get ready, the yellow LED says steady and a random wait of 1.5 to 3.5 seconds begins. The moment the green LED lights up and the buzzer beeps, press again; your reaction time appears on the I2C LCD in milliseconds, with your session best and average below it. Press before green and the screen shows TOO EARLY! with a losing sound. Hold the button for a new player, so everyone races the same wait order.

ESP32 Melody Playback with Buzzer
Playing a simple melody (Twinkle Twinkle Little Star) with a passive buzzer. We play notes with tone() and noTone() functions like in Arduino - ESP32 works with the same syntax as Arduino Core 3.0+. Passive buzzer must be used (active buzzer does not play melody).

ESP32 Parking Sensor (HC-SR04 + 5-LED Bar + Buzzer + OLED)
The ESP32 version of a car parking sensor! The HC-SR04 ultrasonic sensor measures the distance to the object in front. As it gets closer, a 5-LED bar fills up (green → yellow → red) and the buzzer beeps faster. Very close (under 10 cm), a continuous alarm sounds and all LEDs light up. The SSD1306 OLED display shows the live distance in cm in large text, plus a status message.

Arduino Magic Drawing Tablet (2 Potentiometers + OLED Display)
We are rebuilding the classic magic drawing tablet with an Arduino! The left potentiometer moves the pen horizontally, the right one vertically, and the 0.96 inch OLED keeps a continuous line. The PEN button lifts and lowers the pen, while the CLEAR button wipes the screen with an eraser animation and a buzzer sound. A fun beginner project about analog input, jitter filtering and drawing on a display.

Arduino Ultrasonic Theremin (HC-SR04 + NeoPixel Ring + Buzzer)
A musical instrument you play without touching it, just by moving your hand in the air! As your hand gets closer to the HC-SR04, the passive buzzer plays higher notes and the 24-LED NeoPixel ring shows each note with color and fill level. A button switches between two modes: in SCALE mode every distance snaps to a note of a pentatonic scale, and in GLIDE mode the sound slides smoothly like an old sci-fi movie. Your hand writes the melody, not the code.

ESP32 Robot Eyes (OLED Display + TTP223 Touch Sensor)
A desk robot with feelings! The ESP32 draws two eyes on a 0.96 inch OLED that look around and blink on their own. Tap the TTP223 touch sensor and the robot gets happy, hold it and the eyes turn into hearts, poke it too often and it gets angry, ignore it for 20 seconds and it falls asleep. A passive buzzer gives every mood its own sound: a state machine, shape-based animation and non-blocking audio in one project.

ESP32 Pomodoro Timer (NeoPixel Ring + Button + Buzzer)
A glowing desk timer that keeps you off your phone while you study! The 24-LED NeoPixel ring shows the time left like a clock face: work is red, short breaks are green and the long break after every four sessions is blue. In the last 5 seconds the ring flashes and the passive buzzer ticks, then a rainbow celebrates the finished phase. One button starts, pauses and resets, all on an ESP32 without a single delay().

Raspberry Pi Pico LED Tug of War Game (NeoPixel Strip + 2 Buttons + Buzzer)
A two-player button duel! The Raspberry Pi Pico turns a 30-LED WS2812B NeoPixel strip into a rope: red player on the left, blue player on the right. Every press pushes your color one LED forward; fill the whole strip to win the round, and take 3 rounds to win the match. Press too early in the countdown and you lose ground, the passive buzzer gives each player a different click, and the match ends in a rainbow. neopixel, debouncing and non-blocking sound in MicroPython.

Raspberry Pi Pico LED Campfire (8x8 NeoPixel Matrix + Potentiometer + Buzzer)
A campfire that doesn't burn or warm anything, but still crackles! The Raspberry Pi Pico draws a realistic flame on an 8x8 NeoPixel matrix, recalculated every frame: sparks appear at the base, heat cools as it rises and glows from red to white. A potentiometer sets the flame height, a button switches between Fire, Gas, Magic and Amethyst themes, and a buzzer adds the crackle of burning wood. Procedural animation, ADC, PWM and MicroPython in one project.

Raspberry Pi Pico Parking Sensor (HC-SR04 + 3 LEDs + Buzzer)
Bring your car's reverse parking sensor to your desk! The Raspberry Pi Pico uses an HC-SR04 ultrasonic sensor to measure the distance to an obstacle about 16 times a second. As it gets closer, the green, yellow and red LEDs light up in turn and the buzzer beeps faster; under 10 cm the tone turns continuous and the red LED flashes. Ultrasonic ranging, PWM sound and non-blocking timing in one project.

Raspberry Pi Pico Button Piano (5 Buttons + Buzzer + Melody Recorder)
A five-key mini piano that remembers what you play! The Raspberry Pi Pico plays DO, RE, MI, FA and SOL on a passive buzzer from five buttons, and a note lasts as long as you hold its key. Hold DO for a second, play your tune, then hold DO again: the Pico plays it back, shortening silences longer than 1.5 seconds between notes to 1.5 seconds. The record indicator is the LED already on the board, so no extra parts. PWM notes, debouncing and non-blocking timing in one project.

Raspberry Pi Pico Memory Game (4 LEDs + 4 Buttons + Buzzer)
How many rounds can you last? The classic color and sound memory game comes to your desk with a Raspberry Pi Pico. The Pico plays a random color sequence, each color with its own LED and its own note. Repeat it in the same order on 4 buttons and one more color joins every round. Press a wrong one and the buzzer plays a game over tune while the right color blinks. Lists, random numbers and button reading in one game.

Raspberry Pi Pico Flappy Bird (OLED Display + Button + Buzzer)
That infuriating bird from your phone, now on a 0.96 inch OLED with a single button! A Flappy Bird style game on the Raspberry Pi Pico: every button press makes the bird flap, each pair of pipes you pass scores a point and the gaps get tighter. A buzzer plays the flap, point and record sounds. The high score lives in flappy_best.txt, so it survives a power cut. Physics, collisions and a 30 FPS game loop in one file.

Arduino Cyclone Game: Stop the Light in the Middle (7 LEDs + Button + Buzzer)
Can you stop it on the red LED? A desktop version of the arcade Cyclone game: a light bounces across 7 LEDs and you score by pressing the button while the red centre LED is lit. Every hit reduces the time per LED by about 15%, down to a minimum of 45 ms, and the buzzer plays a tune. A wrong press costs a life, and the game ends after 3. The best score is kept in EEPROM, so it survives a power cut.

ESP32 Earthquake Shake Alarm (MPU-6050 + OLED Display + Buzzer)
When your desk shakes, this screen notices first! The ESP32 measures vibration with an MPU-6050 accelerometer and draws a live trace that scrolls like a seismograph on a 0.96-inch OLED display. When the shaking passes the threshold, a passive buzzer sounds a siren and the red LED flashes; one button silences and resets it. It is an educational shake meter, not an official earthquake warning.

Arduino Birthday Surprise Box (LDR + Buzzer + 3 LEDs)
They opened the gift box and the box started singing! An LDR hidden inside notices the light when the lid opens; the buzzer plays "Happy Birthday" and 3 LEDs light up with the notes. When the song ends, the LEDs flicker like birthday candles. Make it as a gift for someone you love: it runs on batteries and goes quiet when the lid closes.

Arduino Tetris (MAX7219 8x32 LED Matrix + 4 Buttons + Buzzer)
No screen, just 256 LEDs: Tetris with music on an Arduino! A MAX7219 8x32 LED matrix standing upright becomes an 8 wide, 32 tall playfield, and 4 buttons move, rotate and drop the pieces. A passive buzzer plays the Tetris theme, full rows flash away and the game speeds up every 2 rows. The matrix is driven without a library, and the best score is kept in EEPROM.

Arduino Alien Attack (0.96 inch OLED + Joystick + Buzzer)
The 1978 legend on a 0.96 inch screen! On a 128x64 OLED, an army of 15 aliens marches, steps down at every edge and speeds up as it thins out. The joystick steers the ship like a wheel and its button fires; there are 4 shields, a bonus UFO and waves that keep getting harder. A passive buzzer plays the classic march and the effects, and the best score is kept in EEPROM.

Arduino Whack-a-Mole Game (4 LEDs + 4 Buttons + TM1637 Display)
Hit it the moment it lights up! The arcade classic whack-a-mole on your desk: one of 4 LEDs lights up at random, and if you press the button of the same colour before it goes out, you score. Every 5 hits is a new level and the moles stay up for less time. A wrong button costs 1 point and 3 seconds. Time and score show on the TM1637, the record lives in EEPROM, and a passive buzzer gives each hole its own sound.

Arduino Quiz Buzzer for 3 Players (4 Buttons + 3 LEDs + Buzzer)
Who buzzed first? The Arduino decides down to the millisecond! The first to buzz answers system from TV quiz shows, for 3 players and a host button. The fastest player's LED lights up bright with its own sound, and the other buttons lock. Buzzing before the host says ready is a foul. Hold the host button for 1 s and the scoreboard plays on the LEDs. Ready for real use in class or at home.

Arduino Number Guessing Game (4x4 Keypad + I2C LCD + Buzzer)
I'm thinking of a number from 1 to 100. Can you find it in 7 guesses or fewer? The Arduino picks a secret number, you type your guess on a 4x4 keypad and send it with #. The I2C LCD says HIGHER or LOWER and shows the range left and your tries, while a passive buzzer gives each hint its own sound. The fewest-tries record is kept in EEPROM. A fun first game that uses a keypad and an LCD together.

Raspberry Pi Pico Paddle Ball Game (OLED Display + 2 Potentiometers + Buzzer)
The classic paddle ball game, now on a 0.96 inch OLED for two players! Each player turns their own potentiometer to move a paddle. The ball speeds up on every hit and bounces off at an angle set by where it lands on the paddle; first to 5 points wins. A buzzer plays the wall, paddle and point sounds. Analog input, integer physics and partial screen updates in one game on the Raspberry Pi Pico.

Raspberry Pi Pico Chess Clock (2 TM1637 Displays + 2 Buttons + Buzzer)
Make your move, hit the button, and the clock switches sides! A two-player chess clock with a Raspberry Pi Pico: each player's time runs down on their own TM1637 display and the mover gets an increment. The last 10 seconds show hundredths, a flagged side blinks FLAG and the buzzer sounds an alarm. Press both buttons together to pause. The TM1637 driver lives in the code, no library needed.

ESP32 Mini Music Box (OLED Display + 3 Buttons + Buzzer)
Three buttons, a buzzer and five classic tunes: a pocket music box built with an ESP32! The 0.96 inch OLED shows a playlist, and the previous, play/pause and next buttons move between Ode to Joy, Für Elise, Jingle Bells, Happy Birthday and Twinkle Twinkle. While a tune plays, the note name appears and its key lights up on a two-octave piano keyboard, with elapsed time and a progress bar. All tunes are public domain, played on a passive buzzer.

Raspberry Pi Pico Whack-a-Mole (4 LEDs + 4 Buttons + Buzzer)
Hit it when it lights up! The arcade classic Whack-a-Mole on your desk with a Raspberry Pi Pico. Four LEDs are four holes; a lit LED is a mole popping up, so press the button on the same row before the light goes out. Every 5 hits you level up and the moles stay up for less time. You get 3 misses, and a buzzer announces every hit, miss and new record.

Raspberry Pi Pico Metronome (Potentiometer + TM1637 + Buzzer + LED)
Turn the knob and the tempo follows! We are building a 40-200 BPM metronome with a Raspberry Pi Pico. A potentiometer sets the tempo, and a TM1637 display shows the BPM plus a pendulum that swings on every beat. The buzzer plays a high click on the first beat of the bar and a lower one on the rest, while an LED flashes in time. After each change the display names the tempo: Largo, Adagio, Allegro and more.

Raspberry Pi Pico Morse Code Translator (Button + OLED Display + Buzzer)
Tap the button and the Pico decodes your Morse! We are building a Morse code translator with a Raspberry Pi Pico that works like a telegraph key. A short press is a dot, a long press a dash; the buzzer beeps along and the OLED display shows each decoded letter in large type. A second button plays your text back in Morse, so you see both directions.

Raspberry Pi Pico Tea Thermometer (DS18B20 + TM1637 + Buzzer)
Let the Pico tell you when your tea is ready to drink! We are building a thermometer with a Raspberry Pi Pico that measures the tea in your glass. A waterproof DS18B20 probe goes into the tea, and a TM1637 display shows the temperature and the time left until it is drinkable. At 65 degrees the buzzer plays a tune, and it warns you if the tea gets cold.

Raspberry Pi Pico PIR Motion Alarm (PIR Sensor + Buzzer + LED)
Walk in once and you get a warning, walk in again and the siren goes off! We are building a two-stage motion alarm with a Raspberry Pi Pico and a PIR motion sensor. It arms itself after a countdown. The first motion plays a ding-dong warning on the buzzer; a second motion within 15 seconds sounds the siren and strobes the LED. Afterwards it re-arms on its own and logs every event with a timestamp.

Arduino 16 LED Light Show (2x 74HC595 Shift Register + Buzzer)
Out of Arduino pins? Here is the fix: two chained 74HC595 shift registers drive 16 LEDs from just 4 pins. There are 6 light modes: burst, scanner, binary counter, stars, stacking bar and an equalizer that bounces to a melody. The potentiometer sets the speed, the button changes the mode and a passive buzzer gives every mode its own sound. You learn serial-to-parallel output, chaining and the latch idea through a light show.

Arduino Penalty Shootout Game (Servo Goalkeeper + TM1637 Display)
A 5-shot penalty shootout on your desk! After a 3-2-1 beep and a whistle you shoot with the left, middle or right button, and the SG90 servo keeper dives to a corner at the same moment. The keeper learns: keep shooting at the same corner and it starts diving there more often. The score is on the TM1637 display, the ball's corner on the LEDs, and the goal tune comes from a passive buzzer. Randomness, weighted odds and servo control in one game.

Arduino Automatic School Bell (DS1307 + I2C LCD + Relay)
Now the Arduino rings the school bell! A DS1307 keeps the time, and the lesson, break, lunch and home-time bells ring on their own from a schedule table. A relay drives the real bell, a buzzer plays a different tune for each bell type and an I2C LCD counts down to the next bell. It also has exam and holiday modes, a manual bell, clock setting with two buttons and the Turkish National Anthem for the Monday and Friday ceremonies.

ESP32 Rhythm Game (8x8 NeoPixel Matrix + 4 Buttons + TM1637)
Notes rain down, and if you hit them on time you're the one playing the song! Colored notes fall down 4 lanes of an 8x8 NeoPixel matrix; press the right button the moment one reaches the bottom row and the buzzer plays that note of the melody. The score is on a TM1637 display and combos multiply your points. Üsküdar'a Gider İken, Ode to Joy and Jingle Bells are built in, with an S/A/B/C grade at the end and fireworks for a new record.

Arduino Bomb Defusal Game: Cut the Right Wire (TM1637 + 4 Wires + Buzzer)
The "red or blue?" movie scene on your desk! Press START and seconds and hundredths race across the TM1637, while the passive buzzer beeps a little faster and higher each time. One of four wires defuses the bomb, one sets it off, one halves the time left and one does nothing, and the roles are shuffled every round. Randomness, non-blocking timing with millis() and an EEPROM defuse counter in one game.

Raspberry Pi Pico Cowboy Duel (2 SG90 Servos + TM1637 + Buzzer)
A two-player reflex duel: a western whistle plays, the yellow LED lights up at a random moment and the first to press wins! The Raspberry Pi Pico knocks the loser's cardboard cowboy down with an SG90 servo and makes the winner's wave; a TM1637 display shows the reaction time in milliseconds. Press before the LED and you shoot your own cowboy. First to 3 points is champion, and the fastest reaction is saved as the record.

Arduino Brick Breaker Game (OLED Display + Potentiometer + Buzzer)
The 80s arcade classic in your hands! Bounce the ball and smash 5 rows of bricks on a 0.96 inch OLED, sliding the paddle by turning a potentiometer. Five levels bring five different patterns, top row bricks take two hits and some bricks drop a box that widens your paddle. Every brick broken before the ball touches the paddle again raises the passive buzzer's note one step. If nobody plays, the game plays itself.

ESP32 Virtual Pet (OLED + 3 Buttons + Buzzer)
The pocket toy of the 90s is back on an ESP32! A pixel baby hatches from an egg on the 0.96 inch OLED; with 3 buttons you feed it, play a mini game, clean up after it and switch off the light so it can sleep. Hunger, happiness, energy and cleanliness drop over time, and the passive buzzer beeps when it needs you. It grows into a different adult depending on your care, and since its state lives in NVS, it waits for you even after you unplug it.

Raspberry Pi Pico Fridge Door Left Open Alarm (LDR + TM1637 + Buzzer)
Who left the fridge door open? The Raspberry Pi Pico sees the inner lamp through an LDR and counts on a TM1637 display how many seconds the door has been open. At 20 seconds it gives a gentle double beep, at 40 seconds an insistent siren with a red LED; the button mutes the alarm for 60 seconds. The number of openings, the total and the longest open time are saved, so a power cut does not erase them.

Arduino Light Saber (MPU-6050 + WS2812B LED Strip + Buzzer)
Press the button and the light shoots from the hilt to the tip with a "vzzz"! A 30-LED WS2812B strip is the blade, an MPU-6050 measures how fast the sword turns and when it hits something, and a passive buzzer plays the hum. Swing it and the hum rises while the blade glows brighter; hit something and it flashes white with a crackle. A long press cycles through six colours, and your pick is remembered after power-off.

ESP32 Drumming Robot (2 Servos + OLED + Buzzer)
A little robot that plays the drums on your desk! Two SG90 servo arms become drumsticks and hit a box or a cup, while a passive buzzer adds the bass hits and a click on each bar. There are 6 rhythms, including rock, disco, march, halay, çiftetelli and 9/8; a potentiometer sets the tempo from 60 to 180 BPM and tapping the TAP button in time teaches the robot your speed. A 0.96 inch OLED shows a 16-step grid with a moving cursor.
