Curious-Ninja Logo
  • Home
  • Projects
    • Aviation
      • King Air Guides
    • BMW E46
      • K/I-Bus Interface
    • IT
      • UserLogos
  • Blog
  • About me
  • Contact
Curi0us Ninja Logo

Arduino & BMW K/I-Bus Interface

  • Project Table of Contents:
  • Intro
  • I/K-Bus Technical Details
  • Schematic Descriptions
  • Project Downloads
  • Arduino Programming
  • Vehicle Integration
  • Operation & Testing
  • I/B-Bus Messages
31 May2015

Arduino & BMW K/I-Bus Interface – Intro

May 31, 2015. Written by ninja. Posted in Blog, BMW E46, E46 K-bus, Projects

*** Project: Arduino & BMW K/I-Bus Interface ***

This project was born because I chose to do a simple task the hard way. I have a hard-wired radar detector in my E46 BMW – an Escort Redline. The wiring kit includes an alert LED which flashes whenever the radar detector picks up a police radar band. The LED was the perfect brightness during day time, but was a ridiculously bright eye sore in the night time. Instead of simply using a photo-resistor to solve this issue, I decided I wanted to use the already available light sensor in the car.

The Rain/Light Sensor is mounted on on the top center of the windshield. It’s purpose is to:

1) Detect rain on the windshield to automatically turn on the wipers and set a proper wiper speed
2) Detect ambient lighting to control automatic headlight operation

It turns out the Rain/Light Sensor is connected to the cars’ internal serial communications bus. This is when I discovered the world of the BMW I/K-Bus. 

The K-Bus is a standard bus protocol for automobile electronics. In other words, it is a way for devices within a car to communicate with each other. On the BMW, there are several devices on this bus. These include: 
• Radio  • MFW Steering wheel buttons • CD Changer  • Light Control Module  • etc

There are many possibilities when you are able to read and transmit on this bus. 

Some examples of what’s possible by reading and writing from/to the I/K-Bus:

• Read misc sensor data (speed, temperatures, RLS, etc), and perform actions based on the data
• Control the radio unit, air conditioning, windshield wipers, etc
• Write text to the instrument cluster or the radio LCD displays
• Open/Close windows, sunroof, and trunk either manually or automatically based on any inputs 
• Lock/Unlock doors either manually or automatically based on any inputs 
• Control interior and exterior lighting either manually or automatically based on any inputs 
• Control mirror and seat position (Including memory positions)
• Use inactive Multi-Function Steering wheel buttons for misc commands

The technical details of the bus can be found on the Technical Details page.

Planning the interface:

I decided to build my K-bus interface using an Arduino. For the record, I am not a software programmer. I’m only familiar with web based languages – PHP, HTML, CSS, etc. So i decided to take this opportunity to learn a bit of C++. 

Before we get started, I should mention that there are several K-bus interfaces out there that convert the bus to RS-232 serial. This allows you to connect the I/K-bus directly to a PC/Laptop and then use software such as NavCoder to read the bus communications. The software even allows you to send your own custom HEX messages – if you know what you’re doing. This setup is VERY helpful in decoding the bus messages that you’re interested in. The most popular interface to use is the “Rolf Resler” interface, found here. In the future I will make a write-up on how to wire up the resler interface to the K-bus wiring below the radio, and use it with NavCoder for debugging purposes.

To be able to read and transmit on the K-bus via an Arduino we will need to build an interface circuit to convert the +/- 12V bus signals into something the Arduino can understand (+/- 5V TTL levels). After some research, I have found several online articles where people have used transceiver chips such as the MCP2004, MCP2025, or the TH8080. Some had event built their entire interface circuit from basic transistors, not using a chip at all. 

I did quite a bit of research to be able to put this together – so keep in mind a lot of this info came from other users’ blogs and forums posts. I will list all my sources and give credit towards the bottom of this write-up. 

