top of page

A Musical Arduino Project

  • Writer: Harry
    Harry
  • 3 days ago
  • 3 min read

In this project you will use an Arduino to create a little musical instrument that can play 3 notes with the ability to move up or down an octave. The project is simple and easy to follow, you don’t need to know how to code or how to do electronics, I have taken care of all that for you. Simply follow the steps and enjoy your own creation.


What You Need


First of all, let’s make sure you have the right kit, for this project you need:


  • 1x Ardunio Uno R3 (or any Ardunio with a PWM pin)

  • 1x Breadboard

  • 1x Piezo electric buzzer

  • 5x Push buttons

  • 5x 10K Ohm resistors

  • 1x 220 Ohm resistor (optional)

  • Some jumper wires

  • A USB cable for your Arduino

  • A laptop/PC


These components are fairly basic and will likely come with any starter kit you get with a dev board.


In terms of software, you will need to download the Arduino IDE if you have not already, it can be downloaded here if you do not have it.


Building the Electronics


Let us begin with the hardware, you can arrange your buttons and buzzer however you want but make sure your resistors and jumper wires are the same as in this diagram otherwise it will not work properly.


This is how you need to arrange your components:


ree

This might look complicated, but I will break it down for you. Also, all the buttons are the same so once you have done one you know how to do them all.


Power and Ground


First place a jumper cable from the 3.3v and GND pin to the ground and power rails on your breadboard like this.


ree

Buttons


Next place a button, jumper wire, and a 10k Ohm resistor like this.


ree

Then repeat that arrangement again to make a set of 3 buttons and a set of 2, make sure to separate them enough so you have room to press one at a time with your finger.


ree

Buzzer


Now place your buzzer and the 220 Ohm resistor connected to ground.


ree

The 220 Ohm resistor is optional. I use one to lower the volume of the buzzer, you might want it to be louder or quieter so just use a smaller or larger resistor to adjust the volume. Or, if you are feeling jazzy you can use a variable resistor to control the volume dynamically.


Jumper Wires


Finally add the jumper wires. This step is important so make sure each wire goes to the correct pin. The buttons should be wired up so that each button goes into pin 2, 3, 5, 6, and 7 from left to right.


ree

The buzzer wire should run from its positive terminal to pin 9.


ree

You should have a breadboard full of buttons and a buzzer that looks like this.


ree

All that is left is to program the Arduino and you will have your own music player!


Programming the Arduino


If you do not have the Arduino IDE installed, you should do it now using the link at the top of this page.



Open the IDE to a new sketch and delete all the code that appears by default, then copy and paste the code from the above text document into the blank sketch.


Connect your Arduino to your laptop or PC and press the upload button in the IDE.


If you did everything correctly, you should be able to play music using the 3 buttons on the right of your breadboard! You can move up an octave by pressing and holding the right button of the 2 on the left or down an octave with the button furthest to the left.


If you want to change which 3 musical notes can be played simply change the notes in this part of the code.


ree

Enjoy your Creation


Congratulations! You have made a musical instrument using an Arduino. Time to see what music can you play.

Comments


A black and orange logo that says Mari Onyx, the name of the website’s company

Contact Email:

harry@marionyx.co.uk

Contact Number:

+44 (0)7503 190502

  • LinkedIn

MariOnyx may collect personal data such as your name and email address but will not do so automatically, only when submitting forms on this website. We collect your name and email only so we can contact you if you reach out to us. MariOnyx may also collect details necessary to collect payment for services offered on our website, such details include your debit/credit card details, phone number, and address. This information is for billing purposes only and collected in accordance with Wix Payments Terms of Service. We will not share your data with any other person or organisation without your permission. MariOnyx will store your data in accordance with UK GDPR law. MariOnyx will delete any or all of your stored personal data upon request.

 

 

© 2025 MariOnyx, all rights reserved. 

 

bottom of page