Searching \ for 'PIC-powered metronome' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/power.htm?key=power
Search entire site for: 'PIC-powered metronome'.

Truncated match.
PICList Thread
'PIC-powered metronome'
1995\12\20@045009 by Andrew Kay

flavicon
face
I've just started using PIC devices (in fact, I'm almost entirely green
at any sort of electronics).  Having done "flashing LED" and "buzzing
speaker", I'm ready to build something a little more useful, a digital
metronome.

Does anybody know how to produce a reasonably loud "click" from a
3V battery powered circuit?  I tried sending a square pulse to a
teensy weensy miniature speaker, but it's very quiet.

Programmer Software for Free
============================
I built the 16C84 in-circuit programmer
from the application note AN589 -- it worked perfectly first time. I
have built a rudimentary software user interface for the PC in Turbo C
(using Analog Design Specialists low level code).  With this I can
download .hex files from MPASM directly into the device.  The code
only overwrites locations which require changing, to reduce eeprom
cycles during development.

I'd be happy to release my source code (although it still has some
very rough edges!) if there is demand.

Cheers
Andrew Kay
Sharp Labs Europe Ltd, Oxford Science Park, Oxford UK, OX4 4GA
spam_OUTAndrew.KayTakeThisOuTspamsharp.co.uk  Tel:+44 1865 747711 FAX:+44 1865 747717

1995\12\20@045009 by Andrew Kay

flavicon
face
I've just started using PIC devices (in fact, I'm almost entirely green
at any sort of electronics).  Having done "flashing LED" and "buzzing
speaker", I'm ready to build something a little more useful, a digital
metronome.

Does anybody know how to produce a reasonably loud "click" from a
3V battery powered circuit?  I tried sending a square pulse to a
teensy weensy miniature speaker, but it's very quiet.

Programmer Software for Free
============================
I built the 16C84 in-circuit programmer
from the application note AN589 -- it worked perfectly first time. I
have built a rudimentary software user interface for the PC in Turbo C
(using Analog Design Specialists low level code).  With this I can
download .hex files from MPASM directly into the device.  The code
only overwrites locations which require changing, to reduce eeprom
cycles during development.

I'd be happy to release my source code (although it still has some
very rough edges!) if there is demand.

Cheers
Andrew Kay
Sharp Labs Europe Ltd, Oxford Science Park, Oxford UK, OX4 4GA
.....Andrew.KayKILLspamspam@spam@sharp.co.uk  Tel:+44 1865 747711 FAX:+44 1865 747717

1995\12\20@064914 by Clyde Smith-Stubbs

flavicon
face
> Does anybody know how to produce a reasonably loud "click" from a
> 3V battery powered circuit?  I tried sending a square pulse to a
> teensy weensy miniature speaker, but it's very quiet.

Use this circuit:

                          |+V
                          |
          NPN eg. BC548 | /
                        |/
                    ----|                  /|
                    |   |\|        47uF   / |
                    |   |-\      + | |    | |
                    |      +-------| |----| |  8 ohm spkr
                    |   ||/        | |    | |
From        180     |   |/-             --| |
 PIC -----/\/\/\/\--+---|               |  \|
                        |\              |
          PNP eg. BC558 | \             |
                           |            |
                           +------------
                           |
                           | -V

The emitter follower pair can drive the low-impedance speaker much
better than the PIC port pin. The decoupling capacitor makes sure the speaker
sees an AC signal. IF this is not enough noise, duplicate the emitter
follower, and connect to the other side of the speaker, then drive from
another port pin in anti-phase with the first pin. This will swing twice
the supply voltage across the speaker, peak-to-peak. That should get you about
6dB more noise. If you do that, the capacitor may not be required (but I'd
probably leave it there. Be sure to set both port pins high or low when no
noise is required, to avoid reverse polarizing the capacitor, in this case.)

Also, to maximise the noise from the speaker, try baffling it, or even clamping
it directly onto a hard surface - at some frequencies a small speaker will
radiate better from the back of the speaker than the front. Just sitting in
free air is bad. Also, the larger the speaker the better - small speakers
are inefficient.

