### Author Topic: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)  (Read 63122 times)

0 Members and 1 Guest are viewing this topic.

#### morcibacsi

• Regular Contributor
• Posts: 67
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #50 on: January 13, 2016, 09:43:23 pm »
Actually I have one question. Maybe it's stupid but I want to be sure. At "climatisation 2" the file says: 4DC[3-4]:int: (X/10)-.40: temp evaporator. I have this packet: 4DCC800015ACF6FFFF32A4A  [3-4] is F6 = 246/10 = 24.6 - 0.4 = 24.2 So the final value is 24.2 Is this correct? And if yes where the heck that 0.4 come from? I mean it's so little that how was that figured out?

#### 406dany

• Contributor
• Posts: 17
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #51 on: January 15, 2016, 01:53:15 pm »
Hi

Not exactly ...
I write .40 for decimal notation and not hexadecimal (must be read as 40)
in 4DC C     80 00 15 AC F6 FFFF    32A4A
[3-4] is 0xACF6 so (44278/10)-40=4387.8°C  humm .... very very hot !

I think that there is a problem with 0xAC or with your gauge...

Actually in my car I have for [3-4]=0x0232 so (562/10)-40=16,2°C
(A.C. is off and this is the external température)

rgds

#### morcibacsi

• Regular Contributor
• Posts: 67
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #52 on: January 17, 2016, 07:51:16 pm »
Oh thanks for the explanation, I've misread something with the indexes. In the meantime I made some progress with my logfile player.

#### eneuro

• Super Contributor
• Posts: 1411
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #53 on: January 23, 2016, 09:19:01 pm »
I'm still working on this interface VAN
Me too
Back to electronics after a few weeks  holidays with fresh and new ideas ...

The good factor for RPM convert is 8 and not 10 so
824 -W- 18F80000000044   28BA NoAck
0x18F8=6392/8=799 rpm
0x0000=0/100= 0 km/h

Did you tried check with non zero velocity and verify that RPM & speed match at given gearbox 2nd, 3rd, 4th, etc?

Anyway, is it possible find on CAN/VAN in Peugeot cars something like wheels angle turn caused by driver manual steering wheel?

12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-

#### 406dany

• Contributor
• Posts: 17
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #54 on: January 24, 2016, 09:28:51 am »
Did you tried check with non zero velocity and verify that RPM & speed match at given gearbox 2nd, 3rd, 4th, etc?

these formula (RPM and speed) match well with my real dashboard
i haven't verify with the gearbox if speed= K x RPM

Anyway, is it possible find on CAN/VAN in Peugeot cars something like wheels angle turn caused by driver manual steering wheel?
I think this data (steering angle) can be found in the ABS/ESP module
this module have a Kline (iso 14230-4) on the OBD connector
but i don't think that this info is on Van bus body (perhasp on the other van bus)
i will try with PP2000 if i can see this angle directly from ABS/ESP module or from the COM2000 module

Actually I work on Kline ECU (EDC15C2) and i can get some info
(speed, rpm, water temp, air temp, fuel temp, boost pressure, accel position,flow injector, batt volts, ....)
and made a protocol converter (with PIC) for bluetooth adaptater to see data on my iphone with TorquePro.apk
but that need a big work to fine in the data frame ECU where are the good data and their encoding formula
(and i have burn my adaptater with 12v on 3.3v ! )
but this not the subject of this topic

rgds
« Last Edit: January 24, 2016, 09:31:17 am by 406dany »

#### eneuro

• Super Contributor
• Posts: 1411
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #55 on: January 24, 2016, 09:52:45 pm »
Anyway, is it possible find on CAN/VAN in Peugeot cars something like wheels angle turn caused by driver manual steering wheel?
I think this data (steering angle) can be found in the ABS/ESP module
this module have a Kline (iso 14230-4) on the OBD connector
but i don't think that this info is on Van bus body (perhasp on the other van bus)
Quick hack could be add... own steering wheel encoder-I mean I'd like to know this angle to show on HUD to help driver control car when we are lost on snow covered road and need quicly take control to do not land outside road
It is difficult to deal in such situation, unless one have racing team skils-when we do not feel wheels position relative to car body axis

This is another feature I want add to my custom car cruise controll system-including support for gegar changes based on mentioned link between chosen gearbox vehicle speed and its engine rpm speed...

Anyway, thanks for some hints, it might be helpfull
« Last Edit: January 24, 2016, 09:57:44 pm by eneuro »
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-

#### morcibacsi

• Regular Contributor
• Posts: 67
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #56 on: February 16, 2016, 07:43:53 pm »
I'm not sure if you're aware of it,  but you do not need to be in the car for VAN data logging. I just got a radio and a display from the scrap yard, and succesfully made a little VAN network from them on the bench. Of course this way I'm limited to the messages sent by the radio and display, but it's good for start. (and much cheaper if something goes wrong). I'm now struggling with a TSS463B VAN controller. I just can't get it how do I know if there is some data, and how to get it. I know you're experts at microcontrollers, please take a look at the datasheet and shed me some light, what should I look for? The datasheet is here: http://www.atmel.com/images/doc7601.pdf

