the 2. 2 µF capacitor and the piezo
element. If you use a piezo element
without an internal driver (as
specified in the book), you will get a
click for each beat. I prefer a tone
which requires one with the internal
You may want to increase the
value of R2 somewhat to make the
on time longer. With the 1K resistor
of the original schematic, I had a
pulse width (output low) of about
850 µs. A 10K resistor yields a pulse
width of about 15 ms and doesn’t
change the frequency much while
enabling the tone to be heard.
I added R4 just to ensure at
least some resistance when the pot
resistance is zero. I added C3
because without it, the piezo
element (Digi-Key #668-1458-ND)
emitted noise. Using a 2. 2 µF capacitor for C1 gave
me a better range for the metronome than the 1 µF
specified in the book.
With the circuit as shown, the frequency ranged
from about 0.5 Hz to 30 Hz. You may want to
experiment with the values of C1, R1, R2, and R4 to
give you a good tempo range and tone. Using the
formula for the frequency of a 555 astable, the
following values will give a beats per minute range of
8 to 120: R1=1M, R2=10K, R4=50K, and C1= 10 µF.
Using Mode 4 or 5 of the PIC 555 replacement
will give you the same results as using a 555.
However, during the Christmas holidays this past
year, I found out that one of my grandsons started
playing the trumpet. This sounded like a good
excuse to develop an electronic metronome using
the PIC 555 replacement.
Mode 6 has been added with the following
modifications to the “standard” I/O of the PIC 555
• Pin 5 controls the beats per measure.
• Pin 6 controls the tempo or beats per minute.
• Pin 7 changes to an output after getting the range,
to drive a downbeat LED.
The normal tone frequency of the beats is 400 Hz,
while the downbeat frequency is 800 Hz; refer to
Schematic 2 for my implementation.
One LED is driven by the same signal as the speaker,
while another is driven by the downbeat signal. Using the
switch, you can enable or disable the LEDs. You can
increase the value of R13 and R14 if you use high
brightness LEDs. This will reduce the current drain and will
be important if you run from batteries.
The beats per measure is determined by R7 and a
look-up table. The basic value is obtained in the same way
that the Mode and Range are determined — using the
three most significant bits of the A/D reading. The
software allows eight discrete values: 0– 7. However, that
value is then used as an index into a table to get the
actual beats per measure. There are currently seven values
implemented: 0, 2, 3, 4, 6, 8, and 12. The value of 0 is
used to indicate no downbeat. The eighth value is also 12
so as not to leave it blank.
Picture 1 shows the output with four beats per
measure. The bursts are about 100 ms. The bottom trace
is the downbeat LED signal which surrounds the
downbeat tone. You can see that the tempo is quite high
since the period of the tones is 250 ms — equivalent to 4
Hz — so the tempo would be 240 beats per minute. I did
this purposely to make getting the ‘scope picture easier.
With the resistors shown, the tempo range is about 25
February 2018 37
SCHEMATIC 2. PIC 555 metronome.
PICTURE 1. PIC 555 metronome waveforms.