Program to record data from a cheap OBD2 scanner
Grab our Forum Feed

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: Program to record data from a cheap OBD2 scanner

  1. #11
    Join Date
    Jun 2011
    Location
    Westborough, MA B-2689
    Posts
    772

    Default

    Quote Originally Posted by wizkid057 View Post
    Perhaps when I get some more time I'll tidy and publish the code, although, I'm not sure how much OnStar would appreciate that...
    They will probably appreciate it as much as GM appreciating me starting to publish some of the OBD2 IDs. Whether or not they like it, there isn't much they can do about it. :)
    B-2689
    Personal Best Charge: 57.2 miles
    Best Day: 71.3 miles, no gas (49.9 on full charge, 21.4 on ~4 hours @120V)
    Over 4 billion pieces of data collected on the Volt OBD2 port

  2. #12
    Join Date
    May 2012
    Location
    Erial, NJ
    Posts
    57

    Default

    Quote Originally Posted by RScott View Post
    They will probably appreciate it as much as GM appreciating me starting to publish some of the OBD2 IDs. Whether or not they like it, there isn't much they can do about it.
    Well, with the OBD2 IDs, they can't do anything at all about it. However, I fear with the OnStar-based stuff (which actually uses their resources), they could eventually modify their end so that it can't be done as easily if it becomes an issue for them, which is why I would be hesitant to publicly post such code.

    -wk
    Volt #2012-09289, Black, Premium Trim Package, Bose Sound, Navigation, Jet Black and White Leather

  3. #13
    Join Date
    May 2012
    Location
    Erial, NJ
    Posts
    57

    Default

    Quote Originally Posted by RScott View Post
    Here's how I convert the 4-byte latitude or longitude to a float ('mas' is milliarcseconds as an unsigned int):

    Code:
    if ( mas >= 0x40000000 )
    {
    	mymas = 0 - ( 0x80000000 - mas );
    }
    
    f = ( float )mymas / 3600000;
    Hmm... I hadn't thought about treating it as signed without the sign bit set (0x80000000). Works well now, thanks.

    -wk
    Volt #2012-09289, Black, Premium Trim Package, Bose Sound, Navigation, Jet Black and White Leather

  4.  

    Advertisement

  5. #14
    Join Date
    Oct 2010
    Location
    Chicagoland VIN:B-01234
    Posts
    3,509

    Default

    Quote Originally Posted by tboult View Post
    RScott is not using PID polling, he is doing passive scanning of the bus.
    I've only found one PID for battery specific info

    PID 01 5B
    Type precent
    Formula is
    A*100/255

    This gives raw battery SOC.

    If you want battery as a usable percent (0=empty 100%=full) then try

    PID 01 5B
    min(100,max(0,(((A*100)/255-21)/65)))

    Where the 21 is the lowest battery level you see and 86 is about the highest. (I;ve actually seen 20.5 and 87.6 but I think those were abnormal situations). <snip>
    One of the coolest tech post ...
    http://gm-volt.com/forum/showthread....1868#post91868
    My first results that might be of interest from the DashDAQ OBD scanner, I eyeballed the transitions of each battery bar. The DashDAQ has at least two signals for battery level in the Volt extension driver, one for battery level % and one for the battery gauge %. The gauge turns out to map directly to the battery bars on the display, with each bar ticking off every 10% of the signal range (at least it did for the transactions I happened to watch - staring at the scanner while driving being a bad idea I haven't watched to confirm the entire series).

    Here's how it maps between the gauge display and the actual battery SOC (or at least I think the VICM term is SOC).

    Code:
    Battery Gauge  Gauge %     Actual 16kWh Battery %
    10 bars        91%-100%    81%-86.5%
    9 bars         81%-90%     74.4%-81%
    8 bars         71%-80%     68%-74.4%
    7 bars         61%-70%     61.5%-68%
    6 bars         51%-60%     55.3%-61.5%
    5 bars         41%-50%     48.7%-55.2%
    4 bars         31%-40%     42.1%-48.7%
    3 bars         21%-30%     35.6%-42.1%
    2 bars         11%-20%     29.3%-35.5%
    1 bar           1%-10%     22.7%-29.3%
    0 bars          0%-1%      20%-22.7%[/SIZE][/FONT]
    The ICE comes on around 20% SOC, and the CS (Charge Sustaining) SOC is around 22%. So the ICE runs a bit to bring the SOC back up from 20%ish to 22%ish. This somewhat confirms some of what we've heard about the battery and battery SOC.

  6. #15
    Join Date
    Dec 2009
    Location
    France
    Posts
    96

    Default

    Quote Originally Posted by RScott View Post
    The program runs on Windows, so it requires a laptop/netbook running Windows. It works with the ELM327 v1.4 chipset, and requires a USB interface (not Bluetooth, which is not capable of the high speeds the Volt uses). The $30 ElmScan 5 at http://www.amazon.com/ElmScan-Compac.../dp/B002PYBZJO should do the trick. The program is just an executable file; hopefully, I'll be able to release the source as well at some point in the near future. You can download the executable online at http://www.evtools.info/exe/volt.exe.
    Hi RScott,
    Thank you for your work. I've tried your software with my Ampera.
    It connects easily with my ELM327 (bluetooth), and looks to have no problem switching to 500kbps.
    As long as the car is not started, it writes that it's waiting for CAN bus ( ___.___.___.__ ..). As soon as the car is started, it displays
    E
    Failed to read, car may be off. Continuing to read...
    ............
    and it adds dots endlessly.
    Is this normal?
    Driving an Ampera since 8th December, 2011.
    amperiste.fr : Opel Ampera french fan blog

  7. #16
    Join Date
    Jun 2011
    Location
    Westborough, MA B-2689
    Posts
    772

    Default

    Quote Originally Posted by Herto View Post
    Hi RScott,
    Thank you for your work. I've tried your software with my Ampera.
    It connects easily with my ELM327 (bluetooth), and looks to have no problem switching to 500kbps.
    As long as the car is not started, it writes that it's waiting for CAN bus ( ___.___.___.__ ..). As soon as the car is started, it displays

    and it adds dots endlessly.
    Is this normal?
    Sorry for the delay in responding.

    The "Waiting for CAN bus" message is normal, but then once the car is turned on, the program should display an "E" and a number that updates continuously (representing the number of messages that the program has received).

    The "Failed to read, car may be off" message indicates that the COM port that the OBD2 adapter uses is not sending any data (each "." represents another attempt to see if any data has been transmitted).

    Do you have a link to a page that has information about the specific OBD2 adapter you are using? My understanding is that the Bluetooth adapters don't have enough bandwidth to transfer everything, but if that is the case, I would expect either the switch to 500kbps would fail or there would be some data (just not enough).
    B-2689
    Personal Best Charge: 57.2 miles
    Best Day: 71.3 miles, no gas (49.9 on full charge, 21.4 on ~4 hours @120V)
    Over 4 billion pieces of data collected on the Volt OBD2 port

  8. #17
    Join Date
    Dec 2009
    Location
    France
    Posts
    96

    Default

    Here's what I bought : http://www.amazon.fr/gp/product/B005...ls_o00_s00_i00.
    Is it a way to force your software to try another COM port (as the bluetooth modules creates more than one) ?
    Driving an Ampera since 8th December, 2011.
    amperiste.fr : Opel Ampera french fan blog

  9. #18
    Join Date
    Jun 2011
    Location
    Westborough, MA B-2689
    Posts
    772

    Default

    Quote Originally Posted by Herto View Post
    Here's what I bought : http://www.amazon.fr/gp/product/B005...ls_o00_s00_i00.
    Is it a way to force your software to try another COM port (as the bluetooth modules creates more than one) ?
    Hi,

    Thank you for the link. I've gone ahead and ordered one that looks the same as yours, as it seems that most people prefer using Bluetooth so there are no cords. It will take a couple of days before I get it. Once I get it, I should have a much better idea of what the problem may be.

    As for the COM port, there is no way to set it manually yet (although it shouldn't take too long to add, if needed), but from what is displayed, it sounds like it is getting the correct COM port.
    B-2689
    Personal Best Charge: 57.2 miles
    Best Day: 71.3 miles, no gas (49.9 on full charge, 21.4 on ~4 hours @120V)
    Over 4 billion pieces of data collected on the Volt OBD2 port

  10. #19
    Join Date
    Jun 2011
    Location
    Westborough, MA B-2689
    Posts
    772

    Default

    Quote Originally Posted by Herto View Post
    It connects easily with my ELM327 (bluetooth), and looks to have no problem switching to 500kbps.
    As long as the car is not started, it writes that it's waiting for CAN bus ( ___.___.___.__ ..). As soon as the car is started, it displays

    and it adds dots endlessly.
    Is this normal?
    I just did a bit of testing, and was able to reproduce what you experienced, by connecting to the "wrong" OBD2 port. The Volt/Ampera has 2 OBD2 ports, one on the passenger's side, the other on the driver's side. In U.S. Volts, the one on the driver's side (left, as you are sitting in the car) is the one that has data that can be used. The one on the driver's side has data, but cannot be accessed with most OBD2 tools. When I plug the OBD2 interface into that one, I experience the results that you do.

    I'm guessing that you have the steering wheel on the right side, and I'm also guessing that the OBD2 interface you want would be on the passenger's (left) side, but I could be wrong. So I would suggest trying to connect the OBD2 interface on the opposite OBD2 port, and see if that works.
    B-2689
    Personal Best Charge: 57.2 miles
    Best Day: 71.3 miles, no gas (49.9 on full charge, 21.4 on ~4 hours @120V)
    Over 4 billion pieces of data collected on the Volt OBD2 port

Similar Threads

  1. $30 OBD2 CAN tool
    By RScott in forum Software/programming/code
    Replies: 35
    Last Post: 05-29-2012, 08:16 PM
  2. Fleet data gathering testing tool data to play with.
    By scottf200 in forum Engineering and Design
    Replies: 0
    Last Post: 04-28-2012, 09:38 PM
  3. Kiwi Bluetooth ODBII Scanner
    By eplantz in forum Volt Ownership Forum
    Replies: 2
    Last Post: 04-09-2012, 02:08 PM
  4. OBD2 PID's
    By MIN FUEL in forum Chevy Volt Accessories, Modifications, and Hacks
    Replies: 4
    Last Post: 04-06-2012, 12:27 AM
  5. I can't believe how cheap gas is!
    By frankydude in forum Chevy Volt News and Events
    Replies: 10
    Last Post: 03-18-2012, 10:17 AM

Tags for this Thread

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