Simple Arduino Sound Board

by Aleksandar Tsvetkov in Circuits > Arduino

12028 Views, 18 Favorites, 0 Comments

Simple Arduino Sound Board

IMG_20171020_222403.jpg

In this experiment you will understand how a passive buzzer works and how you can create a simple Arduino sound board. Using some buttons and choosing a corresponding tone, you can create a melody! The parts that I've used are from Kuman's Arduino UNO starter kit

Parts Needed

IMG_20171020_221153.jpg

You will need:

  • an Arduino board
  • a breadboard
  • an USB Cable
  • 10 x Jumper wires
  • 3 x Buttons (number of caps and buttons is optional)
  • 3 x 10k ohm resistors

Allchips is an electronics components online service platform, you can buy all the components from them.

Connecting the Buttons

IMG_20171020_221504.jpg
IMG_20171020_221925.jpg

Firstly, lets start with the buttons. For each button, choose one of it's sides. You will see 2 pins. The one on the left (you can swap them as well) connects to ground of the Arduino (through the breadboard) with a 10k resistor. Connect the same row to digital pin 2, 3 or 4 of the Arduino (can be configured in the code). The pin on the right side of each button connects to 5V. You can use the above picture for reference. Do these steps for all of your buttons.

Connecting the Buzzer

IMG_20171020_224055.jpg

So, on the top of the buzzer you can see a + symbol. It indicates the positive side of it. You need to connect the opposite end to ground and this one to digital pin 8 of the Arduino (can be changed later)

Uploading and Modifying the Code

Screenshot (18).png

You can find the code of the project here. It's completely up to you on what you can modify - from the pin numbers to adding more buttons, but more importantly - you can change each individual tone. Here is a little explanation:

tone(buzzPin, 1000, 300); // Here is the Arduino tone function

buzzPin is the positive pin of the buzzer

1000 is the tone itself, in Hz (it can be anywhere from 31 all the way to 65535)

300 is the duration in ms (optional)

Video

Simple Arduino Sound Board

Here is a video of the project in action, creating a random melody.