Searching \ for 'Siren sound' 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/io/audio.htm?key=sound
Search entire site for: 'Siren sound'.

Truncated match.
PICList Thread
'Siren sound'
1996\10\09@112603 by Gregg Kricorissian

flavicon
face
Howdy,

What I need must be such a common thing, that I thought I'd ask the PIC
list's assembled wisdom before I set out to possibly re-invent the wheel.

I'm using a 16C84 for an alarm controller, and I'd like to use the PIC to
also generate a "siren" waveform (to be externally amplifed), rather than
build that function in separate hardware.

The other approach to keep cost low would be to use a dedicated "siren
sound" IC, but I haven't found a commercial one yet.  I do know that they
exist as tiny COB (chip on board) modules in cheapo personal alarms, but
does anyone know of any sources for them... Digikey lists some COB modules
that generate melodies such as "happy birthday" etc, but can't supply one
for a siren sound.

Basically, what the siren waveform needs to be is as follows:

1. a frequency modulated square wave output, (ie: *not* being amplitude
modulated, should make it easier to do)

2. output waveform is centered on 3 kHz.

3. waveform should sweep back and forth between say 2500 and 3500 Hz, at a
rate of 15 Hz or so.


A routine with settable parameters for the frequency deviation (sweep) and
sweep rate would be ideal, to optmize the "effectiveness" of the sound
produced ... the trick is to resonate with the output transducer.  Of
course, armed with the basic routine, I could (and would) add the settable
parameters.

Many thanks in advance for any help that may come forth.
....Gregg

1996\10\09@145327 by Rick Miller

flavicon
face
On Wed, 9 Oct 1996, Gregg Kricorissian wrote:
[...]
> Basically, what the siren waveform needs to be is as follows:
>
> 1. a frequency modulated square wave output, (ie: *not* being amplitude
> modulated, should make it easier to do)
>
> 2. output waveform is centered on 3 kHz.
>
> 3. waveform should sweep back and forth between say 2500 and 3500 Hz, at a
> rate of 15 Hz or so.
>
> A routine with settable parameters for the frequency deviation (sweep) and
> sweep rate would be ideal, to optmize the "effectiveness" of the sound
> produced ... the trick is to resonate with the output transducer.  Of
> course, armed with the basic routine, I could (and would) add the settable
> parameters.

