Buzzer and Tone; How do we make music?

Brainstorming:

When we first began this project, Adham and I were a bit stuck for multiple reasons:

  1. we couldn’t think of an instrument to make or how to use a real one. Like if we used a real guitar, how do we pluck the strings with only 2 servos? Should we plug in 4 servos? 6 or more?
  2. how do we use a buzzer and a servo in unison???
  3. and lastly, I would say the biggest problem we had was we both know absolutely nothing  about music.

From there, we spotted an empty water jug and decided to work with it as a drum.  We figured we could incorporate the buzzer later.

Building/Coding

The building process was not difficult, as we just glued a wooden rod onto a servo, and filled an empty water jug about halfway.

From there, we connected the servo to our Arduino, but we ran into some issues because we thought we were going to use 2 servos. We ended up not using 2 servos but only 1, and our setup for the mechanism includes two Arduinos that are wired up together.

Splitting up the work load was a bit easier, as on one computer we had the code for the buzzer, and on another we had the program for our water jug drum.

From there, we just picked a song and programmed the bass of it into the buzzer, while our water jug would be the drum.

We couldn’t find the notes in an easy-to-read format for someone who cannot read music, and so programming the song into the buzzer took a bit of work, as we only vaguely knew what note was playing. (For example, a C note may have been playing, but we didn’t know if that was a C5, C4, or C3 etc.) So in order to code it, we mostly did it by ear.

Here is the coding for the music:

And here is the coding for the servo/stick:

 

And so our drum song became complete!

Give it a listen, do you recognize the song?

Leave a Reply

Your email address will not be published. Required fields are marked *