Shop OBEX P1 Docs P2 Docs Learn Events
piezo vibration — Parallax Forums

piezo vibration

ArchiverArchiver Posts: 46,084
edited 2002-02-22 01:28 in General Discussion
Hello,

I'm using a piezo vibration sensor, the ldt xxxx from digikey, and
an LM386 amplifier circuit...

I think the thing is working, now, but it's not quite what I wanted or
maybe it won't even do what I want.

I have the sensor stuck vertically into a hobby board, and the output of
the amplifier circuit is being read by the pulsin command, in a loop,

when I flick the sensor it definitely generates a number, but it takes a
flick,
and I wanted a sensor that would be more sensitive, to something like
tapping on
the table, or reading the vibration of an electric motor...
[noparse][[/noparse]does this require something like a gyro?]

SO...how do I tweak this? can this sensor be made sensitive?

any help is appreciated

if I understand this thing correctly, the piezo sensor generates a current
when it is
compressed by bending, then the current is amplified by the LM386 circuit,
then the
stamp uses the pulsin command which is really an a to d converter, and this
is
the number I see in my debug window
[noparse][[/noparse]is this true]??

program

start:
pulsin 'into variable
debug 'result
goto start

this is the essence of my program

thanks

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-02-21 16:43
    The pulsin command does just that measure the width of a pulse in your
    case measure the width of the pulse when it exceeds the threshold of the
    stamp input that is why you have to flick it, you will need an A/D
    converter to get the vibration data.

    Craig

    > if I understand this thing correctly, the piezo sensor generates a current
    > when it is
    > compressed by bending, then the current is amplified by the LM386 circuit,
    > then the
    > stamp uses the pulsin command which is really an a to d converter, and this
    > is
    > the number I see in my debug window
    > [noparse][[/noparse]is this true]??
  • ArchiverArchiver Posts: 46,084
    edited 2002-02-21 18:00
    >I'm using a piezo vibration sensor, the ldt xxxx from digikey, and
    >an LM386 amplifier circuit...
    >I think the thing is working, now, but it's not quite what I wanted
    >or maybe it won't even do what I want.I have the sensor stuck
    >vertically into a hobby board, and the output of the amplifier
    >circuit is being read by the pulsin command, in a loop, when I flick
    >the sensor it definitely generates a number, but it takes a
    >flick,and I wanted a sensor that would be more sensitive, to
    >something like tapping onthe table, or reading the vibration of an
    >electric motor...

    Hi rad0,

    It is possible to read the output of the LDT vibration sensor with
    RCtime, using an op-amp circuit:
    http://www.emesystems.com/BS2rct.htm#SmallV
    The vibration sensor is near the end of the article. Basically, the
    vibration sensor is the input to a voltage to current converter,
    which also rectifies the AC signal. The current is integrated by a
    capacitor, and the voltage across the capacitor is sensed by the
    Stamp input pin running RCtime.

    The LM386 is an audio amplifier, not an op-amp, so it is not suitable
    for this purpose. An LM358 single supply op-amp or equiv. should
    work okay. Put a resistor of ~1 megaohm in parallel with the sensor
    at the input to the amplifier.

    As to pulsin, it is possible to get a reading from the stamp in
    response to big "flicks" without any amplifier at all. The sensor
    generates more than one volt into the high impedance input of the
    Stamp. (Use a 10 Mohm parallel resistor) The trouble is, the "flick"
    has to start within the 0.13 second window of time that the PULSIN
    command waits before giving up. Smaller vibrations definitely
    require an amplifier of some sort.

    >if I understand this thing correctly, the piezo sensor generates a
    >current when it is compressed by bending,

    That is right, I think. The current charges up the capacitance of
    the plastic film and that also gives a voltage. (The sensor is a
    sandwich of piezoelectric kynar film between metalization layers--a
    capacitor) A high impedance input like the Stamp or an op-amp can
    read that voltage without disturbing it or leaking off the charge.
    But you do need to put a resistor (~1 to 10 megaohm) in parallel with
    the film to leak off the charge on purpose so that the film won't
    develop an overriding DC offset voltage. It is also possible to
    sense the current produced by the sensor directly into a short
    circuit, but that is a different circuit.


    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2002-02-21 23:23
    A standard piezo element should work. These are what my old Radio Shack car
    alarm used for vibration sensors.
    > when I flick the sensor it definitely generates a number, but it takes a
    > flick, and I wanted a sensor that would be more sensitive, to something
    > like tapping on the table, or reading the vibration of an electric
    > motor... [noparse][[/noparse]does this require something like a gyro?]
    >
    > SO...how do I tweak this? can this sensor be made sensitive?
    >
    > any help is appreciated
    Actually generates a voltage which can be quite high if given enough force.
    You'll
    probably want a clipper circuit to protect your amp.
    > if I understand this thing correctly, the piezo sensor generates a current
    > when it is compressed by bending, then the current is amplified by the
    > LM386 circuit, then the stamp uses the pulsin command which is really an a
    > to d converter, and this is the number I see in my debug window [noparse][[/noparse]is this
    > true]??
    Pulsin measures the width of a pulse, which in this case would only give you an
    indication that you got some type of input assuming it had enough amplitude to
    trigger the STAMP's input..
  • ArchiverArchiver Posts: 46,084
    edited 2002-02-22 01:28

    Original Message
    From: "Mike DeMetz" <miked@e...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, February 21, 2002 3:23 PM
    Subject: [noparse][[/noparse]basicstamps] Re: piezo vibration


    > A standard piezo element should work. These are what my old Radio Shack
    car
    > alarm used for vibration sensors.
    > > when I flick the sensor it definitely generates a number, but it takes a
    > > flick, and I wanted a sensor that would be more sensitive, to something
    > > like tapping on the table, or reading the vibration of an electric
    > > motor... [noparse][[/noparse]does this require something like a gyro?]
    > >
    > > SO...how do I tweak this? can this sensor be made sensitive?
    > >
    > > any help is appreciated
    > Actually generates a voltage which can be quite high if given enough
    force. You'll
    > probably want a clipper circuit to protect your amp.
    > > if I understand this thing correctly, the piezo sensor generates a
    current
    > > when it is compressed by bending, then the current is amplified by the
    > > LM386 circuit, then the stamp uses the pulsin command which is really an
    a
    > > to d converter, and this is the number I see in my debug window [noparse][[/noparse]is this
    > > true]??
    > Pulsin measures the width of a pulse, which in this case would only give
    you an
    > indication that you got some type of input assuming it had enough
    amplitude to
    > trigger the STAMP's input..
    >
    Yeah, thanks everyone, I was giving pulsin mystical properties...I have the
    flu,
    but that's no excuse...
Sign In or Register to comment.