Other

项目介绍

projectsinmotion/Adding-Heated-and-Vented-Seat-Buttons 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 Other 许可证,目前获得 31 个 Star、2 次 Fork。

仓库全名
projectsinmotion/Adding-Heated-and-Vented-Seat-Buttons
开源许可证
Other
Star 数
31
Fork 数
2

README 摘要

LIN-CAN Gateway for Heated/Ventilated Seat Buttons Overview This project implements a bidirectional protocol gateway between LIN and CAN buses to integrate repurposed OEM heated/ventilated seat button modules into a 2020 Ram 1500. The gateway translates button presses from the LIN bus into CAN messages for the vehicle's Body Control Module (BCM), and translates heat/vent intensity and backlighting commands from the…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Adding-Heated-and-Vented-Seat-Buttons 用什么语言开发?

主要使用 C++ 编写,采用 Other 许可证,目前有 31 个 Star。

Adding-Heated-and-Vented-Seat-Buttons 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 Adding-Heated-and-Vented-Seat-Buttons 的源码?

可以直接克隆仓库:git clone https://github.com/projectsinmotion/Adding-Heated-and-Vented-Seat-Buttons.git,默认分支为 main;安装与运行步骤见仓库 README。

Adding-Heated-and-Vented-Seat-Buttons 最近还在维护吗?

仓库最近一次更新为 2025年12月12日,当前没有未关闭的 Issue;Star 数为 31,可作为社区活跃度的参考。

关于

Adding buttons to monitor and control the heat and vent functions of the front seats of a 2020 Ram 1500 using a LIN-CAN gateway

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
37
价值分
19
活跃状态
活跃

语言占比

Batchfile
C++
Python

README

LIN-CAN Gateway for Heated/Ventilated Seat Buttons

Overview

This project implements a bidirectional protocol gateway between LIN and CAN buses to integrate repurposed OEM heated/ventilated seat button modules into a 2020 Ram 1500. The gateway translates button presses from the LIN bus into CAN messages for the vehicle’s Body Control Module (BCM), and translates heat/vent intensity and backlighting commands from the CAN bus into LIN commands for the button module LEDs and backlighting.

Final Product: src/gateway/gateway.ino | Documentation

Demo Videos

Project Structure

├── src/                          # Source code
│   ├── gateway/                  # Final LIN-CAN gateway (production)
│   ├── BusSniffer/               # Bus capture tool for reverse engineering
│   └── test/                     # Test sketches for protocol validation
├── docs/                         # Documentation and analysis
│   ├── CAN_analysis/             # Python scripts for CAN protocol analysis
│   ├── LIN_analysis/             # Python scripts for LIN protocol analysis
│   └── references/               # Datasheets and connector terminations
├── HARDWARE.md                   # Hardware specifications and components
├── WIRING.md                     # Wiring diagrams and connections
├── MOUNTING.md                   # Enclosure and mounting information
├── METHODOLOGY.md                # Software development methodology and approach
└── README.md                     # This file

Hardware

Mounting

Wiring

Software Development

Required Libraries

Install these libraries via Arduino Library Manager:

Features

Gateway Functionality

  • LIN to CAN: Translates button presses to CAN events (ID 0x302)
  • CAN to LIN (LEDs): Translates heat/vent intensity commands (ID 0x31E) to button LED states
  • CAN to LIN (Backlight): Translates brightness commands (ID 0x2FA) to button backlighting
  • Button Debounce: 300ms debounce prevents multiple triggers
  • Diagnostic LED: RGB LED provides visual feedback for system state

Protocol Details

  • LIN Bus: 19,200 baud, LIN 2.0, 50Hz polling rate
  • CAN Bus: 125 kbps, normal mode (TX + RX)
  • Power Consumption: ~0.36W (0.03A @ 12V)
  • Security: WiFi and Bluetooth disabled

Getting Started

