Shop OBEX P1 Docs P2 Docs Learn Events
Whats the best way to measure frequency from a sensor outputing pulses using th — Parallax Forums

Whats the best way to measure frequency from a sensor outputing pulses using th

hybridhybrid Posts: 16
edited 2005-11-16 19:19 in BASIC Stamp
Hey everyone. I got another question here. Rather than try to re-invent the wheel i'm sure someone has tackled this problem. I have a wind speed sensor which produces pulses. The pulse frequency increases with wind speed. What is the best way to transform this frequency into digital form using the basic oem stamp2. Are there any direct commands for this or will it require some extra circuitry or IC's. Let me know. Thanks.burger.gif

Comments

  • BeanBean Posts: 8,129
    edited 2005-11-16 18:32
    Use the COUNT command.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Those that would give up freedom for security will have neither.
    ·
  • hybridhybrid Posts: 16
    edited 2005-11-16 18:44
    Hey this command is nice. I do have one question. The help file doens't really say what it interprets for a change from 1 to 0 or from 0 to 1. Im guessing pulses must be approximately 5v pulses for a 1 and 0V for a zero???
  • Tom WalkerTom Walker Posts: 509
    edited 2005-11-16 19:03
    There are voltage thresholds that define when something is interpreted as a "0" (off) or "1" (on) state. I'm thinking it's around 1.4 volts, but check me on that. There is probably something in the help file for RCTIME that might give you the value. Note that for the 2p series, you can use the CONFIGPIN command to change this for either TTL or CMOS levels.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-11-16 19:15
    Tom,

    ·· You are correct in that the BASIC Stamp sees a·HIGH as above 1.4V and a LOW as below 1.4V.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-16 19:19
    The topic was discussed a few months ago: http://forums.parallax.com/showthread.php?p=545917


    funny thing is the new search engine missed the thread but the old "broken" one found it· :HAHA

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
Sign In or Register to comment.