For my physical layer, I decided to go with the Melexis TH3122 transceiver IC. The chip connects to the the K-Bus, Ground, and the cars’ +12 volts and even outputs a regulated +5 volts to power other components (the Arduino!). It even has sleep/wake features, as well as a form of collision detection. The only drawback for the home hobbyist is that it only comes in a surface mount SOIC16 package. I was able to get a “SOIC to DIP” adaptor from digikey – more info on this in the Bill of Materials (BOM) below. 

It turns out the TH3122 isn’t too readily available – digikey does not carry this IC. I was able to buy a couple from eBay. 
Below is the schematic I created using Eagle PCB software – it is based on schematics from reslers’ interface as well as from Neiland, with some help from ian332isport.

 

Schematic TH3122 To ARDUINO

 

 The description of this circuit can be found here.

Putting things together:

Assuming you already own an Arduino (I used an UNO R3 replica, from 16Hertz), the Bill of Materials (BOM) is: 

 • Diode 1N4148    • Resistor 10 ohms    • Capacitors: 1uF 47uF 100pF    • Melexis TH3122 IC    • SOIC to 16DIP adaptor    • Small breadboard    • Breadboard wires    • USB to TTL serial converter (optional but recommended)

Tools/Equipment:

 • Soldering iron (for the TH3122 IC)

Links & details for Bill of Materials items are shown in the excel sheet below (Available in the resources & downloads section, “Physical Layer” folder).

I soldered the TH3122 onto my SOIC to 16DIP adaptor, then assembled the Arduino breadboard according to my schematic.

The USB to TTL converter is very useful for debugging I/K-Bus messages using software serial. I am using pins 7 and 8 on the arduino. FYI, the signals must be crossed – Tx on arduino to Rx on the converter. Pin 7 on the arduino will be Rx and 8 is Tx. You can use any serial monitor software for debugging – I personally prefer PuTTy.

Photos for reference:

arduino kbus bom
arduino kbus interface
arduino kbus interface
arduino kbus th
arduino kbus th3122

The next step is to program the Arduino..

 Project Continued:
• Intro
• Technical Details
• Schematic Description
• Resources & Downloads
• Programming
• Integration
• Messages

Sources & Credit:

I’d like to make a shout-out to ian332isport, from the Arduino forums, for the much needed support with coding the Arduino.
He provided the base program I started with when working on this project.
My other sources and links for this project are located in the resources & downloads section.

Sharing is caring 🙂 Share this page with your friends!
  • Total5
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Pinterest

Tags: arduino, bmw, bmw e46, bmw i-bus, bmw k-bus, diy, e46, electronics, k-bus, projects

Arduino & BMW K/I-Bus Interface

  • Project Table of Contents:
  • Intro
  • I/K-Bus Technical Details
  • Schematic Descriptions
  • Project Downloads
  • Arduino Programming
  • Vehicle Integration
  • Operation & Testing
  • I/B-Bus Messages
NEW POSTS
  • King Air quickGuides December 29, 2018
  • Arduino & BMW I/K Bus Interface – Operation & Testing November 19, 2017
  • Arduino & BMW I/K Bus Interface – Programming – v0.1.0 beta April 11, 2016
  • Arduino & BMW I/K Bus Interface – Programming – v0.0.1 alpha April 10, 2016
  • UserLogos & Fast Dial August 10, 2015
ARCHIVES
  • December 2018
  • November 2017
  • April 2016
  • August 2015
  • July 2015
  • May 2015
TAGS
arduino bmw bmw e46 bmw i-bus bmw k-bus c++ chrome communications c plus plus details diy downloads e46 electronics fast dial firefox i-bus integration k-bus messages navcoder programming projects schematic serial speed dial technical testing userlogos wiring
Built with HTML5 and CSS3 - Curious.Ninja
  • Home
  • Projects
    • Aviation
      • King Air Guides
    • BMW E46
      • K/I-Bus Interface
    • IT
      • UserLogos
  • Blog
  • About me
  • Contact