#### eneuro

• Super Contributor
• Posts: 1411
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #57 on: February 19, 2016, 08:08:50 pm »
I'm not sure if you're aware of it,  but you do not need to be in the car for VAN data logging.
I do want detect events when engine RPM is not linked with vehicle speed and I'm more interested to do not interfere with car VAN (read only), so that is why I've made galvanic insulated interface USB <-> CAN/VAN bus

This is development version.
Of course I do not use FTDI-no thanks, but Silicon Labs ICs

12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-

#### 406dany

• Contributor
• Posts: 17
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #58 on: February 20, 2016, 06:25:33 pm »
Hi
I have made some tests ....
and i got these results for km/h=f(rpm)

Quote
tyre:215/55 R16
P=2*PI*r=2*PI*0.298(real)=1.872m
KM/H=RPM*60*RatioX*P/1000
Ratio5=0.4174
Ratio4=0.3189
Ratio3=0.2262
Ratio2=0.1423
Ratio1=0.0742
KM/H(5)=RPM*0.04688  ex:1961 tr/mn=92 km/h  datalogged=94 km/h
KM/H(4)=RPM*0.03582  ex:1960 tr/mn=70 km/h  datalogged=72 km/h
KM/H(3)=RPM*0.02541  ex:2577 tr/mn=65 km/h  datalogged=66 km/h
KM/H(2)=RPM*0.01598  ex:3122 tr/mn=50 km/h  datalogged=50 km/h
KM/H(1)=RPM*0.00833  ex:2123 tr/mn=17 km/h  datalogged=17 km/h

there is a little time between rpm logged and speed logged
so measure have to be get at stable speed or stable rpm
and not when clutch is "off" between gear change
An other problem is the tyre pressure and "state" witch change the lenght by turn

If you want to make an alarm for malfunction you have to put a delay time for bad ratio
and also an admissible delta (for tyre pressure)

rgds
« Last Edit: February 20, 2016, 06:35:47 pm by 406dany »

#### eneuro

• Super Contributor
• Posts: 1411
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #59 on: February 24, 2016, 08:43:34 pm »
In the case of gearbox in 1.4 HDI those Peugeot specs looks good when tested link between speed/rpm with realtime data

Anyway, probably car knows nothing about tyre pressure, so it can be calibrated by real measurement of average speed of given few hundred meters distance divided by real clock time in comparision to averaging of speed data read directly from car VAN/CAN bus
« Last Edit: February 24, 2016, 08:45:19 pm by eneuro »
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-

#### nesc76

• Newbie
• Posts: 3
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #60 on: March 21, 2016, 03:34:25 am »
Hi, just registered to this site due to this amazing thread.

I have a Citroen C3 2004 thats part of a project (ev conversion). One of the missing parts is some data we can get from the VANBUS only but we are  struggling to get to it. You guys seems to have nailed it.

I read the thread, and saw some of the PCBs and schematics from the youtube video. But it seems to me the latest prototype is based on attyne85 without much processing, basically dumping the VAN data into a serial or usb/serial. Thats exactly what we were looking for (the car has a Raspberry Pi onboard that would be used to actually decode/store the VAN bus messages).

Would it be possible to share the latest schematics? Not sure how hard it is to acquire the components, but willing to give it a shot.

I'am more than willing to help test and decode messages as well. Lexia is available (my idea is to send codes through Lexia and see what is dumped in the serial line from this circuit to help decoding).

Thanks very much for your amazing work.

#### 406dany

• Contributor
• Posts: 17
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #61 on: March 21, 2016, 06:50:05 am »
hi
you can't take VAN bus data directly on serial/usb
the major problem is the E-manchester bit and the start/end frame format
you need to add a converter VAN bus <-> serial standard (i use a pic18F2620)
of course you need also a level adaptator RS485 <-> serial RS232 or serial TTL
you can take all informations on Graham site
rgds

#### morcibacsi

• Regular Contributor
• Posts: 67
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #62 on: March 21, 2016, 11:51:34 am »
I said earlier that I built my circuit using TSS463 VAN controller. Unfortunately using the display and radio on bench I only get IDEN 8C4, no other display or radio related IDEN (4D4, 554, 5E4 or 984) shows up. I have no idea what is wrong, so I'm stuck with the project for now

#### nesc76

• Newbie
• Posts: 3
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #63 on: March 22, 2016, 01:44:02 am »
hi
you can't take VAN bus data directly on serial/usb

Sorry, I think I didnt express myself correctly.

My idea is to have a microcontroler (I tought a simple arduino initially) to talk to vanbus trough a MCP2551 chip. The arduino would get the VAN messages and send the messages to a linux computer trough USB Serial (a simple serial.pringln on the CAN message received). The linux computer would just keep reading from serial and processing/storing.

I thought, based on post #40 by eneuro that thats what was being done.

Unfortunately, I could not understand the designs in the youtube video posts enough to build one (I just scratch the surface with electronics, some basic arduino projects). Will give it another shot.

Thanks!

Edit: Looking at your VAN bus circuit and the USBRS232 cable, it would do exactly what I'am trying to achieve as well, but I have no idea how to use the the PIC18F2620. Arduino is as far as I can go at this point.
« Last Edit: March 22, 2016, 02:07:30 am by nesc76 »

#### 406dany

• Contributor
• Posts: 17
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #64 on: March 22, 2016, 04:07:38 am »
Unfortunately using the display and radio on bench

If i well anderstand you have no BSI on your experimental van bus ...
BSI is master on a lot of frames
On van bus it is very difficult to identify who is the sender and who is the receiver...
so you have to try on a real car

#### 406dany

• Contributor
• Posts: 17
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #65 on: March 22, 2016, 04:18:23 am »

My idea is to have a microcontroler (I tought a simple arduino initially) to talk to vanbus trough a MCP2551 chip. The arduino would get the VAN messages and send the messages to a linux computer trough USB Serial (a simple serial.pringln on the CAN message received). The linux computer would just keep reading from serial and processing/storing.

Ah ok...
it's possible if you can generate with arduino I/O signal about 4µs with processing the other data
(sending, parsing, checksum ...)
4µs is the lower base time for van bus
you have to be quick in your subroutine...

#### morcibacsi

• Regular Contributor
• Posts: 67
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #66 on: March 22, 2016, 09:32:02 am »
hi
you can't take VAN bus data directly on serial/usb

Sorry, I think I didnt express myself correctly.

My idea is to have a microcontroler (I tought a simple arduino initially) to talk to vanbus trough a MCP2551 chip. The arduino would get the VAN messages and send the messages to a linux computer trough USB Serial (a simple serial.pringln on the CAN message received). The linux computer would just keep reading from serial and processing/storing.

I thought, based on post #40 by eneuro that thats what was being done.

Unfortunately, I could not understand the designs in the youtube video posts enough to build one (I just scratch the surface with electronics, some basic arduino projects). Will give it another shot.

Thanks!

Edit: Looking at your VAN bus circuit and the USBRS232 cable, it would do exactly what I'am trying to achieve as well, but I have no idea how to use the the PIC18F2620. Arduino is as far as I can go at this point.

Hi maybe this would be useful to you: https://gist.github.com/projectgus/307053

#### nesc76

• Newbie
• Posts: 3
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #67 on: March 22, 2016, 11:33:50 am »
4µs is the lower base time for van bus
you have to be quick in your subroutine...

I wasn't aware I could be close to arduino processing speed.... Maybe I should go to another approach.

Hi maybe this would be useful to you: https://gist.github.com/projectgus/307053

Thanks Morcibacsi,

Yes, it gives me some direction to go if I keep going to the Arduino route.

Anyway, I ordered some components based on this thread (a TSS463C, a PIC18F2620 and a MCP2551). I'am trying to find a MTC-3051 as in the Youtube post as well. I guess I will also need a programer for the PIC.

This way I can try to replicate some of the ideas in this thread.

Thanks again for all the help.

#### eneuro

• Super Contributor
• Posts: 1411
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #68 on: March 30, 2016, 05:28:01 pm »
The linux computer would just keep reading from serial and processing/storing.

Yep, but I'd rather use ATTiny85 at 16MHz to process data taken from MCPXXX CAN/VAN and send parsed data to PC via USB (I2C on demand)-not raw dump from MCPXXX itself.
Upgrading now to galvanic insulated PSU powered from USB port, so no need to mess with automotive PSUs designs,etc.
Just sending for prototyping new version-I found it too difficult to manufacture at home, so I will have to wait a few days to have them in my hand for testing
I will let know how new design it works in practice
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-

#### morcibacsi

• Regular Contributor
• Posts: 67
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #69 on: April 10, 2016, 05:52:27 pm »
I'm playing with the captures, but I don't understand something. I capture data like this:

8C 41 8C 8A 42 01 12 12
8C 41 83 8A 42 01 12 12
8C 41 83 8A 42 41 81 34
8C 41 83 8A 44 40 AF 5C
8C 41 8C 8A 20 40 4F B8
8C 41 83 8A 20 40 4F B8

I tried to check their CRC with the checker on Graham's page. They all failed, because somehow he got data with his logger a little bit different:

My data            : 8C 41 8C 8A 42 01 12 12 translates to Grahams data like this:
Grahams data  : 8C 4    C 8A 42 01 12 12

