CAN bus, fuel level, odometer - Smart Car Forums
User Tag List

 
LinkBack Thread Tools Display Modes
post #1 of 10 (permalink) Old 05-15-2017, 08:29 PM Thread Starter
 
Join Date: May 2017
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
CAN bus, fuel level, odometer

Hi everyone,

I am new in SCoA, and this my very first post here.

I own a 2015 ForTwo 451 and, as electronics engineer, I have not resisted (since some months ago) to the temptation of listening the traffic on the CAN bus (the one broadcasted by the different modules) and also performing some request through PID OBD2 codes. I have had some degree of success with parameters like status of lights, gear selected, doors' status, etc.

But on the other hand, other parameters looks to be hidden very deep, (or I have missed something...)

In this regard I have couple of questions that, hopefully, some of you could answer or just clarify the point a little for me:

1 - Is there any known ID message (proprietary message, of those broadcasted by the modules) that carries the fuel level information, same shown in the instruments cluster by the eight steps fuel bar at the bottom? Or, is there any way I could get that information (perhaps a query code needs to be put on the bus)?

My understanding is that this information reaches the A1 instrument cluster through the CAN bus, so it should be carried by one the messages present on it...

2- A similar question, but in this case for the odometer. I mean, not the total number of kilometers accumulated by the car during its life, but just the trip distance. I have identified the total km on the CAN bus already, but its resolution is 1 Km. The trip accumulated distance increments are 0.1 Km, more accurate...

If some of you have this information and is willing to share it (BTW, this is for personal use, not commercial at all), or just point me in the right direction, it is appreciated in advance very much..!

Thanks,

NorJim
norjim12 is offline  
Sponsored Links
Advertisement
 
post #2 of 10 (permalink) Old 05-16-2017, 06:27 AM
Bohemian Moderator
SCOA Club
 
jwight's Avatar
 
Join Date: Oct 2007
Location: Dayton, OH USA
Posts: 26,304
Thanks: 7,080
Thanked 5,507 Times in 3,291 Posts
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Quoted: 68 Post(s)
Garage
Welcome to SCoA! All I know is when there are no bars left on the fuel gauge you need to fill up....
jwight is offline  
post #3 of 10 (permalink) Old 05-16-2017, 01:23 PM
SCOA Club
 
Rustedwrench's Avatar
 
Join Date: Jan 2012
Location: Northern Virginia
Posts: 1,587
Thanks: 16
Thanked 1,197 Times in 605 Posts
Mentioned: 3 Post(s)
Tagged: 0 Thread(s)
Quoted: 209 Post(s)
If I were you I would do a search for a SAE document that specifies the commands for the various parameters. That is what the scan tool companies use, as far as I know. Some commands may be manufacturer-specific. If I remember correctly the SAE standard for OBD-II is J/1979.
Rustedwrench is offline  
The Following User Says Thank You to Rustedwrench For This Useful Post:
Smart Bob (05-16-2017)
 
post #4 of 10 (permalink) Old 05-17-2017, 08:51 AM Thread Starter
 
Join Date: May 2017
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
Thanks guys for your comments.

Rustedwrench, I'm gonna take a step further on the direction of propietary codes you have suggested. If a proprietary query code for fuel level exists, I don't think I'm gonna find it on a public doccument (not easily, at least...). But, If I can get someone with a scanner capable to talk to a SMART and display the fuel level information, that means the scanner "knows" the code, so if I put a sniffer in between and listen their conversation... That could carify the point a little.

Will keep you updated.
norjim12 is offline  
post #5 of 10 (permalink) Old 05-17-2017, 11:04 AM
SCOA Club
 
Rustedwrench's Avatar
 
Join Date: Jan 2012
Location: Northern Virginia
Posts: 1,587
Thanks: 16
Thanked 1,197 Times in 605 Posts
Mentioned: 3 Post(s)
Tagged: 0 Thread(s)
Quoted: 209 Post(s)
Fuel level input is a voltage signal from the fuel level sensor to the DME (engine control module). That is interpreted and sent to the instrument cluster over the CAN bus to display a fuel level, as far as I can tell. The DME needs to know the fuel level so it can determine whether to run a on-board evaporative emission system test. Both the Snap-On and the OE SDS diagnostic tools show the same thing.
Attached Images
File Type: jpg IMG_0242.JPG (545.9 KB, 14 views)
File Type: jpg IMG_0245.JPG (685.7 KB, 14 views)
Rustedwrench is offline  
The Following User Says Thank You to Rustedwrench For This Useful Post:
norjim12 (05-17-2017)
post #6 of 10 (permalink) Old 05-17-2017, 01:52 PM Thread Starter
 
Join Date: May 2017
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
Rustedwrench,

You have contributed with a superb key piece of information..! If I can get the sensor voltage, that's all I need.

Yes, I have some schematics of the electric system and I have been aware of that flow you described from the M3/3 sensor on the fuel tank to the A1 cluster. What I haven't figured out until now is that what really moves through the CAN bus to the cluster is not the final fuel level information, but just the output voltage of the M3/3. That changes the whole scenario, things start making sense again.

Now that I know what is the right information to look for, I'm going to check again my sample files, captured few days ago at different fuel levels, to see if I can pick up something. If not, sniffing between the car and a scanner (particularly one of those you have mentioned) to look for a propietary query will be also a good second choice.

Thank you so much for your time making the tests and pictures on your car, and also for such a valuable comments.

Will keep you updated with fresh results.
norjim12 is offline  
post #7 of 10 (permalink) Old 05-17-2017, 02:11 PM
 
