Maker.io main logo

DIY Simple Arduino Metronome

2023-11-10 | By Mirko Pavleski

License: General Public License Music / Sound Boards Arduino

A metronome is a device used in music to help musicians keep a consistent tempo or beat while playing or practicing. It produces a regular, steady sound, typically in the form of clicks or beats per minute (BPM), to aid musicians in maintaining the desired rhythm.

ijho

Metronomes come in various forms, including mechanical metronomes, electronic metronomes, and digital metronome apps. The device presented in this video is actually a digital metronome that contains an array of LEDs that simulate the movement of a weighted pendulum.

 

The movement of the weight on the vertical rod has been replaced by a slide potentiometer, and the current beats per minute is displayed on a small OLED screen. The LEDs and the potentiometer are placed in such a way that the device looks very much like an original mechanical metronome.

jioi

The device is very simple to make, and consists of several components - Arduino Nano Microcontroller - 8 LEDs - Slide potentiometer with a value of 10 to 100 kilohms - two active buzzers - SSD1306 OLED display - and a 470 Ohm resistor.

vghgv

Considering that only one diode is always active at a time, instead of 8 resistors on each anode, I put only one resistor on the common cathodes to ground. In that way, the circuit is significantly simplified. Also, for sound indicators, instead of one, I use two active buzzers, which have a negligible cost. On the other hand, we got a sharp clear sound, which is a basic requirement for this device, and there is also no need to complicate the code. I connect the buzzers directly to the D2 and D9 outputs. Also, the code is very simple and can easily be modified for a different number of LEDs. Of course, the part with my logo and device name in the void setup section can be removed. Even for simplicity, the OLED display can be omitted, and then draw a BPM scale near the slide potentiometer.

ftyuyut

Now let's see how the device works in reality. After switching on, in the first few seconds the previously defined logo appears as well as information about the device type. Then, conditionally speaking, the Pendulum starts moving at a speed that depends on the position of the potentiometer. When the potentiometer is higher, the oscillations slow down, and vice versa. The current BPM is displayed on the OLED display. The first and the last led are of different colors and indicate the moment of activation of the Buzzer. The movement of the diodes is actually a Knight Rider led effect, the speed of which is controlled by a potentiometer. And finally, this is a simple beginner Arduino project with a great visual effect, but also a very useful tool when learning to play a musical instrument.

hj

 Arduino Nano Microcontroller - 8 LEDs - Slide potentiometer with a value of 10 to 100 kilohms - two active buzzers - SSD1306 OLED display - and a 470 Ohm resistor

制造商零件编号 A000005
ARDUINO NANO ATMEGA328 EVAL BRD
Arduino
¥172.33
Details
制造商零件编号 PTA4553-2015CPB103
SLIDE POT 10K OHM 0.25W TOP 45MM
Bourns Inc.
¥17.91
Details
制造商零件编号 4440
I2C OLED DISPLAY STEMMA QWIIC
Adafruit Industries LLC
¥101.75
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum