Accented metronome ...again

Jeremy Leach

Senior Member
A while back I was wondering about this. Just to say I've experimented now and it couldn't be easier...

<code><pre><font size=2 face='Courier'>

Picaxe 08M
| |
+5V -| |- 0V
| |
-| |-
| |
.---------|Out4 |-
| | |
| -| Out2|-------.
| | | |
| '-----------' |
| |
| |
| -----------
| Piezo
| -----------
| |
| |
| |4.7K

Example code:
<code><pre><font size=2 face='Courier'>
#picaxe 08m

Symbol SoundPin = 2
Symbol VolPin = 4
Symbol BeatInterval = 500 'ms

Output SoundPin

Goto Threefour

Gosub AccentedTick
Gosub NormalTick
Gosub NormalTick
Goto ThreeFour

Low VolPin
sound SoundPin, (255,2)

pause BeatInterval

Input VolPin
sound SoundPin, (230,2)

Pause BeatInterval

The 'Volume' pin, pin4 is set as an input to apply the resistor in series with the Piezo (lowered volume), and is set low to short the resistor (max volume).

The sound command is using the 'white noise' values to get a 'tick' sound. I expect the actual sound will vary depending on the specific piezo etc, but it sounds good to me !

Edited by - jeremy leach on 15/04/2007 10:06:27


Good solution. I fought with the same issue and came across a similar solution thanks to some old posts here on the forum. I tried several methods for creating the accentuated beat. Using 2 piezo's works ok, especially if they have different mechanical mountings. After much experimentation, however, including with 2 piezos, white noise sounds, single cycle &quot;ticks&quot;, the voltage dropping resistor solution you posted, etc., I ended up just using high and low tones. The issue for me was that the sound just wasn't loud enough. Even sending a tone, my device would benefit from an amplifier stage. My problem with the Piezo and voltage dropping resistor is that the sound becomes *quieter* with this arrangement.

I didn't try using a single transistor amplifier stage, but that would probably make the device work more acceptably.

Jeremy Leach

Senior Member
Hi ... I'm concerned with the volume too. Not got that far yet though. I don't really want to add an amplifier stage as I'm wanting to reduce current as much as possible.