Miss Mercedes's Avatar
 
Join Date: Sep 2008
Location: WI-IL Border.
Posts: 15,829
Thanks: 5,458
Thanked 2,149 Times in 1,467 Posts
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 147 Post(s)
Garage
I'm eagerly watching this thread with excitement. I have no idea what you're going to find, but I want to be here to see it! Since you're poking about in there, is it even possible to delete the speed limiter without an ecu tune? (Just a challenge, I don't think my rallyfortwo needs to exceed 90 mph xD)
Miss Mercedes is offline  
post #8 of 10 (permalink) Old 05-18-2017, 10:47 AM
SCOA Club
 
Rustedwrench's Avatar
 
Join Date: Jan 2012
Location: Northern Virginia
Posts: 1,587
Thanks: 16
Thanked 1,197 Times in 605 Posts
Mentioned: 3 Post(s)
Tagged: 0 Thread(s)
Quoted: 209 Post(s)
Quote:
Originally Posted by norjim12 View Post
Rustedwrench,

You have contributed with a superb key piece of information..! If I can get the sensor voltage, that's all I need.

Yes, I have some schematics of the electric system and I have been aware of that flow you described from the M3/3 sensor on the fuel tank to the A1 cluster. What I haven't figured out until now is that what really moves through the CAN bus to the cluster is not the final fuel level information, but just the output voltage of the M3/3. That changes the whole scenario, things start making sense again.

Now that I know what is the right information to look for, I'm going to check again my sample files, captured few days ago at different fuel levels, to see if I can pick up something. If not, sniffing between the car and a scanner (particularly one of those you have mentioned) to look for a propietary query will be also a good second choice.

Thank you so much for your time making the tests and pictures on your car, and also for such a valuable comments.

Will keep you updated with fresh results.
Fuel level voltage showing was 2.74 volts and the fuel level display was at 1/2 tank, or 4 of 8 bars. Most vehicle 5 volt sensors use a input operating range of 1/2 to 4-1/2 volts so as to differentiate between a valid input and one that is shorted or open. Many systems use a floating or isolated sensor return or ground slightly above chassis ground for electrical noise isolation.
Rustedwrench is offline  
The Following User Says Thank You to Rustedwrench For This Useful Post:
Smart Bob (05-18-2017)
post #9 of 10 (permalink) Old 05-18-2017, 05:48 PM Thread Starter
 
Join Date: May 2017
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
Rustedwrench,

Just by chance, have you noticed if the voltage/fuel-level relation is inversely proportional? If so, I guess (probably, hopefully) I got something...

The picture attached shows the change observed on a two-bytes field taken out from one of the many CAN sentences periodically broadcasted by the modules through the CAN bus. To have a good data sample containing the desired information following a predictable pattern easy to identify later, I recorded everything was present on the CAN bus during an entire fill up process. Based on that, I began looking for a two-bytes fields showing the kind of progression that I would expect in the value: a continous change (increasing or decreasing) from one steady value to another steady value.

I was looking for a two-bytes field exhibiting this behaviour based on the assumption that a 10-bits, or even a 12-bits ADC converter was used, which is quite common in many present day microcontrollers.

Originally, the fuel level was in bar number 2. After filling up, it was at 7. From your message, I notice there are discrepancies in the fuel bar / voltage read by the scanner (those you got are real facts, a real reference) and the "voltage" resulting from the mathematical process of the two bytes field I have been playing with. Honestly, I was expecting a 5 Volts reference voltage for the ADC. If such is the case, something is wrong in my math because I'm having greater values as you can see in the graph.

It is too early to state this is in fact the M3/3 output voltage, but the shape of the curve was exciting enough to give it a try..
Attached Images
File Type: jpg Fuel level.jpg (30.2 KB, 8 views)
norjim12 is offline  
post #10 of 10 (permalink) Old 05-19-2017, 12:30 PM
SCOA Club
 
Rustedwrench's Avatar
 
Join Date: Jan 2012
Location: Northern Virginia
Posts: 1,587
Thanks: 16
Thanked 1,197 Times in 605 Posts
Mentioned: 3 Post(s)
Tagged: 0 Thread(s)
Quoted: 209 Post(s)
Quote:
Originally Posted by norjim12 View Post
Rustedwrench,
Just by chance, have you noticed if the voltage/fuel-level relation is inversely proportional? If so, I guess (probably, hopefully) I got something...
I suspect that is the case but I never had any reason to look. You could monitor the actual voltage at the DME connector pins to verify it. Pins 68 and 62, PNK and BRN/PNK. The DME is behind the right side interior panel in the cargo area, just ahead of where the access panel for the right rear lights is located. Click on the attachment to magnify it.
Attached Images
File Type: jpg smart fuel level sensor.jpg (197.9 KB, 7 views)
Rustedwrench is offline  
Reply

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the Smart Car Forums forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in









Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.



Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



  Similar Threads
Thread Thread Starter Forum Replies Last Post
fuel level gauge TRobinson6 smart Operation and Maintenance 6 03-19-2017 07:50 PM
Production of the VW Bus to end this December Stretchmobile The Car Lounge 3 09-23-2013 12:05 PM
Bus Driver vs. Snowman Miss Mercedes Off-Topic Cafe 31 12-17-2010 09:46 PM
Brain Bus darrelplant Pacific NorthWest Region 20 10-13-2008 04:18 PM
Will smart miss the bus on the Forfour SMART smart Forfour 5 06-25-2008 06:31 PM

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On