Sunday, 26 October 2008

Piezo Buzzer, finding the right tune

Piezo buzzer:

I am using a piezo buzzer to play a melody as soon as something gets to a certain distance to the pumpkin i.e. the ping sensor hidden inside the pumpkin.

According to the Oxford Dictionary, piezoelectronic substances have the ability of converting mechanical substances (such as sound waves) into electrical signals, and vice versa.

Piezo buzzers use an oscillating voltage that alternately "squeezes and releases" the component. That is the process that produces the sound. You can get piezo buzzers with or without a case. The ones without a case are usually not as loud, but may be better usable as sensors.

Melody:

It turns out to be quite difficult finding a melody by looking on the Internet. Most notes you can find on the internet are not for free. In the end, the only way I find something is by looking for pictures.


The first notes of "Oh! Mactavish is dead" shall be my Halloween notes. 
To play a certain note, the piezo buzzer needs to receive information about the specific frequency.

On the Arduino Homepage:

Frequencies and their appropriate note can be looked up at this page.

Though I am not quite good at notes, I believe to be able to interpret the notes of"Oh! Mactavish is dead!" to:

c (4186), b (3951), a (3520), f (2793), f (2793), a (3520), f (2793), a (3520), c (4186), e (2637), e (2637)

No comments: