| Author |
Message |
CAN-Diagnose Administrator


Joined: 06/07/2011 Posts: 573 Karma: +29 / -0 Location: Ländle
|
10-07-2017, 20:49 Subject: |
Quote |
|
@ Dr4g0n : Who are you referring to? In my car, the distance traveled is reported on the CAN bus in multiples of 10 meters, and the total mileage is reported in full kilometers.
Best regards, Rainer.
Translated on 03-07-2026, 15:19.
|
|
| Back to top |
Profile PM WWW |
 |
wernernue
Joined: 03/02/2016 Posts: 27 Karma: +10 / -0 Location: Nürnberg
Premium Support
|
10-07-2017, 21:24 Subject: |
Quote |
|
Yes, as far as I can tell from this quick estimate, it was dm, which is 0.1 meters.
I read the value every 15 seconds and add the difference to a variable.
And if the new value is smaller than the old value, meaning the counter restarts at zero, you need to add the maximum value to the new value *before* calculating the difference.
Best regards,
Werner.
Translated on 03-07-2026, 15:19.
|
|
| Back to top |
Profile PM |
 |
Dr4g0n
Joined: 06/10/2017 Posts: 4 Karma: +0 / -0
Free account, no CAN development support
|
10-07-2017, 21:37 Subject: |
Quote |
|
With the formula from you, Wernernue.
text
CurrentStrecke = Byte_0x5A0_5 + (Byte_0x5A0_6 & 0x3) * 256;
It seems like the measurement is in centimeters, and the value resets to zero after reaching 2048. Since I'm traveling at approximately 200 km/h (55 m/s), I need to read the value more frequently.
I'm adding the difference to the previous value and storing it in a temporary variable. Once the value exceeds 100, the meter counter will increment by one.
"I'm getting an approximate 50% deviation. The car's speedometer shows 1 km, the phone shows 1.05 km, and the Arduino shows 0.5 km."
Translated on 03-07-2026, 15:19.
|
|
| Back to top |
Profile PM |
 |
wernernue
Joined: 03/02/2016 Posts: 27 Karma: +10 / -0 Location: Nürnberg
Premium Support
CAN-Diagnose likes this. |
11-07-2017, 22:23 Subject: |
Quote |
|
I should have checked first before writing here Code: |
if (rxId==0x5A0) //0x5A0 Geschwindigkeit vom ABS
{
Byte_0x5A0_1=rxBuf[1];
Byte_0x5A0_2=rxBuf[2];
Byte_0x5A0_5=rxBuf[5];
Byte_0x5A0_6=rxBuf[6];
Kmh=(Byte_0x5A0_2*256+Byte_0x5A0_1)/152;
CurrentStrecke=Byte_0x5A0_5 + (Byte_0x5A0_6 & B00000111)*256;
}
| .
Code: |
if (CurrentStrecke<LastStrecke) {Str=CurrentStrecke+0x0800-LastStrecke;} else {Str=CurrentStrecke-LastStrecke;}
LastStrecke = CurrentStrecke;
kms=kms + Str*0.20; //kms in Dezimetern
|
So, those two bytes contain the distance traveled value.
And the distance is calculated every half-second using this formula:
The mileage displayed on the built-in onboard computer is quite accurate, being about 4% lower, but since the speedometer tends to run slightly fast, the actual mileage is probably quite close.
I hope you manage to get that sorted out.
Regards,
Werner.
Translated on 03-07-2026, 15:19.
|
|
| Back to top |
Profile PM |
 |
WernerW
Joined: 10/23/2023 Posts: 2 Karma: +1 / -0
Free account, no CAN development support
CAN-Diagnose likes this. |
24-10-2023, 17:16 Subject: Water temperature display |
Quote |
|
Cool post!
I also have a Polo instrument cluster on the table, specifically a Polo 6N0920. I'm trying to move the water temperature gauge. Do you have any idea how to do that?
I've managed to get the RPM and km/h indicators working.
Translated on 03-07-2026, 15:19.
|
|
| Back to top |
Profile PM |
 |
wernernue
Joined: 03/02/2016 Posts: 27 Karma: +10 / -0 Location: Nürnberg
Premium Support
|
26-10-2023, 21:04 Subject: Water temperature display |
Quote |
|
Hello Werner,
Yes,  this project was fun.
According to the wiring diagram, this signal should originate from the temperature sensor G32, located in the lower left corner of the image, and connect to pin 22 of the 32-pin connector on the instrument cluster.
If I remember correctly, the coolant sensor has 4 connections, and it contains 2 sensors inside; the other one connects to the engine control unit.
Unfortunately, I can't quickly check right now whether the PIN is already assigned to my account. It's also possible, depending on the equipment, that the information is transmitted via the CAN bus, and the engine control unit generates the corresponding CAN signal.
| Description: |
|
| File size: |
203.19 KB |
| Viewed: |
275 times |

|
Translated on 03-07-2026, 15:19.
|
|
| Back to top |
Profile PM |
 |
WernerW
Joined: 10/23/2023 Posts: 2 Karma: +1 / -0
Free account, no CAN development support
|
28-10-2023, 14:53 Subject: |
Quote |
|
Thank you for your information.
For the KI Polo 6N0920, I use an Arduino Nano V3 and an MCP2515 for control. The RPM, ABS, and airbag data are received via the CAN bus. The Arduino determines the speed using square wave pulses. The fuel gauge is implemented using PWM (Pulse Width Modulation).
I'm just unable to get the coolant temperature display to work. The pin you mentioned is labeled with the low coolant warning indicator on my device.
With various resistance values connected to the mass terminal, no display was visible. Can the temperature data also be provided via the CAN bus? I once sent values to ID 0x288, byte 1, but unfortunately, there was no display.
Are there perhaps other IDs?
Best regards, Werner.
Translated on 03-07-2026, 15:19.
|
|
| Back to top |
Profile PM |
 |
Busschrauber
Joined: 05/21/2026 Posts: 3 Karma: +0 / -0
Free account, no CAN development support
|
22-05-2026, 20:10 Subject: |
Quote |
|
Hi, great project.
I have a 2005 Polo with 54 horsepower, and I want to see the fuel consumption displayed.
Do I need the speed to calculate something, or is it enough to just display the consumption?
Thank you for your help.
Translated on 03-07-2026, 15:19.
|
|
| Back to top |
Profile PM |
 |
Busschrauber
Joined: 05/21/2026 Posts: 3 Karma: +0 / -0
Free account, no CAN development support
|
30-05-2026, 7:10 Subject: |
Quote |
|
HI,
I once used code from wernernue.
Unfortunately, the consumption per hour is not a meaningful value for me.
What's the easiest way to convert this?
Greetings.
Translated on 03-07-2026, 15:19.
|
|
| Back to top |
Profile PM |
 |
|