loading

I play flute and I love Arduino so...why not to make a metronome with Arduino?

In this project I add a button to start and stop beats and to menage it I used interrupt technique.

Material required:

  • Arduino UNO
  • 10 kΩ linear pot
  • buzzer button
  • 1 kΩ resistor
  • breadboard
  • some jumpers

Step 1: A Bit of Mathematics

Now, a bit of mathematics: Here the relation between bpm and bps:

bps = bpm / 60

Time between two pulses:

T = 1 / pbs
in milliseconds:
T = 1000 / pbs

So, pulse duration + silence duration = T
A good ratio between pulse duration and T is 1:10.
In conclusion:

Delay time of "bip" [ms] = 6000 / bpm
Delay time of silence [ms] = 54000 / bpm

Step 2: Tone() and NoTone() Functions

To play sound with Arduino, use the following function:


tone(buzzer_pin, frequency);

To stop play sound:


noTone(buzzer_pin);

Step 3: Upload Code

Visit my site for more!

http://automtechnology.wordpress.com

If you have any questions write me an e-mail to:

lorenzodaidoneautomation@gmail.com

Here the code:

About This Instructable

1,883views

5favorites

License:

Bio: Hello! I'm Lorenzo Daidone, a student of the IIS Italo Calvino in Genoa, Italy. I love Arduino, Raspberry and all around the DIY electronics.
More by Lorenzo Daidone:L29x H bridge Arduino Library Arduino Metronome (with ISR) Fishino WiFi module firmware update 
Add instructable to: