LIN to I/O module

Hello,

I’m working on a project to read out some LIN messages and use them the switch 5 relays. To make a PCB is not the problem. But to get the LIN message in to the Arduino software and let it make a output high is the hard part for me.

I look on the internet to find a simple example to make this but the only examples that I can find are LIN communications between a Arduino and a Arduino.

What I got here is a joystick from an Agriculture machine. The joystick is communicates on a LIN network.

With the program PLIN and a PCAN-USB Pro from Peak I read out the LIN bus and find that the functions where we are looking for are in the following messages:

ID 29h
Length 8 Bit
DATA 0F 7D 7D 11 17 07 00 9C

Every time when I press a button from the joystick and holt it the number in the data is jumping one number higher to a even number, when I release the button it will go one number higher to a odd number. He will continue dis till the reach the 7 and then will start over again at number 0.

So the numbers for button pressed is 0, 2, 4, 6
The numbers for button released is 1, 3, 5, 7

Al the buttons are in the same ID. We can find them in the next location:

Button 1: 0F 7D 7D 11 17 07 00 9C
Button 2: 0F 7D 7D 11 17 07 00 9C
Button 3: 0F 7D 7D 11 17 07 00 9C
Button 4: 0F 7D 7D 11 17 07 00 9C
Button 5: 0F 7D 7D 11 17 07 00 9C

The last thing is de status of the Joystick (ON or OFF). I want to use this message so the relays will not switch when the joystick is off. We can find this status in the next ID:

ID: 2Dh
Length: 1
DATA (Joystick ON): D4
DATA OFF (Joystick OFF): C1

I was thinking to us a Arduino NANO with a MCP2003 IC.
If there is somebody that can me help to get started with this project please let me know.
I also attached some screenshot to this topic.

Kind Regards,
Daan W

daanwillems: I was thinking to us a Arduino NANO with a MCP2003 IC.

using something like a Leonardo pro Micro or if you're not fussed about size even a MEGA would probably be better as they have additional hareware serial ports meaning you can still use the serial monitor for debugging purposed if you had to.

I made an library to that purpose that uses the hardware serial ports off the boards. have a look here: https://github.com/sherzaad/LIN

the example is one where I actually monitored/sniffed an actual LIN network.

hope that helps to give you a kick start! ;)

Thanks,

When I got it right, it is possible to use the MCP2003 directly on the Rx Tx with this library?

I still got a long way to go with programming ;).

daanwillems: Thanks,

When I got it right, it is possible to use the MCP2003 directly on the Rx Tx with this library?

I still got a long way to go with programming ;).

the Tx and Rx of the MCP2003 use TTL, so if you wire them up to the arduino as given in the application example of the datasheet you should be alright IMHO.

Good Luck!