suggestions on reading a pulsing vehicle speed sensor?


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2004
    Location
    Calabasas, CA
    Posts
    84

    Default suggestions on reading a pulsing vehicle speed sensor?

    Are PULSIN and COUNT the only options for reading a pulsing vehicle speed sensor input?

    It seems to me COUNT could be a better choice since it has a built in smoothing function by counting a multitude of pulses over a given period, as in pulses per second.

    My issue's are one of data smoothing from a noisy (motorcycle) environment.

    I am using a 16F716 PIC.

    Thanks
    James

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by droptail View Post
    Are PULSIN and COUNT the only options for reading a pulsing vehicle speed sensor input?

    It seems to me COUNT could be a better choice since it has a built in smoothing function by counting a multitude of pulses over a given period, as in pulses per second.

    My issue's are one of data smoothing from a noisy (motorcycle) environment.

    I am using a 16F716 PIC.

    Thanks
    Hi James,
    It strikes me as a little funny, that Dave linked you to my tach program where I took the easy road and used count. A better way might be to use a timer and count interrupts. It really depends on what you are counting, and what else you expect the PIC to do. If it is just a tach then count will likely do. If you need to use the data and do something else then timer interrupts will be more satisfactory.

    Noisey motorcycle environment . . . Well let's see, basically unregulated alternator, EMI from the ignition system, lots of vibration, all this means is you will have to use all the "best practices" when you design and assemble your circuit, power regulator with filter caps and a choke, put it in a metal box and ground it to the battery {altoids tins see a lot of action as chassis boxes) a ferrite bead on any input pins are cheap suppression, snubber diodes on any outputs controlling inductors. Take sure to seal the box from moisture and oil, Some foam around the PC board is pretty good insurance against vibration, as are SMT components.
    Last edited by Archangel; - 23rd June 2010 at 02:14.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Hi,

    The counting method will mainly depend on the input pulses frequency ...

    COUNT need lots of ... counts and if pulses frequency is low ...

    Response time is very slow ...

    One must try to make a PERIOD measurement, then. and better calculate a mean value over some cycles ...

    the thing I like to do is have a big counter and fill it with sum of period samples ... so the sampling time remains quasi constant.

    few long samples if engine runs slow, many short ones if engine runs fast ...

    I also use a switchable 1:10 divider ( a 4017 ! ) upon the RPM range ...

    This way, I had realised a model plane RPM meter ranging from 43 to 32,000 rpm ... with more than .1% accuracy and an acceptable response time ...

    The interrupt way is trickier, because of false triggering to avoid ... so, a very well designed input stage has to be used ...

    But it's the fastest response ( for shift Lights, i.e. when max. engine accel. is looked for ...)

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I figured the COUNT example would be the easiest to get started with.

    As for the low or high frequency issue, have two or three sub routines.
    If COUNT is X,Y,Z goto a routine with a different COUNT PERIOD.

    That's my story...
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Are PULSIN and COUNT the only options for reading a pulsing vehicle speed sensor input?
    Do you need to count the number of pulses in a given period, or measure the width of a pulse/pulses?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Hi, Bruce

    If it is a for a speedometer, the " basic info " is pulses per km or mile ...

    now , knowing how many pulses per km ( generally written on the odo dial ...) , you easily can transform period to kph ...

    the question then turns into ...

    " what to read ??? " ... km or kph ???

    looks kph or mph was the initial request ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts