Odometer


Closed Thread
Results 1 to 14 of 14

Thread: Odometer

  1. #1
    mataston's Avatar
    mataston Guest

    Default Odometer

    HI I HOPE SOMEONE CAN HELP i am trying to build an odometer for my car, the circuit is simple enough a hall effect trigger and a magnet to generate a pulse, i need a pic controller to count so many pulses before displaying 1 mile. as the propshaft on the vehicle is going to rotate several times before covering a distance of 1 mile, there fore producing a given amount of puleses before covering a mile. how can i write this in picbasic pro. also another part of the design i am not sure of is how to retain the amount of miles covered. so next time power is switched on it continues counting. all help is appreciated.

    thanks mat

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


    Did you find this post helpful? Yes | No

    Default

    depending of your car model and year but most of the time, they already have a sensor called VSS (Vehicule Speed Sensor). It's actually pretty simple to read from them. Some of them will produce 6000 pulse/miles, some other 4000 and the list is long.

    If your car have this Sensor, you can find the info at the link bellow
    http://www.rostra.com/rostra-obstacle.htm --> Search application guide
    Steve

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

  3. #3
    mataston's Avatar
    mataston Guest


    Did you find this post helpful? Yes | No

    Default not that simple

    unfortunetly it isnt that simple as my car is a kit car and i am looking getting rid of the old cortina dials i have in it, and building some digital ones instead.

    cheers mat

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


    Did you find this post helpful? Yes | No

    Default

    O.K in the past Audiovox Cruise control (now Rostra) sold some magnet stuff to stick on the drive shaft and a sensor... i remember that time.

    Yup, hall effect sensor is the way to go. Now you can begin by using a 16 bit internal counter and read the results after 1 mile. You should be able to do something with it.

    Read datasheet in the TIMER section. Once done, do some test.

    In the Code Example section, you can find a Frequency Counter thread. It should gives you some start point.

    Good luck!
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Also, Microchip appnote DS41214A (CCP tricks and tip) is also a good reference
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    mmm another idea here, as you already have something workable, you can probably modify it. Is this a Cable system? If so, you can probably modify the dash end and attach a Optical Encoder to create your VSS signal. Optical encoder OR Using some optocoupler stuff.
    Steve

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

  7. #7
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    mataston

    If you have the pulse already and it is 5VDC, you can use the PBP to read that port (make it an input) and debouce it (hard way). I have been told PBP has interrupts. So the best way, is to use the hall effect device to trigger an interrupt pin on the PIC and your interrupt routine to count the turns, when you hit the mile number, you increment the mile counter and clear the hall effect counter. You will have to find a mile road, run down it and get the count for when you reach a mile for your base number.

    Last, you will want to write the number (of miles and if you want to be closer on real miles, save the current hall effect count) in the EEPROM of the pic chip. Then you can kill the power and the numbers (miles and last faction of a mile) will be there next power up. So when you power up you will want to read them back, and keep adding to the counter and the miles counter.

    Do you have the schematic for this items. I would be happy to look at it and help.

    Also, you only have so many write to the EEPROM, and on the PIC it is fair, not great but a big number (maybe 100,000 writes). You also need to determine when to write the number to the EEPROM. I would say everytime you are not moving (no pulse for so many seconds), and set a variable so you only write it only once until you are moving again.

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


    Did you find this post helpful? Yes | No

    Default

    IMHO, i would avoid to write too much to the EEPROM and avoid to reduce his lifetime.

    2 Possible solutions:

    1. write to EEPROM when you remove the key from the ignition switch. You must have a switched 12 volt and a constant 12 volt routed to your cluster..

    2. Write to the EEPROM only when the battery is disconnected. For that you'll need to add some extra hardware but not impossible.

    Option 1 is still good enough to me so far
    Steve

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

  9. #9
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default

    I'm not privy to the acronym.....IMHO. What does that mean?

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


    Did you find this post helpful? Yes | No

    Default

    In My Humble Opinion.

    Here's a link wich explain some of the common chat abreviation => http://www.stevegrossman.com/jargpge.htm#Dictionary
    Steve

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

  11. #11
    Join Date
    Jun 2005
    Location
    Mumbai,India
    Posts
    43


    Did you find this post helpful? Yes | No

    Exclamation Odometer

    Quote Originally Posted by mister_e
    mmm another idea here, as you already have something workable, you can probably modify it. Is this a Cable system? If so, you can probably modify the dash end and attach a Optical Encoder to create your VSS signal. Optical encoder OR Using some optocoupler stuff.

    I think U cant make odometer with just Hall sensor. What U need is Quadrature optical unit. By this U can sense whether car is going forward or reverse!!
    Unless U want the reverse distance travelled also added. With quadrature opto unit and 2 JK flipflops U can generate + & - ve pulses per
    revolution and then just count them and divide by pulses/mile or Km whatever
    is Ur unit. Also then U can calculate the speed also to be alternately displayed. All cumulative distance should be written to EEPROM when switching off occurs and read again after next switch off.
    I leave it to masters for genarating code on this line. I have serviced
    such Odometer used in runway painting. It was based on Z80.
    Last edited by psdayama; - 2nd June 2006 at 13:14. Reason: Forgot email notification

  12. #12
    mataston's Avatar
    mataston Guest


    Did you find this post helpful? Yes | No

    Default reverse

    i can still use a hall effect, basicly when you put the car in reverse it activates a switch which obviously turn your reverse lights on, therefore i can use that signal to turn off the signal from the hall effect device therefore no counting while in reverse.

  13. #13
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink no complicated hardware needed ...

    Quote Originally Posted by mataston
    unfortunetly it isnt that simple as my car is a kit car and i am looking getting rid of the old cortina dials i have in it, and building some digital ones instead.

    cheers mat
    Hi, Mat

    Old dials work with a magnet rotating with the cable coming from the gear box...

    i have somewhere a very very old kit intended to be a speed limit alert : It works with a self made core coil fixed at the rear of the odometer.

    If interested ask me ...

    For rear gear ... thinking to it make me laugh !!! : How much "reverse" miles do you really drive in your car lifetime ... ???

    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Possibility to hack the current one too.

    If your current cable go to a cluster 'motor', thereafter this motor use a serie or Gear and goes to your KM/Miles counter. Is it possible to remove the adapter + motor and read from that with hall effect sensor.. i think so.

    mmm seems i had the same idea of Alain after all
    Steve

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

Similar Threads

  1. Speedometer and Odometer
    By mdaweb in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2005, 13:33

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