Introduction: Simple Buzzer Music

About: electrical engineering student

A simple library to output your own songs with the Arduino through a buzzer or speaker.

A small example of the song "praeludium" by Johann Sebastian Bach is included.


- 1 x Arduino Uno / Mega / Nano

- 1 x speaker / buzzer

- 2 x jumper wires

- 1 x basic knowledge of music

Step 1: Download the Library

Download the Zip file:


Include the library as shown in the picture.

Navigate to: Downloads\

Step 2: Open the Basic Example

Go to Examples / Music / Basic

You can also try the praeludium demo "praeludium" (already converted).

Step 3: Convert Your Song

Convert your sheet into tones for the code (as shown in the picture).

If you need more information, just have a look at the praeludium demo for a better understanding.

Step 4: Wire Up the Arduino

Wire the Arduino as shown in the schematic.

Step 5: Upload Your Code

Upload your modified basic code to the Arduino.

(or the praeludium demo)

Step 6: Enjoy Your Music

Thank you for following this tutorial. It was created to improve my understanding of libraries. So feel free to look at the files: music.h, music.cpp and README.txt to get a basic understanding of the library.

If you want to create your own library, just follow this tutorial:

If you want to make the whole thing more professional I can recommend this tutorial:

I hope you learned something. Have fun with the library!