Shop OBEX P1 Docs P2 Docs Learn Events
Trouble reading frequency — Parallax Forums

Trouble reading frequency

alexb2alexb2 Posts: 3
edited 2009-01-28 23:41 in BASIC Stamp
Hello, I've used stamps many times over the years and this is the first time posting on this forum. BTW I have searched this forum and the net for an answer before coming here and still cannot find what I am looking for.

I am having trouble reading frequencies with my bs2 using piezo film sensor that I purchased from Parallax. I used the same schematics listed in the pdf. http://www.parallax.com/Store/Sensors/PressureFlexRPM/tabid/177/CategoryID/52/List/0/Level/a/ProductID/89/Default.aspx?SortField=ProductName,ProductName

My problem is that it will only show a frequency in debug window when I shake the sensor or by moving/bending it. It will not register anything if I put a loud radio speaker near it and not when I slam my hand on the table. I have to really hit the table hard near the breadboard to get it to show anything.

Am I using the wrong sensor for the task? I basically want to measure small vibrations or sounds of multiple frequencies (one would be from a cars exhaust).

Here's the basic set up.

Same schematics listed in the pdf from above page.
sample code.


v0 VAR Word
v1 VAR Word
v VAR Word
F VAR Word

MAIN:
PULSIN 5, 1, v1
PULSIN 5, 0, v0

v = (v0 + v1)*2

f = (50000/v)*20

DEBUG DEC f, " Hz "
DEBUG DEC v, " V ", CR ' just to show small numbers

P.S. I have also tried using 'COUNT' instead of 'PULSIN'.

Thank you,

Comments

  • metron9metron9 Posts: 1,100
    edited 2009-01-28 19:03
    "My problem is that it will only show a frequency in debug window when I shake the sensor or by moving/bending it."

    That is not a problem, that is what this sensor is designed for. moving and bending is the only way it can produce a voltage.

    If you want to pick up sound from a piezo you need something like this http://parts.digikey.com/1/parts/33-buzzer-piezo-4-1khz-ext-drive-cep-1110.html

    Or a standard transistor radio earphone also works as a microphone!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 1/28/2009 7:08:46 PM GMT
  • alexb2alexb2 Posts: 3
    edited 2009-01-28 19:47
    Okay, thanks, I will use a speaker for the sound part and play a little more with the vibration part (I figured holding it in between my fingers would show some sort of freg but doesn't).
  • JonathanJonathan Posts: 1,023
    edited 2009-01-28 23:14
    Another thing is for small vibrations, you might want to add an amplifier, like with an op-amp. Same apllies with a speaker. Remeber that the pulse has to go above ~ 1.7VDC to register as a "high".

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • alexb2alexb2 Posts: 3
    edited 2009-01-28 23:41
    Remeber that the pulse has to go above ~ 1.7VDC to register as a said...
    igh".
    That is one stupid thing that I did overlook.
    Thank you,
Sign In or Register to comment.