I should think (since it sounds like you're using a piezo transducer)
that the more 'European' alarm (Hi-Lo frequency switching rather than
sweeping) would be better...  That way you can target two "sweet spots"
in the audio band where the transducer will give you the best output.

Coding it is even *easier*, since it's just two toggle-loops nested
in an overall hi-lo switching loop...

 for (cycles = 0; cycles < totalCycles; cycles++)
 {
   for (delay = 0; delay < highFreqHalfWave; delay++)
   {
     toggleAudioOutputLevel();
   }
   for (delay = 0; delay < lowFreqHalfWave; delay++)
   {
     toggleAudioOutputLevel();
   }
 }

(Compile it yourself.  ;-)

Something important to remember though is that you don't want to
leave a DC bias sitting on the piezo!  Either drive it through
a capacitive coupling or make sure you set both sides to the same
potential before going on to do other things.

Rick Miller

1996\10\09@182137 by myke predko

flavicon
face
Gregg,

My "Frosty the Snowman" code will do exactly what you want (although I don't
know if it will get the frequency range that you want) with regards to
changing the output frequency.

Look for "TUNEMKR.ZIP" on the Microchip BBS.

Myke
{Quote hidden}

Do you ever feel like an XT Clone caught in the Pentium Pro Zone?

1996\10\09@182152 by fastfwd

face
flavicon
face
Gregg Kricorissian <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> I'm using a 16C84 for an alarm controller, and I'd like to use the
> PIC to also generate a "siren" waveform (to be externally amplifed),
> rather than build that function in separate hardware.
>
> Basically, what the siren waveform needs to be is as follows:
>
> 1. a frequency modulated square wave output, (ie: *not* being
> amplitude modulated, should make it easier to do)
>
> 2. output waveform is centered on 3 kHz.
>
> 3. waveform should sweep back and forth between say 2500 and 3500
> Hz, at a rate of 15 Hz or so.
>
> A routine with settable parameters for the frequency deviation
> (sweep) and sweep rate would be ideal, to optmize the
> "effectiveness" of the sound produced ... the trick is to resonate
> with the output transducer.  Of course, armed with the basic
> routine, I could (and would) add the settable parameters.

Gregg:

Try something like this... I'm making it up as I go along, so of
course it hasn't been tested or even assembled, but it should work
fine:

   FREQ    EQU     [any register]
   TIMER   EQU     [another register]
   TIMER2  EQU     [another register]

   MASK    EQU     00000001B       ;all zeroes, with a "1" in the
                                   ;position corresponding to the
                                   ;port pin you're using (this
                                   ;example is for PORTB<0>).

   LENGTH  EQU     [some number]   ;this value controls the sweep
                                   ;rate... You'll have to choose a
                                   ;value.

   STARTF  EQU     64              ;starting "frequency" (actually,
                                   ;it's a wavelength, in units of
                                   ;approximately 6 microseconds).

   ENDF    EQU     45              ;ending "frequency".

   BEGIN:

       MOVLW   STARTF
       MOVWF   FREQ

   DOAFREQ:

       MOVLW   LENGTH
       MOVWF   TIMER

   EDGE:

       MOVLW   MASK
       XORWF   PORTB

       MOVF    FREQ,W
       MOVWF   TIMER2

   DELAY:

       DECFSZ  TIMER2
       GOTO    DELAY

       DECFSZ  TIMER
       GOTO    EDGE

       DECF    FREQ
       MOVLW   ENDF
       XORWF   FREQ,W
       SKPZ
       GOTO    DOFREQ

       GOTO    BEGIN

Note that this routine doesn't sweep "back and forth"; it only
sweeps up from 2500Hz to 3500Hz.  If you NEED a back-and-forth
sweep, you can replace the "DECF FREQ" with a "MOVF DIRECTION,W /
ADDWF FREQ" combination and toggle DIRECTION between 01 and FF just
before the "GOTO BEGIN".  I wouldn't bother... I think you'll find
that it sounds fine as-is.

As written, of course, the above program will generate the siren
tone forever; you'll probably want to wrap another loop around it to
limit the siren time.

Finaly, you may care that the sweep isn't linear, since each
frequency between STARTF and ENDF is generated for a constant number
of PERIODS, rather than a constant TIME.  Again, I don't think
this'll be a problem... If it is, you can compensate by adding a
FREQ-dependent number to TIMER between "DOFREQ:" and "EDGE:".

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com                 ===
=== Fast Forward Engineering - Vista, California          ===
===                                                       ===
=== Custodian of the PICLIST Fund -- For more info, see:  ===
=== http://www.geocities.com/SiliconValley/2499/fund.html ===

1996\10\10@093547 by Kevin Krauel
flavicon
face
Rick Miller <rickspamKILLspamDIGALOGSYS.COM> wrote ...

>[ ... ]
>
>Something important to remember though is that you don't want to
>leave a DC bias sitting on the piezo!

Why?  Do you think a constant DC bias will damage a piezo?

       -Kevin.

1996\10\10@100328 by Rick Miller

flavicon
face
On Thu, 10 Oct 1996, Kevin Krauel wrote:

> Rick Miller <.....rickKILLspamspam.....DIGALOGSYS.COM> wrote ...
>
> >[ ... ]
> >
> >Something important to remember though is that you don't want to
> >leave a DC bias sitting on the piezo!
>
> Why?  Do you think a constant DC bias will damage a piezo?

Yes.

Rick Miller, Design Engineer, Digalog Systems, Inc.

1996\10\10@112635 by Shawn Ellis

flavicon
face
>What I need must be such a common thing, that I thought I'd ask the PIC
>list's assembled wisdom before I set out to possibly re-invent the wheel.
>
Some say there's nothing wrong with that as long as you "learn" something.

1996\10\11@011320 by Eric Strauts

