Aleksandra x Sunna Music Instrument

Aleksandra x Sunna Music Instrument

The process of building our music instrument was long and based on trial-and-error. Because the only requirement is to use at least one servo and the tone program, the possibilities for the project are endless. 

Our first idea was to combine three components – a servo that would act as a beat, a photosensor connected to a speaker to add an EDM-like sound and, finally, a speaker that would play our programmed melody in a loop. The idea was to build a simple DJ kit, where the user could set a beat with the servo (something would be attached to the servo so that its rotation would create a constant beat), and “remix” the melody by manipulating the values the photosensor sends to the speaker (by moving their hand closer or further away from the sensor). However, we quickly ran into a problem – we couldn’t figure out how to combine the three parts of the code into a single code, where multiple actions could take place at once. With this setup we needed the computer to process three different inputs, and also give out three different outputs (both, the servo giving the beat and the speaker giving the melody were controlled by a button). So, while we were able to build this instrument with three different codes, we could not put the three pieces of code into one so that they all work a the same time. We also soon realized that the sound produced by the speaker hooked to the photosensor did not give a pleasant sound, thus we moved onto another variation of our project. 

Even though we liked the idea of building a DJ set, we had to realize our limitations and simplify our project. Therefore, we decided to keep the two essential things that were the basis of the project – the speaker playing our programmed tone, and the servo. The main goal with picking the melody, to then program, was to choose a melody known by everyone in our class. That’s how we decided to pick the Happy Birthday and the We Wish You A Merry Christmas tunes. Again, we went through a long process for finding an achievable, yet meaningful function for the servo. That’s how we came to our project idea.

There are two buttons – each responsible for its own speaker, each playing a different tune. Then, there are two buttons connected to the servo. There are two yellow and two blue buttons. When you press both yellow buttons at the same time, the melody starts playing and the servo is programmed to keep the rhythm for the melody for the exact amount of time the melody is playing. When you press both blue buttons, the other melody starts playing, with the other rhythm programmed for the servo. Each song is played once, when its respective button is pressed. The idea for the servo is to keep the rhythm and show the duration of the song. By its position you can also tell how much of the tune is still left to listen to. We added the buttons to the circuit so as to avoid the user getting annoyed by the constant repetition of the two melodies. The only downside to our project is that we couldn’t achieve one button to turn on both the servo and the speaker, however we found an aesthetic solution for that – everything is placed on the same breadbord by using the big breadbord, which has two non-connected parts, so as to allow two independent circuits.

Here’s a a video of our project.

Here’s a photo of our project:

This is the code for the two tunes:


This is the code for the servo:


One thought on “Aleksandra x Sunna Music Instrument

Leave a Reply

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