On low voltages, the base-emitter voltage drop of the emitter follower is
significant
so you might want to use some other circuit where the load is in the collector
side, but driving the transistors is harder - you can't just connect the bases
together
as in this circuit.

I've tested the above circuit on 5V, and it makes an impressive sound from a 1"
speaker at about 1000Hz - a double-ended version on 3V should be slightly
better.

Happy metrognoming. Where do the best gnomes go to school? The London
School of Eco-gnomics!

--
Clyde Smith-Stubbs       | HI-TECH Software,       | Voice: +61 7 3300 5011
clydespamKILLspamhitech.com.au      | P.O. Box 103, Alderley, | Fax:   +61 7 3300 5246
http://www.hitech.com.au  | QLD, 4051, AUSTRALIA.   | BBS:   +61 7 3300 5235
----------------------------------------------------------------------------
FREE! Download our shareware (FREE for noncommercial use) MS-DOS C Compiler!
            Point your Web browser at http://www.hitech.com.au/

1995\12\20@064914 by Clyde Smith-Stubbs

flavicon
face
> Does anybody know how to produce a reasonably loud "click" from a
> 3V battery powered circuit?  I tried sending a square pulse to a
> teensy weensy miniature speaker, but it's very quiet.

Use this circuit:

                          |+V
                          |
          NPN eg. BC548 | /
                        |/
                    ----|                  /|
                    |   |\|        47uF   / |
                    |   |-\      + | |    | |
                    |      +-------| |----| |  8 ohm spkr
                    |   ||/        | |    | |
From        180     |   |/-             --| |
 PIC -----/\/\/\/\--+---|               |  \|
                        |\              |
          PNP eg. BC558 | \             |
                           |            |
                           +------------
                           |
                           | -V

The emitter follower pair can drive the low-impedance speaker much
better than the PIC port pin. The decoupling capacitor makes sure the speaker
sees an AC signal. IF this is not enough noise, duplicate the emitter
follower, and connect to the other side of the speaker, then drive from
another port pin in anti-phase with the first pin. This will swing twice
the supply voltage across the speaker, peak-to-peak. That should get you about
6dB more noise. If you do that, the capacitor may not be required (but I'd
probably leave it there. Be sure to set both port pins high or low when no
noise is required, to avoid reverse polarizing the capacitor, in this case.)

Also, to maximise the noise from the speaker, try baffling it, or even clamping
it directly onto a hard surface - at some frequencies a small speaker will
radiate better from the back of the speaker than the front. Just sitting in
free air is bad. Also, the larger the speaker the better - small speakers
are inefficient.

On low voltages, the base-emitter voltage drop of the emitter follower is
significant
so you might want to use some other circuit where the load is in the collector
side, but driving the transistors is harder - you can't just connect the bases
together
as in this circuit.

I've tested the above circuit on 5V, and it makes an impressive sound from a 1"
speaker at about 1000Hz - a double-ended version on 3V should be slightly
better.

Happy metrognoming. Where do the best gnomes go to school? The London
School of Eco-gnomics!

--
Clyde Smith-Stubbs       | HI-TECH Software,       | Voice: +61 7 3300 5011
.....clydeKILLspamspam.....hitech.com.au      | P.O. Box 103, Alderley, | Fax:   +61 7 3300 5246
http://www.hitech.com.au  | QLD, 4051, AUSTRALIA.   | BBS:   +61 7 3300 5235
----------------------------------------------------------------------------
FREE! Download our shareware (FREE for noncommercial use) MS-DOS C Compiler!
            Point your Web browser at http://www.hitech.com.au/

