Arduino lin bus analyzer
Copy raw contents
Arduino LINBUS Analyzer
The Arduino Linbus analyzer is a small Arduino based board that connects to a LIN bus on one end and to a computer USB port on the other. The Analyzer decods the frames on the LIN bus and send them to the computer as human readable text over virtual serial port (115.2kbs, 8 data bit, 1 start bit, 1 stop bit, no parity).
The board has two 3 pin LIN bus parallel connections such that one can be connected to the master and the other to the slave. The USB/Serial port is FTDI based and should be compatible with Mac OSX, Linux and Windows.
The USB/Serial port is also compatible with the Arduino IDE (emulating an Arduino Mini Pro 16Mhz 5V with Atmega328p) which can be used to edit/compile/download software updates.
The output of the analyzer can be viewed directly with a terminal emulation software or using the provided script that ads timestamp and bit by bit diff capabilities (see .
The analyzer is hard coded to decode buss signals at 19,200bps and LIN bus enhanced checksum (V2). This can change in the source code (use the Arduino IDE) and downloaded to the Analyzer.
Connectors
J1 — LIN bus connection to the master.
J2 — LIN bus connection to the slave (connected 1:1 to J1)
J3 — FTDI Serial over USB connection to the computer.
J4 — Master mode jumper. Not used. Leave opened.
J5 — ICSP port. Used for one time programming of the Arduino bootloader in production.
LED indicators
D5 — Errors LED. Blinks when the analyzer detects LIN bus errors.
D6 — Frame LED, blinks when valid LIN bus frames are detected. Also blinks slow in idle state to indicates that the board is alive.
D7 — Power indicator. On when the board is powered, from the LIN bus or from the USB port.
zapta/linbus
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
ARDUINO LINBUS GADGETS
An Arduino based LINBUS stack that allow to explore and hack linbus based system.
Unless specified otherwise, the PCBs can be used with standard Aruduino IDE, behaving as Arduino Pro Mini 5V 16Mhz with ATMEGA328.
**Analyzer** — a small PCB that connects on one hand to linbus and to a computer USB port on the other. The analyzer decode all the linbus frames and dump them to the computer. The USB connection emulates a serial port using a builtin FTDI adapter and can be read with standard serial application. A special python script is provided in the tools directory to dump the serial data in diff mode such that only changed bits are displayed. The board design support also linbus TX which allow to have this board functioning as a linbus master or slave (this however requires firmware changes).
**Beeper** — a small PCB and firmware that monitors a linbus and activates a buzzer when certain conditions met. The provided firmware includes a car specific example that beeps when the reverse gear in my car is engaged. The car specific logic is in the car_module* files and can be adapted to different applications.
**Injector** — a small PCB board with two linbus interfaces that connects in series between a linbus master and a linbus slave. The injector looks as a slave to the master and as a master to slave and it transparantly proxying LIN frame between the. At the same time, it can monitor bus signals, apply application spefici logic and can inject signals back to the bus by modifying on the fly LIN frames it proxys between the master and the slave. The Injector was developed to modiy the behavior of existing LIN bus based system (e.g. automatic activation of the Sport mode in my car).
**Feature Comparison**
Feature | Analyzer | Beeper | Injector |
---|---|---|---|
Max LIN speed | 20kps | 20kps | 20kps |
Min LIN speed | 1kps | 1kps | 1kps |
Operating voltage | 12V | 12V | 12V |
Max voltage | 40V | 40V | 40V |
LIN frame dump/log | Yes | Yes | Yes |
LIN checksums | V1/V2 | V1/V2 | V1/V2 |
Computer serial interface | FTDI/USB | Serial 5V | Serial 5V |
Computer serial speed | 115,200 | 115,200 | 115,200 |
Audible output | No | Yes | No |
LIN signal interception | Yes | Yes | Yes |
LIN signal injection | No | No | Yes |
Arduino IDE compatible | Yes | Yes | Yes |
Programming language | C/C++ | C/C++ | C/C++ |
MCU | ATMEGA328P | ATMEGA328P | ATMEGA328P |
MCU speed | 16Mhz | 16Mhz | 16Mhz |
Schematic/Layout software | Cadsoft Eagle | Cadsoft Eagle | Cadsoft Eagle |
PCB Size (inches) | 1.3 x 1.5 | 1.15 x 1.6 | 1.31 x 1.44 |
PCB layers | 2 | 2 | 2 |
Component mounting | SMD | SMD | SMD |
Min component size | 0805 | 0805 | 0805 |
OSHPark compatible | Yes | Yes | Yes |
About
An Arduino based LINBUS stack and signal interceptor/injector.
Arduino lin bus analyzer
Copy raw contents
Library and examples for LIN (Local Interconnect Network) on Arduino. Developed for the Macchina M2. Can be modified for any Arduino board with UART available and any LIN slave.
- Download the files
- Move the folder LIN to your Arduino Libraries
Several example sketches are included in the LIN Library to demonstrate typical usage:
Lin2Lin M2 acts as the Sniffer – when traffic on one LIN channel is detected, incoming data is saved and then sent to another LIN channel with no modification. Arduino Due with simple 1-bit ADC is used as Master Node on first LIN bus and Ambient Light Module is used as a slave on another LIN bus.
Master works with Microchip’s Ambient Light Module. User builds an array of bytes, which is the length of the message and contains packages to be send to the module. Package is built out of Control Byte (control intensity, dim and ramp functions for the RGB LED), Red, Green and Blue Color Bytes and Zone Byte. Checksum calculation is supported in v2.0 library. There is no need to calculate checksum and include in it package.
Slave M2 acts like sniffer: when traffic is detected on LIN bus, incoming data is saved and processed. Arduino Due with simple 1-bit ADC is used as master. Master Node needs to be programmed with Master example Slave_Master
Data processing: If Identification Byte is correct, Checksum Byte is compared with Checksum calculated from received data. If Checksum Byte is correct, data is printed on Serial Monitor via SerialUSB. Otherwise error is printed on Serial Monitor and data cleared.
- Sniffer M2 monitors traffic on LIN bus periodically. When traffic is detected, Sniffer reads incoming data and prints it on Serial Monitor via SerialUSB.
LIN Stack was developed using the following:
Microchip’s Interior Ambient Lighting Module with LIN Interface User Guide http://ww1.microchip.com/downloads/en/DeviceDoc/51714a.pdf
More information about LIN can be found in those documents.
matt2005/LIN-1
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
This branch is not ahead of the upstream macchina:master.
No new commits yet. Enjoy your day!
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Library and examples for LIN (Local Interconnect Network) on Arduino. Developed for the Macchina M2. Can be modified for any Arduino board with UART available and any LIN slave.
- Download the files
- Move the folder LIN to your Arduino Libraries
Several example sketches are included in the LIN Library to demonstrate typical usage:
Lin2Lin M2 acts as the Sniffer – when traffic on one LIN channel is detected, incoming data is saved and then sent to another LIN channel with no modification. Arduino Due with simple 1-bit ADC is used as Master Node on first LIN bus and Ambient Light Module is used as a slave on another LIN bus.
Master works with Microchip’s Ambient Light Module. User builds an array of bytes, which is the length of the message and contains packages to be send to the module. Package is built out of Control Byte (control intensity, dim and ramp functions for the RGB LED), Red, Green and Blue Color Bytes and Zone Byte. Checksum calculation is supported in v2.0 library. There is no need to calculate checksum and include in it package.
Slave M2 acts like sniffer: when traffic is detected on LIN bus, incoming data is saved and processed. Arduino Due with simple 1-bit ADC is used as master. Master Node needs to be programmed with Master example Slave_Master
Data processing: If Identification Byte is correct, Checksum Byte is compared with Checksum calculated from received data. If Checksum Byte is correct, data is printed on Serial Monitor via SerialUSB. Otherwise error is printed on Serial Monitor and data cleared.
- Sniffer M2 monitors traffic on LIN bus periodically. When traffic is detected, Sniffer reads incoming data and prints it on Serial Monitor via SerialUSB.
LIN Stack was developed using the following:
Microchip’s Interior Ambient Lighting Module with LIN Interface User Guide http://ww1.microchip.com/downloads/en/DeviceDoc/51714a.pdf
More information about LIN can be found in those documents.
About
Arduino library to add LIN support to the Arduino Nano board using a MCP2025 LIN transceiver
macchina/LIN
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Library and examples for LIN (Local Interconnect Network) on Arduino. Developed for the Macchina M2. Can be modified for any Arduino board with UART available and any LIN slave.
- Download the files
- Move the folder LIN to your Arduino Libraries
Several example sketches are included in the LIN Library to demonstrate typical usage:
Lin2Lin M2 acts as the Sniffer – when traffic on one LIN channel is detected, incoming data is saved and then sent to another LIN channel with no modification. Arduino Due with simple 1-bit ADC is used as Master Node on first LIN bus and Ambient Light Module is used as a slave on another LIN bus.
Master works with Microchip’s Ambient Light Module. User builds an array of bytes, which is the length of the message and contains packages to be send to the module. Package is built out of Control Byte (control intensity, dim and ramp functions for the RGB LED), Red, Green and Blue Color Bytes and Zone Byte. Checksum calculation is supported in v2.0 library. There is no need to calculate checksum and include in it package.
Slave M2 acts like sniffer: when traffic is detected on LIN bus, incoming data is saved and processed. Arduino Due with simple 1-bit ADC is used as master. Master Node needs to be programmed with Master example Slave_Master
Data processing: If Identification Byte is correct, Checksum Byte is compared with Checksum calculated from received data. If Checksum Byte is correct, data is printed on Serial Monitor via SerialUSB. Otherwise error is printed on Serial Monitor and data cleared.
- Sniffer M2 monitors traffic on LIN bus periodically. When traffic is detected, Sniffer reads incoming data and prints it on Serial Monitor via SerialUSB.
LIN Stack was developed using the following:
Microchip’s Interior Ambient Lighting Module with LIN Interface User Guide http://ww1.microchip.com/downloads/en/DeviceDoc/51714a.pdf
More information about LIN can be found in those documents.
- correct checksum calculation, removed +1
- inserted parity calculation in writeRequest method
- implemented parity calculation
- implemented bus wake up for proper lin bus waking up
- Changed default baudrate to 19200 which is more common in automotive applications
About
Arduino library to add dual LIN support on SAM3X based boards with a TJA1021/TJA1027 transceiver