Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: New idea for mileage tracking

  1. #1
    Low Bitrate
    Join Date
    Feb 2003
    Location
    Atlanta
    Posts
    58

    New idea for mileage tracking

    I have a sole proprietership business besides my main job and in order to write off the car as a certain % business use or write off miles, i have to document whenever i drive for business vs personal. So, I was thinking there has to be an easy way to let the carputer do it!

    here's what i was thinking, maybe someone already has a method or can fine tune this or think of a better way...

    get car mileage from obdII connector when computer boots up (i assume this is possible with standard obdII connectors and software?) with background script

    when turn car off, before the comp shuts down, a popup box that has two buttons: personal, business and i can touch whichever one it was for...this saves the end point in a database or even a flat file and marks it business or personal (is this possible? i know the shutdown controllers tell windows to shutdown 5 secs after ignition off...so is it possible to know when this happens and have it call the script to show the buttons before the windows shutdown?)


    alternatively, there could be a button as one of the aux/custom buttons in fp/me/mc/etc that just calls a script that gets current trip info from obdII (does software get the whole trip logged, or just current mileage?) and saves it to a file/database


    any thoughts?
    i'd rather do this than use a notebook and pen in the car for the log...

  2. #2
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    No, OBD II does not support miles travelled at all. The only way to do it through OBD II would be to constantly monitor the speed and approximate the distance travelled based on this. It would be just as easy to do this through GPS, however, both methods would require the computer to be on throughout the whole trip and require continuous polling.

    Since you need to have a program continously running to do the polling it could just listen for the windows WM_QUERYENDSESSION message that is sent to all running programs when the computer wants to shutdown and display the message box then.
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

  3. #3
    Low Bitrate
    Join Date
    Feb 2003
    Location
    Atlanta
    Posts
    58
    so obdII can't even tell me what the odometer says? ugh

    i'll always have the computer on when i'm driving, so i guess i could just give it the starting point when i first install it and then have it go from there...

    if i have to, i'll use on-screen keyboard to input it before/after trips, but that'd suck

    do any gps programs track miles driven?
    and obdII cannot read the odometer?

  4. #4
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    Nope, it sucks, OBDII cannot read the odometer. The only things the standard OBD II protocol supports in terms of real time data can be found here http://www.obddiagnostics.com/obdinfo/pids1-2.html

    I've never seen any OBD II products that do calculate mileage. Thats not to say its not possible to do reliably or that no current products exist, but I do think most OBD II applications are written under the premise of performance monitoring and not under the premise that they are going to be on whenever the car is.
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

  5. #5
    Newbie
    Join Date
    Jul 2004
    Location
    Atlanta
    Posts
    9
    I have been wanting to do something very similar to this as I am in the exact same position (needing to track business mileage). I had envisioned a setup where the computer would read the status (via the parallel port) of a switch mounted on my dash with an LED indicator to show when it was on. If the switch was on, then mileage would be be accumulated using gps. When either the switch was turned off or the car was turned off (just before shutting down or going to hibernation), the accumulated mileage data would be logged with a time and date stamp to a csv file or database.

    Unfortunately, my main problem is time. I would have to assume that this could be done without too much trouble in VB, but I haven't had the time to locate any open-source gps code to receive an NMEA stream and convert it to mileage. Does anyone know of any gps plugins for vb? Or a better way of accomplishing this?
    --------------------------------------------------
    Casetronic C134 | Epia M9000 | 256MB | 20GB HD
    USB SB MP3+ Audio | BR-3 ODBII Interface
    Digitraveler GPS | Carnetix CNX-1260 PSU
    Datalux LMVR10 10.4" LCD

  6. #6
    Low Bitrate
    Join Date
    Feb 2003
    Location
    Atlanta
    Posts
    58
    that would work, too...just have a button that sends a signal to the computer to start/stop the mileage

    so the main problem lies in having the computer know the mileage driven without having to input it ourselves...

    any body have any ideas on that problem?

  7. #7
    Newbie
    Join Date
    May 2004
    Posts
    4
    Just read the speed via OBDII and calculate the milage. The desired accuracy of the system only needs be within a mile (unless you are really really really anal) for each trip.

    There are only two systematic errors incurred with this method and they tend to cancel each other out: when you are accelerating the system reports a distance smaller than you actually traveled and while decelerating the system reports a distance larger than you actually traveled. Since most people start and stop the same way (agressive drivers start fast and stop fast, grandmas start slow and stop slow) over the course of a trip the smaller distance error + the larger distance error should approach the actual distance you travelled. The remaining error should be much less than a mile. Which is more than accurate enough for business reporting.

  8. #8
    Low Bitrate
    Join Date
    Feb 2003
    Location
    Atlanta
    Posts
    58
    that would work. So the ODBII would give me average speed of a trip thus far? or i'd have to have the program ping the OBDII speed every second or so and then calculate the average in the end * total time to get the total miles?


    i also have prolly <10 routes I'd really go right now for my business, so i could just preprogram them in and have a button for each on a popup program in my startup menu, but i'd rather do it right and make it modular and flexible and useful to all...

  9. #9
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    You only get instantaneous speed from OBD II. So yes you would have to poll every second then just calculate the distance you travelled at that speed then add them all up.
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

  10. #10
    Low Bitrate
    Join Date
    Feb 2003
    Location
    Atlanta
    Posts
    58
    i wouldn't even have to do distance at each speed
    as long as i get on a reg interval like once per second, which would include 0s for stops, i could just add up all the speeds and divide by seconds driven to get average speed and then multiply by minutes driven to get total

Page 1 of 3 123 LastLast

Similar Threads

  1. 2 Screen Mount Idea - Drawing Inside
    By Demolition Man in forum LCD/Display
    Replies: 5
    Last Post: 08-10-2007, 09:57 AM
  2. Camera Idea I have for avoiding cops...
    By Matt Whelan in forum General MP3Car Discussion
    Replies: 75
    Last Post: 08-19-2006, 02:31 AM
  3. Security idea - hide the HU
    By jaeger in forum General MP3Car Discussion
    Replies: 17
    Last Post: 08-23-2004, 12:17 PM
  4. unique idea?
    By jojor512 in forum General Hardware Discussion
    Replies: 1
    Last Post: 03-30-2004, 08:15 AM
  5. tracking idea
    By accord in forum GPS
    Replies: 1
    Last Post: 08-20-2002, 06:20 PM

Bookmarks

Posting Permissions

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