1. Hardware Setup

  1. Connect the ESP32 board to the vehicle’s CAN bus and 12V DC power via the center stack display screen connector C1
  2. Connect the LIN bus to the seat button modules (dedicated LIN bus with only ESP32 and button modules)

2. Arduino IDE Configuration

Select the following board settings:

  • Board: ESP32S3 Dev Module
  • USB CDC On Boot: Enabled
  • PSRAM: OPI PSRAM
  • Upload Mode: USB-OTG CDC (TinyUSB)

3. Upload Gateway Firmware

  1. Open src/gateway/gateway.ino
  2. Upload to the board
  3. Open Serial Monitor at 115,200 baud to view diagnostic messages

Pin Configuration

Function Pin Description
LIN TX 10 LIN transmit
LIN RX 3 LIN receive
LIN CS 46 LIN chip select (active high)
LIN FAULT 9 LIN fault detection
CAN TX 11 CAN transmit
CAN RX 12 CAN receive
LED R 39 Onboard red LED
LED G 38 Onboard green LED
LED B 40 Onboard blue LED

Message Translation

Button Press Translation (LIN → CAN)

LIN Event LIN ID LIN Data → CAN ID CAN Data
Driver Heat Press 0xC4 0x41, 0xFF → 0x302 [0, 2, 16, 0, 8, 0, 0, 0]
Driver Vent Press 0xC4 0x11, 0xFF → 0x302 [0, 2, 64, 0, 8, 0, 0, 0]
Passenger Heat Press 0x80 0x88, 0xFF → 0x302 [0, 2, 0, 4, 8, 0, 0, 0]
Passenger Vent Press 0x80 0xA0, 0xFF → 0x302 [0, 2, 0, 16, 8, 0, 0, 0]

Intensity Control Translation (CAN → LIN)

CAN ID 0x31E carries both driver (D0) and passenger (D1) states simultaneously:

Driver States (D0):

  • 0 = Off → LIN 0xB1: [0x0C, brightness]
  • 1-3 = Heat Low/Med/High → LIN 0xB1: [0x1C/0x2C/0x3C, brightness]
  • 4/8/12 = Vent Low/Med/High → LIN 0xB1: [0x4C/0x8C/0xCC, brightness]

Passenger States (D1):

  • 64 = Off → LIN 0x32: [0x09, brightness]
  • 65-67 = Heat Low/Med/High → LIN 0x32: [0x49/0x89/0xC9, brightness]
  • 68/72/76 = Vent Low/Med/High → LIN 0x32: [0x19/0x29/0x39, brightness]

Backlighting Translation (CAN → LIN)

CAN ID 0x2FA byte 2 (range: 0-200 decimal) is passed directly to LIN messages as the second byte.

Diagnostic LED Indicators

Color Meaning
Green Normal operation (idle)
Cyan flash CAN message received
Magenta flash Button press detected
Yellow Initialization in progress
Red Error state

Troubleshooting

No button detection

  • Verify LIN connections and CS pin (should be HIGH)
  • Check Serial Monitor for LIN polling activity

LEDs not responding to vehicle commands

  • Verify CAN bus connection and termination
  • Check Serial Monitor for CAN RX messages on IDs 0x31E and 0x2FA

CAN messages not sent

  • Check CAN bus initialization status
  • Verify CAN TX/RX pins and bus speed (125 kbps)

License

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

You are free to:

  • Share — copy and redistribute the material in any medium or format
  • Adapt — remix, transform, and build upon the material

Under the following terms:

  • Attribution — You must give appropriate credit
  • NonCommercial — You may not use the material for commercial purposes
  • ShareAlike — Derivatives must use the same license

See the LICENSE file for the full license text.

Acknowledgments

  • Georg Icking for the LIN_master_portable_Arduino library
  • sorek (handmade0octopus) for the ESP32-TWAI-CAN library
  • SK Pang Electronics for the ESP32-S3 CAN & LIN Bus Board
  • Claude Code (Anthropic) for development assistance

Author

Projects In Motion, 2025

评论

暂无评论