CanBus reading

K-Series Programmable ECU installation questions / support issues
Post Reply
barrym
Posts: 4
Joined: Wed May 23, 2018 8:42 pm

CanBus reading

Post by barrym »

Hopefully this is the right sub forum to ask this - I emailed support over 2 weeks ago but no reply yet...

i'm looking for some help with the canbus output I am sending to a custom dash ...

background data:
kPro4 on a Honda k20a2

sensor is a digital pressure sensor and displays correctly in kmanager.

reference data:
custom sensor configured in kmanager as pressure in psi
0.47v = 0 Bar
4.95v = 10.3Bar
sensor reads 0.6psi (0.04 bar) or 0.49v and is connected to analog 2 input

canbus:
Canbus is configured as hondata protocol @ 500 kbit.
connected on the canbus is an arduino uno with seedstudio canbus shield.


canbus sniffing results in 0x667 frameid, position byte 4 & 5 (analog 2) give me an integer of 1 and 143 respectively.

I am confused with the notes in help that report "Analog (16 bits) - voltage (volts) x 819.2"

taking the canbus values of (1+143) * 819.2 = 117964.8 - what does this number represent ?

the help notes don't speak of any offset values or any other math to reach 0.6 psi value or in bar???

OR does the kpro take the voltage of 0.49v then multiply by 819.2 and send 401.408 over the canbus in bytes 4 & 5?
but how would this translate to 0.6 psi ???

please could you provide more info / help ???

many thanks, Barry
Sydney, Australia
User avatar
Hondata
Site Admin
Posts: 10434
Joined: Thu Aug 15, 2002 12:13 pm
Location: Torrance, CA
Contact:

Re: CanBus reading

Post by Hondata »

The word value is 0x18F or 399. The conversion is voltage = value/819.2 = 0.49V
Hondata
barrym
Posts: 4
Joined: Wed May 23, 2018 8:42 pm

Re: CanBus reading

Post by barrym »

Ahhhh


Thanks, that makes more sense - I was treating 1+143 but understand now they are individual values .... for my own sanity and others....

1 int = 1 hex
143 int = 8F hex
18F hex to int = 399 then / by 819.2 = 0.49
Then need to convert to psi (using the map function : ) map(value, fromLow, fromHigh, toLow, toHigh) so:
map(0.49, 0.00, 5.00, 0, 200)

Cheers
barrym
Posts: 4
Joined: Wed May 23, 2018 8:42 pm

Re: CanBus reading

Post by barrym »

so, now that's all worked out - using arduino code as following gives me the relevant info ..

unsigned otInt = (rxBuf[4] << 8) | rxBuf[5];
int otV = otInt/819.2;
int otAct = map(otV, 0, 5, 0, 200);

where rxBuf[x] is the canbus place for oil temp - mash them together, get 399 & divide by 819.2 then map into, well that's the next question - what value does the hondata use to send info ..
for oil pressure, does it send bar ? for temp does it send in deg F or C ?
User avatar
Hondata
Site Admin
Posts: 10434
Joined: Thu Aug 15, 2002 12:13 pm
Location: Torrance, CA
Contact:

Re: CanBus reading

Post by Hondata »

Raw voltage for all of them.

Code: Select all

int otV = otInt/819.2;
Close enough...
Hondata
Kr4nG
Posts: 25
Joined: Sat Sep 15, 2018 9:25 pm

Re: CanBus reading

Post by Kr4nG »

Can the output of the can message id's be changed? I have a swapped 06 mini cooper k24 kpro4 and wanted to know if I could get my cluster to display the RPM. The cluster has can - and can + wires but I think the message ID for the RPM is 0x316 Byte 3. Any way to modify it?
therealkeeg
Posts: 4
Joined: Thu May 21, 2020 6:26 pm

Re: CanBus reading

Post by therealkeeg »

barrym wrote: Sat Jan 12, 2019 9:20 pm so, now that's all worked out - using arduino code as following gives me the relevant info ..

unsigned otInt = (rxBuf[4] << 8) | rxBuf[5];
int otV = otInt/819.2;
int otAct = map(otV, 0, 5, 0, 200);

where rxBuf[x] is the canbus place for oil temp - mash them together, get 399 & divide by 819.2 then map into, well that's the next question - what value does the hondata use to send info ..
for oil pressure, does it send bar ? for temp does it send in deg F or C ?
Hey would you be willing to share your arduino code? I have been trying to build a custom dash but i am a little stuck with the canbus communication.
Post Reply