# Arduino Metronome (with ISR)

3,853

6

Published

## Introduction: Arduino Metronome (with ISR)

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
• 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);

Visit my site for more!

http://estro.co

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

lorenzodaidoneautomation@gmail.com

Here the code:

## Recommendations

• ### Arduino Class

70,833 Enrolled