LIN Bus
Local Interconnect Network is a low-cost, single-wire bus for simple sensors and actuators. Learn master/slave (commander/responder) operation, the frame (break, sync, protected ID, data, checksum), schedule tables, timing, LDF files and diagnostics.
Not every node needs CAN. Window switches, mirror motors, rain sensors, seat controls and ambient lights use LIN — a single wire at up to 20 kbit/s, cheap enough to put in every small module.
A master node decides who talks when, using a fixed schedule table, so LIN is deterministic and simple.
An analogy
LIN is like a classroom where only the teacher (master) asks questions in a fixed order, and each student (slave) answers only when called.
Bus basics
Single wire referenced to ground, 12 V levels, up to ~16 nodes, max 40 m, 1–20 kbit/s (typically 19.2 kbit/s). Very cheap transceivers; slaves can even use an RC oscillator because they resynchronise on each frame's sync byte.
Frame structure
The master sends the header: break (≥ 13 dominant bits), sync (0x55) and protected identifier. The node that owns that frame then sends 1–8 data bytes and a checksum (classic or enhanced including the PID).
Schedule tables
The master cycles through a fixed schedule, guaranteeing timing. Unconditional, event-triggered and sporadic frames give flexibility. Diagnostic frames (0x3C/0x3D) carry transport-layer messages for configuration and UDS.
Gateways and limits
LIN clusters hang off a CAN/Ethernet body controller acting as master and gateway. Low speed means long latencies — unsuitable for safety-critical or high-bandwidth functions. Auto-addressing and node configuration simplify identical modules (e.g. seat motors).
Formulas
- Nominal frame time:
T_frame,nom = (34 + 10(N + 1)) × T_bit - Maximum frame time:
T_frame,max = 1.4 × T_frame,nom - Schedule cycle:
T_cycle = Σ frame slots
Worked example: Frame time
Given: 19.2 kbit/s, 8 data bytes
Find: Nominal and maximum frame time.
- Bits = 34 + 10 × 9 = 124
- T_nom = 124/19 200 = 6.46 ms
- T_max = 1.4 × 6.46 = 9.04 ms
Answer: 6.5 ms nominal, slot ≥ 9.04 ms
Worked example: Schedule cycle
Given: Four 2-byte frames and two 8-byte frames
Find: Minimum schedule cycle.
- 2-byte frame: (34 + 30) × 1.4/19.2 = 4.67 ms → 5 ms slots
- 8-byte: 9.04 → 10 ms slots
- Cycle = 4 × 5 + 2 × 10 = 40 ms
Answer: ≈ 40 ms cycle
LDF excerpt
LIN_description_file;
LIN_protocol_version = "2.2";
LIN_speed = 19.2 kbps;
Nodes { Master: BCM, 5 ms, 0.1 ms; Slaves: MirrorL, MirrorR; }
Signals {
MirrorL_Cmd: 8, 0, BCM, MirrorL;
MirrorL_Pos: 16, 0, MirrorL, BCM;
}
Frames {
MirrorCmd: 0x10, BCM, 2 { MirrorL_Cmd, 0; }
MirrorStatus: 0x11, MirrorL, 2 { MirrorL_Pos, 0; }
}
Schedule_tables {
Normal { MirrorCmd delay 10 ms; MirrorStatus delay 10 ms; }
}The master (BCM) sends the header for each frame in the schedule; the publishing node supplies the response.
Common mistakes
- Wrong: Using LIN for time-critical functions. — Right: LIN is slow (ms) — use CAN or Ethernet for fast/safety data.
- Wrong: Schedule slots shorter than max frame time. — Right: Size slots ≥ 1.4 × nominal frame time.
Applications
- Body electronics: Mirrors, windows, seats, door modules, roof controls.
- Sensors: Rain/light sensors, battery sensors, steering-wheel switches.
- Ambient lighting: RGB LED modules addressed over LIN.
Key takeaways
- Single-wire, master/slave, ≤ 20 kbit/s.
- Header (break, sync, PID) + response (data, checksum).
- Deterministic schedule tables.
- Cheap body-electronics bus behind a CAN/Ethernet gateway.
Going further
- Enhanced checksum: Includes the PID for better error detection (LIN 2.x).
- Node auto-addressing: Bus-shunt methods assign addresses to identical slaves at start-up.
- SAE J2602: US variant of LIN with specific timing and diagnostics.