Multifunctional Metronome
by Martin Clausen (mc AT rotgradpsi DOT de)
- inspired by Wolfgang (Deutsch) who was also consultant for music related issues
- sponsored by Christine (SSM2211 found in her old alcatel mobile phone)
- made for Corinna
This is a electronic digital metronome, frequency meter and reference signal generator made with an AT89C2051. In contrast to many other designs it runs from only 3 volts at a very low current to ensure a long battery lifetime.
Table of contents:
- features three modes:
- metronome: 40 to 208 beats per minute
- frequency meter: 0 to 999Hz, 1Hz resolution
- reference signal generator: 430 to 450 Hz, 1 Hz resolution, frequency derivation below 0,08%
- runs from 3 volts only
- low power consumption:
| mode | power consumption (at 3V) | battery lifetime (for 750mAh batteries)
|
|---|
| metronome | 1,8 mW | 1250 hours
|
| frequency meter | 3,9 mW | 570 hours
|
| reference signal generator | 236 mW | 3 hours
|
- low part count
- freeware for non commercial use
Depending on the switch pressed at power up, the device can enter different operation modes.
Metronome
This mode is entered if no switch is pressed during power up. Via the two switches the frequency can be decreased or increased. The frequency is displayed in beats per minute.
Frequency Meter
This mode is entered if the switch at P3.3 is pressed during power up. Via the other switch the user can enter the metronome mode. The frequency is displayed in Hertz. The input from the microphone is filtered by a bandpass with a center frequency of about 440 Hz. However, instruments with an intense overtone spectrum like a violin can not be tuned with this method.
Reference Frequency Generator
This mode is entered if the switch at P3.2 is pressed during power up. Via the two switches the frequency can be decreased or increased. The frequency is displayed in Hertz.
Metronome
T0 is set to mode 2. The reload value is chosen to give a 4KHz clock at 12MHz crystal frequency. The interrupts IE0 and IE1 are enabled as level triggered.
In the main loop the MCU is placed at most time in idle mode. Each overflow of T0 waks the MCU up. In case a software counter, which is clocked by the 4KHz from the overflow of T0, reaches zero, the amp is switched on for 150µs to produce a click.
If a switch is pressed, it will cause an interrupt. The new reload values for the software counter are fetched from a table and the display is updated as well.
Frequency Meter
First of all the microphone preamp is powered on. Then timer 0 is set to mode 1 as a counter and timer 1 is set to operate as a 2^13 timer. the interrupt for T1 is enabled.
Timer 1 is cascaded with a software counter to give a clock of 1Hz. During most of the time the MCU is placed in idle mode. After each second of counting the timer driven by the preamp is stopped, read and its value displayed.
Reference Frequency Generator
Since the frequency is relatively high and has to be produced with a good accuracy, the timing is done with two delay loop. The values for both loops are read from a table. The values for the display are calculated and displays with the same program part as for the frequency meter.
- Semiconductors:
- 1 AT89C2051; see also programming tips
- 1 PCF8577
- 1 SSM2211
- 2 BC548B
- 1 BAT42
Capacitors:
- 1 33pF cer
- 1 680pF cer
- 2 3,3nF cer
- 2 68nF cer
- 4 100nF cer
- 1 1µF
- 1 22µF
Resistors:
- 1 4,7k
- 2 5,6k
- 1 10k
- 1 22k
- 4 100k
- 1 1M
Mechanic:
- 1 case
- 1 pbc
- 1 some thin wire
- 3 socket 40 pin
- 1 socket 20 pin
- 1 switch
- 2 battery, 1,5V, alkaline
- 1 12MHz crystal
- 1 capacitor microphone
- 1 speaker, 8 Ohm
- 1 LCD, 3 1/2 digits
- 2 switches
The part description in schematics is read as follows:
part type + value in exponential form + package description + subpart number in package
for example: C1040805,1 means Capacitor, 100nF, package SMD 0805, first subpart in package
Disclaimer: No warranty at all!
Copyright by Martin Clausen, Germany.
Contact the author: mc AT rotgradpsi DOT de
Impressum