Doubling the pusle count


Closed Thread
Results 1 to 40 of 44

Hybrid View

  1. #1
    malc-c's Avatar
    malc-c Guest

    Default Doubling the pusle count

    Guys,

    Quick question. A friend has replaced his instrument consol in his wifes car, for one that has a tacho and odometer (speedo). The tacho works fine, but the speedo uses an optical sensor (from where I don't know) that uses a slotted disk to generate the pulses, the result of which is that the speedo reads half of the true speed (ie when the speedo is showing 20mph the car is actually doing 40mph.

    He has asked me if there is a way of using some form of electronics to double the count from the optical disk sensor. I did suggest replacing the disk with twice the number of slots, but he said that is impossible to do without distroying the sensor.

    I was wondering if there was any way of using a small PIC to do the job. Not sure of how the current sensor is decoded (ie if its just the square wave pusles that is checked or if it already counts the low to high / high to low pusles. - If it counts just the positive going pulses, the could a PIC be used to count the change of state which would then result in twice the count and use this to base the frequency of the outputted square wave which could then be fed to the speedo receiver ?

    The other issue is that if the encouder is running at 12v what would be the best way to reduce this voltage to the normal 5v level, would a simple voltage divider with two resistors work ?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    Guys,

    Quick question. A friend has replaced his instrument consol in his wifes car, for one that has a tacho and odometer (speedo). The tacho works fine, but the speedo uses an optical sensor (from where I don't know) that uses a slotted disk to generate the pulses, the result of which is that the speedo reads half of the true speed (ie when the speedo is showing 20mph the car is actually doing 40mph.

    He has asked me if there is a way of using some form of electronics to double the count from the optical disk sensor. I did suggest replacing the disk with twice the number of slots, but he said that is impossible to do without distroying the sensor.

    I was wondering if there was any way of using a small PIC to do the job. Not sure of how the current sensor is decoded (ie if its just the square wave pusles that is checked or if it already counts the low to high / high to low pusles. - If it counts just the positive going pulses, the could a PIC be used to count the change of state which would then result in twice the count and use this to base the frequency of the outputted square wave which could then be fed to the speedo receiver ?

    The other issue is that if the encouder is running at 12v what would be the best way to reduce this voltage to the normal 5v level, would a simple voltage divider with two resistors work ?
    Off the top of my head (and to keep it seriously simple) you could 'COUNT' the input pulses, double that and 'FREQOUT'. I see the obvious problem with that...but them maybe setup the PWM or TMR hardware to output the doubled-pulses.

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for that - so something like Freqout=2 X pulsein.... I'll try knocking up a square wave generator and use that as a signal input to a PIC and see what happens - many thanks

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    ....(ie when the speedo is showing 20mph the car is actually doing 40mph...


    malc-c,

    Two other solutions:

    1. Change the numbering on the speedo display.
    or
    2. Put a little note on the display telling the driver that "Drive half speed and be safe".

    -------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sayzer View Post
    malc-c,

    Two other solutions:

    1. Change the numbering on the speedo display.
    or
    2. Put a little note on the display telling the driver that "Drive half speed and be safe".

    -------------
    Yeah.. I already told my mate that the simple answer was to tippex out the numbers and letrasett new digits on the dial

    Didn't go down well !

  6. #6
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Do you know the duty cycle of the sensor output ?

    My thought is to use the "Port B interrupt on change" feature on something like the 16F88. Looking at the datasheet it seems to indicate that an interrupt will be generated on any change so low-high and high-low would both generate an interrupt.

    Create an interrupt routine that generates a short pulse on a pin and feed the speedo with that. Provided the speedo only needs to count the pulses rather than needing an exact mark/space ratio then it should work. You would obviously need to ensure that the pulse you generated was short enough to be completed in about half the time that pulses would be arriving at maximum speed.

    The only caveat is that it depends on how it calculates the speed. If it counts the number of pulses in a second then it should be OK, but if it times the interval between pulses then there could be a problem if the output of the sensor is not 50/50 as alternate generated pulses would have different spacings.

    Dont know if any of the 8 pin PICs would be able to do it as I haven used any of those yet.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    what brand, year and model of car?

    the Speed Sensor is mechanical, then you MUST measure the frequency for x speed. Once you know that, i think it can be done with a 10Fxxx pic and few line of code... if the frequency is not to high of course...

    The duty cycle have to be 50%... VSS (vehicule speed sensor) are noted in Pulse Per Mile.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    Hi Malc-c,
    Tell your friend to take the car to a speedometer shop. They will install a gear increaser to calibrate the speedometer, or they will change the drive gear or driven gear. This is probably the cheapest fastest route.
    JS
    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.

Similar Threads

  1. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  2. Can't get COUNT to count
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 23rd March 2009, 23:14
  3. Count pulses between VARIABLE TIME
    By RodSTAR in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th October 2007, 12:44
  4. Multiplex Display with count comand
    By mdaweb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th October 2005, 04:09
  5. Count command
    By hawk72501 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th September 2005, 19:04

Members who have read this thread : 1

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

Posting Permissions

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