1995\12\20@202014 by Prashant Bhandary
flavicon
picon face
At 09:46 AM 20/12/95 GMT, you wrote:
>I've just started using PIC devices (in fact, I'm almost entirely green
>at any sort of electronics).  Having done "flashing LED" and "buzzing
>speaker", I'm ready to build something a little more useful, a digital
>metronome.
>
>Does anybody know how to produce a reasonably loud "click" from a
>3V battery powered circuit?  I tried sending a square pulse to a
>teensy weensy miniature speaker, but it's very quiet.
>

Instead of a click, try getting a very short beep - just a few cycles worth.
If the 3V is not enough you could use an H bridge to drive it. Two LM 386s
or something similar should do it.

Prashant
+----------------+  -------------------------------------------------
|                |    Prashant Bhandary
|   +---+        |    Spatial Information Systems Section
|   |   |        |    Roads and Traffic Authority
|   |   |        |    Rosebery NSW 2018, AUSTRALIA
|   |   |        |    Tel:  +61-2-662 5299
|   |   +----+   |    Fax:  +61-2-662 5348
|   |        |   |    Email: EraseMEprashbspam_OUTspamTakeThisOuTrta.oz.au
|   +--------+   |
| Still a newbie |    "2b|!2b" - William Shakespeare
+----------------+  -------------------------------------------------

1995\12\20@214101 by John Payson

flavicon
face
> >Does anybody know how to produce a reasonably loud "click" from a
> >3V battery powered circuit?  I tried sending a square pulse to a
> >teensy weensy miniature speaker, but it's very quiet.
> >
>
> Instead of a click, try getting a very short beep - just a few cycles worth.
> If the 3V is not enough you could use an H bridge to drive it. Two LM 386s
> or something similar should do it.

Actually, I'd suggest sending it a short burst of "random" pulses.  Metronomes
that beep with a definite pitch can be a bother musically if their output is
off-key.  If you use random pulses, the resulting sound would be white or pink
noise, and thus less likely to be bothersome.

Also, for output you could tie one leg of the speaker to a port pin, and
the other to a port pin via a cap.  If both port pins switch simultaneously
in opposite directions you could get +/- 6 volts on the speaker which should
give it a louder drive than merely using a single port pin.

1995\12\20@214722 by John Payson

flavicon
face
> Programmer Software for Free
> ============================
> I built the 16C84 in-circuit programmer
> from the application note AN589 -- it worked perfectly first time. I
> have built a rudimentary software user interface for the PC in Turbo C
> (using Analog Design Specialists low level code).  With this I can
> download .hex files from MPASM directly into the device.  The code
> only overwrites locations which require changing, to reduce eeprom
> cycles during development.
>
> I'd be happy to release my source code (although it still has some
> very rough edges!) if there is demand.

I homebrewed two PIC program softwares myself [one in TC, one in QuickBasic
when I accidentally left the TC one at home].  What do you use for printer
port pins?  I used to use 1=Strobe=D7, 2=Data0=Clock 3=Data1=/MCLR 4=+VPP
[high turns it on] but unfortunately on Toshiba laptops pin 1 is not open-
collector, and pin 14 [my second choice] is open-collector but its readback
register shows the latched value rather than its physical state.  Thus, I
strap 14 and 15, both of which go to D7 on the PIC; 14 is the output, 15 the
readback.  How do you work things?

1995\12\20@224124 by Clyde Smith-Stubbs

flavicon
face
> Also, for output you could tie one leg of the speaker to a port pin, and
> the other to a port pin via a cap.  If both port pins switch simultaneously

The trouble with this is that the output impedance of the port pins is
too high to effectively drive a low-impedance speaker. Either use an
amplifier, an emitter-follower setup like I previously described, or
a higher-impedance speaker. Telephone earpieces work quite well. They
produce a surprising amount of noise.

The random noise approach is good, but if you're outputting a click
consisting of a few cycles, then the actual pitch of the tone is
not going to make much difference, and if there is too much variance
between clicks that would not be good.


