Hi Mike,
Yes, microcontroller, I am new at this... you're right.
As you have described, I haven't found any high level descriptions
(like "piezos can be used for creating beeps and buzzers" or "a
transducer can be used as a small speaker"), instead they are much more
detailed, including the Google define: descriptions. Ultimately, I'm
confident I'll understand what they mean, but for now, I'm afraid I'm
lost.
A piezo crystal flexes when you apply voltage to it, so when you
apply a varying voltage, it vibrates. That's the gist.
re: your PWM paragraph, this is exactly the kind of push-start I need
to simply point me in the right direction... I didn't want to go to the
trouble of getting some parts if they were not what I needed, and waste
a lot of time, as valuable as that might be in the long run. Thanks.
re: "not self-oscillating", you said earlier that was the kind I'd have
to supply a tone to...I'm guessing that your earlier description about
the PWM, the period and the duty cycle is how I would supply that tone?
Yup.
At
http://ww1.microchip.com/downloads/en/AppNotes/00538c.pdf
Yeah. I blew that app-note off because everything I needed to know
to implement PWM is in the datasheet for the chip in question. The
self oscillating piezos, buzzers, and sounders operate when you
apply a DC voltage. Regular piezos, speakers, transducers ( a
speaker is a transducer if you want to use the $20 word) operate
from an AC signal.
I found a discussion about attenuation. I don't pretend to understand
it right now, but I get the point that the output needs to be filtered
and adjusted. At any rate, it is specific enough, that with a little
bit of trial and error and documentation, I can probably stumble my way
into an answer.
KISS (keep it simple stupid) method is to rig a volume control (pot
or potentiometer) between the PWM out and the speaker and once you
get the volume level, measure the resistance between the wiper and
both ends and there's your attenuator.
View in fixed width font. See the link for that up top if posting
from google.
PWM ---+
|
.-. R1 .---|
| |<------| | just another transducer
| | +-| | or speaker symbol
'-'R2 | '---|
| |
| |
=== ===
GND GND
A piezo symbol would be more like
|
_-_
|___|
-
|
Just like a crystal.
PWM----+
|
.-.
| |R1
| |
'-'
|
| __ /|
+---------| | |
| +-|__|<->
.-. | \|
| |R2 |
| | |
'-' |
| ===
=== GND
GND
created by Andy´s ASCII-Circuit v1.22.310103 Beta
www.tech-chat.de
Now about filtering. That thing you found has a voice coil of some
kind. Speakers don't like square waves. At least not anything that
pushes the limits. So what you do is filter the harmonics out to
make it more sinusoidal.
R
___
PWM -|___|----+----- out to attenuator (attn)
|
|
--- C
---
|
|
===
GND
<OT>
Proposed future IEC resistor symbol to appease PHBs who want one
symbol that's PC here and across the pond:
_____
-|/\/\/|-
----- <-- raise that line up.
I just proposed it per a prior poster's suggestion. Maybe JW or
someone will repropose it to whoever dreams that stuff up.
</OT>
Say you want tones from 1 kHz to 3 kHz... Square waves are made up
of odd harmonics, so the 3rd harm of 1 kHz is 3 kHz and you'd want
to filter that out. That will attenuate the 3 kHz tones you may or
may not want a bit, so you'll need to trade off range for sound
level or vice versa. OTOH, you can raise the cutoff freq above 3 kHz
and take some extra 3rd harmonic distortion ( not distortion of the
square wave, but of the ideal sine wave you never had to begin with,
so it's not really distortion ) and you'll still be ok. The more odd
order harmonics present in the signal in the correct proportions,
the more square it becomes.
The cutoff freq for the above filter is 1/(2piRC). That's where the
signal level will be down by 3 dB or "half power". I don't think we
need to get any deeper.
Thanks Mike,
Sure.
I'm happy to keep this thread open in case you think of anything else.
I've sent my first correspondence to the ARIOSE company, I'll see what
they have to say.
Good move. If you have any probs with mfg reps getting parts,
they'll probably do your bitching for you and light some fires.
If they confirm that it requires an AC voltage, I'll ( or just about
anyone here) figger out the details of the filter and attn for you.
Also get confirmation of WTF they mean with their operating and max
voltage specs. I would expect a peak to peak spec or an RMS spec,
not a peak spec like Vo-p. I'd expect Vpp or Vrms.
Rated Voltage(Vo-p): 3
Operating Voltage(Vo-p): 2.3 - 4
Current Consumption(mA): 100 max // does not compute with R below
Coil Resistance(Ω): 12 +/-3
2.3 * .707 / 12 = 135 mA, which exceeds the max current spec. Maybe
they need to put the crack pipe down.
Oh. Accuracy of your PIC timebase... I don't know what your game
does, but if you don't need accurate timing, you can use the
internal oscillator. Some PICs have a calibration word that makes it
even more accurate. You probably don't need a crystal. Not if it's
something like needing a timer to give the player a number of
seconds to respond. There's a few ways to do that with or without a
crystal.
I don't know what the PIC requirements are either. There's alot of
info on the net for the 16f84 and it's obsolete. 16f628A/648A or
16f88A are nice chips, though.
http://www.glitchbuster.com/
Randy ships fast and he won't rape your wallet. He's got PICs and
support parts. Info too.
www.piclist.com
is a good PIC info site. Great forum/mailing list for PIC and EE
questions. Lots of novices trying to flash LEDs and such, as well as
EE types.
I can't think of anything else, so I'm off.
See ya.