So if I remove some numbers, the CRC check is fine. It took me some time to figure this out.

However there are lines like this:

8C 41 83 8A 42 01 12 12  --- if i check this with the upper method (removing the 1 and 8 from it the check fails), but let me add the previous line under it:
8C 41 8C 8A 42 01 12 12  --- the lines are almost identical except that 3 turned to C but the CRC at the end is the same... of course it will not match.

I don't get it why does this happen.

#### sergio04

• Newbie
• Posts: 1
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #70 on: February 06, 2017, 03:57:55 pm »
Hello everyone.

I'm new in this forum. I try to read the vanbus in my car. I want to use the steering wheel remote of mi car in my new sony radio. I try to use arduino with a mcp2551 in rx line and the scketh of this link: https://gist.github.com/projectgus/307053. Someone use arduino to read the vanbus? Thank you.

#### morcibacsi

• Regular Contributor
• Posts: 67
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #71 on: March 23, 2019, 09:05:42 am »
Sorry for reviving this old thread, but maybe there is still somebody out there who is trying to fiddle with the VAN bus. I created a library for ESP32 to read the VAN bus, which can be found here: https://github.com/morcibacsi/esp32_rmt_van_rx. And also created an analyzer for Saleae Logic: https://github.com/morcibacsi/VanAnalyzer Have fun using them

#### Vailfire

• Newbie
• Posts: 1
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #72 on: April 14, 2019, 01:54:07 pm »
Hi there!

I'm new here and quite happy that there is still activity on this thread. I'm trying to interfere with my Peugeot 206 VAN-Bus to build a CD-Changer emulator.

Currently I'm focusing on two approaches:
1) An Arduino Nano + cheap CAN module I've lying around (MCP2515 + TJA1050) - But I don't know whether I can address directly the TJA to handle the special protocol with E-manchester bits
2) Or I might use my STM32F103 with integrated CAN pins

@morcibacsi I'm very confident that I can learn a lot from your library for the ESP32! Hopefully, I only need to send this VAN packet in order to activate the AUX input of my Siemens RD3:

Code: [Select]
4EC CDC TRACK INFO (display ask CDC)(8x......8x : header and footer)4EC AR- 8X 00 C1 16 01 22 17 01 21 00 3F 8X   (reply in frame)4EC[1]:0x01:bit: :  random track play4EC[2]: 0x41 = OFF, 0xC1 = Powered on and standing by (paused), 0xD3 = "Busy" (Time = 0xFFFF)         0xC3 = Playing, 0xC4 = fast forward, 0xC5 = fast rewind4EC[3]: Either 0x06 (no cartridge) or 0x164EC[4]:bcd: : track time (m)(0xFF when changing track or play mode)4EC[5]:bcd: : track time (s)(0xFF when changing track or play mode)4EC[6]:bcd: : current track (0xFF if no cartridge)4EC[7]:bcd: : cd number     (0xFF if no cartridge)4EC[8]:bcd: : track count   (0xFF if no cartridge ?)4EC[9]:0xXX : ? =0x004EC[10]:0x3F:bit : 0x00 (no cartridge) or 0xXX: cd present bit - (VAN Frames_.txt)

#### morcibacsi

• Regular Contributor
• Posts: 67
• Country:
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #73 on: April 17, 2019, 08:59:18 pm »
I have some code and schematics to write to the VAN bus using Arduino (Pro mini) + Atmel TSS463C VAN controller + AMIS REMQ VAN transceiver, which also kind of works for reading. I'll try to find some time to post those on github in the near future. (but for reading the ESP32 library I uploaded is more reliable. ) For what you would like to achieve (writing the bus) I would go with this solution as these circuits have built in mechanisms to find the timings when to write the bus to avoid collision with other messages floating around. Writing that kind of code in software is maybe not the easiest thing. Actually writing the VAN bus with an ESP32 is on my TODO list, but most propably it won't happen in the near future, as I am busy with some other stuff.

Another thing I would also consider if I were you (actually I already considered and I'm working on it )... Is to replace the old RD3 unit with an RD4 or RD43 or RD45 unit from newer Peugeots. Those units are capable of playing mp3 from CDs and USB, and the RD45 also supports bluetooth. Of course those require a CAN bus connection even for boot up, but it is quite an interesting project to emulate a BSI and send the proper messages to have those units working inside a car with a VAN bus.

EDIT: An early prototype has been created. It still needs some polishining, but seems to work:

« Last Edit: April 22, 2019, 06:42:16 am by morcibacsi »

The following users thanked this post: Vailfire

#### yvesdm3000

• Contributor
• Posts: 6
##### Re: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)
« Reply #74 on: May 05, 2019, 09:11:50 am »
Hi morcibacsi,

Is this emulation code available somewhere ?

Yves

Smf