top of page

Arduino Sound Project

This week, I spent a whole day to redo all the lab we have done before. I followed the steps on the syllabus. There are two labs I could not make it, one is to press the bottom to make one light turn on, and one light turns off. The other one is to adjust the frequency of the tone. I may try to do the lab again to see it will work.

At first, I did a simple connection of the speaker, it made a sound. Second, I add a potentiometer to make the volume become measurable. Then I pop up an idea that what if the speaker just like the light bulb, I wrote some simple coding on, only tone and delay time. It came up with different hertz of tone, it sounds like a melody.  I played with different numbers and it made different. But a new problem came up if I want to play a melody, how can I set the exact number for each key? 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I did a lot of research and finally found a reference coding on the Arduino website. I made some changes and it played the short melody I want. And I put a potentiometer on, it can adjust the volume.

 

[refrence: https://www.arduino.cc/en/Tutorial/toneMelody]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

For further steps, I am wondering how to let the speaker play the bass. The chart on the reference only shows keys from middle C to high C. What if I need the speaker to play the key higher or lower than that? And I am going to make a simple piano after I figure out the press button problem. 

00:00 / 00:23
00:00 / 00:14
bottom of page