flavicon
face
>> >Something important to remember though is that you don't want to
>> >leave a DC bias sitting on the piezo!
>>
>> Why?  Do you think a constant DC bias will damage a piezo?

>Yes.

>Rick Miller, Design Engineer, Digalog Systems, Inc.

I have designed many circuits using piezos that generate
ultrasound in the MHz range. They frequently have several hundred
volts of DC applied by the driving circuitry with no ill effect.

Piezos are made from the same kind of stuff ceramic capacitors are.
In fact some ceramic caps actually can be used as beepers. Ceramic
caps are unpolarized and so will respond equally to both positive and
negative voltages resulting in a frequency doubling effect.

Piezos are made by polarizing a crystal with a high voltage. The
crystal retains the electric field internally and then is able to
respond linearly to externally applied voltage by changing its dimensions.

The only damage you can do is to apply a voltage greater than the
original polarizing voltage (about 1000 volts for ultrasound crystals)
which can depolarize the crystal making it non-linear. Its analogous
to demagnatizing a permanent magnet with too strong an external
field.

Perhaps beeper piezos are polarized at voltages lower than 1000 but the
important thing is that the peak applied voltage (either AC or
DC) should not exceed the polarization value. Constant DC below this
level is harmless.

Eric

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
| Eric Strauts                          |
| TEEM Electronics                      |
| Park Ridge, IL 60068                  |
| Email: EraseMEestrautsspam_OUTspamTakeThisOuTix.netcom.com         |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

1996\10\12@024921 by engmessi

flavicon
face
>
>Piezos are made from the same kind of stuff ceramic capacitors are.
>In fact some ceramic caps actually can be used as beepers.

Sounds interesting. You mean in a useful manner ? What types ?



Pedro Drummond
Engenharia Mestra
Sao Paulo - Brasil

1996\10\14@121026 by Eric Strauts

flavicon
face
On Sat, 12 Oct 1996 03:43 Pedro Drummond wrote:

>>
>>Piezos are made from the same kind of stuff ceramic capacitors are.
>>In fact some ceramic caps actually can be used as beepers.

>Sounds interesting. You mean in a useful manner ? What types ?

I have actually heard sounds coming from ceramic capacitors in a
power supply circuit. A quick test using some parts in my junk box
attached to a signal generator revealed no obvious beeper candidates.

Barium Titanate also known as X7R is used in both piezoelectric
devices and capacitors. Any sound you hear would probably be from the
radial resonant mode where the crystal vibrates like a ripple in a
pond from the center outward to the edges and back. The frequency
depends mostly on the diameter.

In the thickness mode you are more likely to generate ultrasonic
energy because the resonant frequency For a 2mm thick capacitor
would be roughly 700kHz.

Eric

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
| Eric Strauts                          |
| TEEM Electronics                      |
| Park Ridge, IL 60068                  |
| Email: estrautsspamspam_OUTix.netcom.com         |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

1996\10\14@221451 by Ian Stirling

flavicon
face
>
> On Thu, 10 Oct 1996, Kevin Krauel wrote:
>
> > Rick Miller <@spam@rickKILLspamspamDIGALOGSYS.COM> wrote ...
> >
> > >[ ... ]
> > >
> > >Something important to remember though is that you don't want to
> > >leave a DC bias sitting on the piezo!
> >
> > Why?  Do you think a constant DC bias will damage a piezo?
>
> Yes.
>

Could you please elaborate, and give some details on why?
Frankly I'd much rather beleive the pezio manufacturers manual,
which indicates constand DC is not a problem, that and my knowledge
of the physics of these devices.


> Rick Miller, Design Engineer, Digalog Systems, Inc.
>


--
Ian Stirling.                        |  http://web.students.stir.ac.uk/~is06
AKA Caeser, Bolonewbie.              |  Pretty sad at the moment, should get
                                    |  better tho.

1996\10\15@091400 by Martin McCormick

flavicon
face
       What does a constant DC bias do to a piezo transducer to
damage it?

Martin McCormick WB5AGZ  Stillwater, OK 36.7N97.4W
OSU Center for Computing and Information Services Data Communications Group

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