--
Clyde Smith-Stubbs       | HI-TECH Software,       | Voice: +61 7 3300 5011
clydespamspam_OUThitech.com.au      | P.O. Box 103, Alderley, | Fax:   +61 7 3300 5246
http://www.hitech.com.au  | QLD, 4051, AUSTRALIA.   | BBS:   +61 7 3300 5235
----------------------------------------------------------------------------
FREE! Download our shareware (FREE for noncommercial use) MS-DOS C Compiler!
            Point your Web browser at http://www.hitech.com.au/

1995\12\22@070349 by Siegfried Grob

flavicon
face
Hi John, Andrew and all interested people,

Andew asked:
> > >Does anybody know how to produce a reasonably loud "click" from a
> > >3V battery powered circuit?  I tried sending a square pulse to a
> > >teensy weensy miniature speaker, but it's very quiet.

Someone answered:
> > Instead of a click, try getting a very short beep - just a few cycles worth.
> > If the 3V is not enough you could use an H bridge to drive it. Two LM 386s
> > or something similar should do it.

John replied:
> Actually, I'd suggest sending it a short burst of "random" pulses.
good idea!
>
> Also, for output you could tie one leg of the speaker to a port pin, and
> the other to a port pin via a cap.  If both port pins switch simultaneously
> in opposite directions you could get +/- 6 volts on the speaker which should
> give it a louder drive than merely using a single port pin.
But why do I have to tie one leg of the speaker to a PIC pin _via a cap_?
It _is_ the advantage of a bridge speaker driver not to need any cap!

For example, have a look at the data sheet of a TDA7052 audio amplifier
(from Philips). The data sheet proudly claims that no external components
are needed (well, except for 1 resistor and 1 big cap for Vdd).
I think this IC could be used as a single-chip solution for the speaker-driver
problem, although it might not be the cheapest way.


Merry Christmas! - Frohe Weihnachten!

Siegfried

1995\12\22@105336 by John Payson

flavicon
face
> > Also, for output you could tie one leg of the speaker to a port pin, and
> > the other to a port pin via a cap.  If both port pins switch simultaneously
> > in opposite directions you could get +/- 6 volts on the speaker which should
> > give it a louder drive than merely using a single port pin.
> But why do I have to tie one leg of the speaker to a PIC pin _via a cap_?
> It _is_ the advantage of a bridge speaker driver not to need any cap!

True it's nice to avoid a cap, but you'll almost certainly need either a cap
or a resistor to limit current, and if you use a cap it will allow a higher
peak current initially, and store current fed to it during one cycle for out-
put in the next.  Thus, assuming an initial steady state with the cap's port
pin high and the other one low, we have [all voltages relative to ground]:

 PIN   CAP  CAP [SPKR] PIN
 3.0   3.0  0.0        0.0

If we switch the high/low on the port pins we then have
 0.0   0.0 -3.0        3.0
[six volts one polarity on the speaker--twice Vdd]

After a little while, the cap will equilibrate to
 0.0   0.0  3.0        3.0

which after another click becomes
 3.0   0.0  6.0        0.0
[six volts other polarity on the speaker--twice Vdd]

So the effect of the cap is to double your peak voltage, though at the
expense of horrendously distorting your frequency response (not an issue
for a metronome producing "clicks")

1995\12\22@161909 by Scott Stephens

picon face
>Does anybody know how to produce a reasonably loud "click" from a
>3V battery powered circuit?  I tried sending a square pulse to a
>teensy weensy miniature speaker, but it's very quiet.
>

Try using a piezo speaker, and hitting it with a train of pulses, say 10
milli-seconds of a 4 KHz (250 uS period) square wave. If its too short to
sound like a tone, it will sound like a click. Drive the speaker with two
port lines (complemented, 180 phase) with an appropriate inductor in
parallel with the piezo, around 100mH, to get a louder signal, or use an
audio step-up transformer. Common piezo's are around .001uF.

>Programmer Software for Free
>============================
...
>I'd be happy to release my source code (although it still has some
>very rough edges!) if there is demand.

I'd like to see it. Thanks.

More... (looser matching)
- Last day of these posts
- In 1995 , 1996 only
- Today
- New search...