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

Arduino & BMW I/K Bus Interface – Messages

August 8, 2015. Written by ninja. Posted in Blog, BMW E46, E46 K-bus, Projects

** DRAFT Aug. 8th, 2015 **

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

Now that we’ve got our interface integrated to the car, we can either use NavCoder for message analysis, or our USB to TTL converter for debugging our Arduino interface coding.

As was discussed on the Technical Details page, the I/K-Bus packet structure looks like this:

1. Transmitter address (8 bit Source ID)
2. Length of data (number of following message bytes)
3. Receiver address (8 bit Destination ID)
4. Detailed description of message (maximum 32 bytes of data)
5. Summary of transmitted information (check sum)

The XOR checksum byte is used to check the integrity of the message. The receiver will compare that value with its own computation, and if not equal, will reject the packet.

 packet_structure

Below is an excel spreadsheet of various I/K-Bus messages and their descriptions.
I will eventually clean up and organize the spreadsheet into separate sections on this page for better readability. 

Multi-Function Steering Wheel (0x50):

Coming soon.

General Module V (0x3F):

Windows and Doors:

Lights:

Locks:

Coming soon.

Radio (0x68):

Coming soon.

Rain/Light Sensor (0xE8): 

The RLS (Rain/Light Sensor, 0xE8) sends a message to the LCM (Light Control Module, D0) once every 10 seconds. The message contains:

• Ambient Light Intensity
• Lights on/off command
• Reason for lights on command

Examples of RLS messages:

  RLS messages

Databytes explained:

  RLS databytes

  RLS databytes

CD Player (0x18):

Coming soon.

Instrument Cluster (0x80):

Coming soon.

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

Continue Reading 21 Comments

31 Jul2015

Arduino & BMW I/K Bus Interface – Schematic Descriptions

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

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

Below are the schematics for my Arduino & BMW I/K-Bus Interface that I created using Eagle PCB software – they are based on schematics from reslers’ interface as well as from Neiland, and with some help from ian332isport.

The TH3122 chip is an I/K-Bus Transceiver, which translates the +/- 12V K-Bus messages to/from +/- 5V TTL level serial messages.
The TTL level serial data can then be interfaced to either an Arduino/Teensy device, RS-232 (via MAX232 chip), or to USB (via CP2102 chip or a cheap commercial TTL to USB converter device).

Schematic:  TH3122 to ARDUINO UNO R3

Schematic TH3122 To ARDUINO

• K-Bus Line Input to TH3122
The BMW K-Bus wire passes through an RC filter and then connects to pin 6 (BUS) on TH3122.
The RC filter minimizes EMI on the BUS line, and is recommended per TH3122 datasheet.
The RC filter is a 10 ohm resistor and a 100pF non-polarized capacitor.

• Voltage Supply to TH3122
+12V supply voltage passes through a diode (D1), and connects to pin 1 (VS) which powers the TH3122.
The circuit has a 47uF capacitor on the +12V line to reduce short time voltage drops.

• Regulated Voltage from TH3122
VCC (Pin 16) provides the arduino with +5V; It is also connected to a 1uF capacitor (C5) to reduce short time voltage drops.
Capacitor C5 is suggested to be above 2uF in the TH3122 datasheet. I stuck with 1uF for flexibility (smaller variety of parts), due to the MAX232 datasheet specifying 1uF – for the RS232 interface.
Pin 2 (EN) enables the +5 Voltage regulator output on pin 16 (VCC).
We will use this in the arduino programming to shut down the arduino when there is no activity on the I/K-Bus after a certain time period. The TH3122 will automatically re-enable VCC (Pin 16) once it sees activity on the I/K-Bus – which will wake up our arduino.

• TTL Serial data to/from TH3122
Pin 11 (TX) is connected to the Arduino’s transmit pin.
Pin 10 (RX) is connected to the Arduino’s receive pin.
Pin 9 (SEN/STA) is connected to the Arduino’s digital input pin 3.
The SEN/STA signal stays High while there is data/activity on the K-Bus, and goes Low when there is no
activity. This is used in the Arduino programming to tell when it’s safe to send data onto the K-Bus.

• Misc
Pin 3 (VTR) is connected to VCC; It sets reset timing (See TH3122 Datasheet).
Pins 7 (SO) and 8 (SI) on the TH3122 can be used as a universal comparator.
We do not need this feature, so we ground pin 8 (SI), the comparator input.
Pins 14 (RESET) and 15 (SENSE) are not used for this project.
Pins 4, 5, 12, and 13 are all Grounds.

Optional debug schematic:

The Arduino programming includes optional debugging via Software Serial. This allows us to use a USB-TTL converter to monitor what the Arduino is seeing and doing. For the UNO R3 we use pins 7 (Rx) and 8 (Tx) for our Software Serial. Use your favorite serial monitoring software – I personally prefer PuTTy. See latest Arduino sketch code for more details (debug comments). Instructions on setting up the debug environment are available in the Operation and Testing section.

Schematic TH3122 To ARDUINO with Debug

 

Schematic: TH3122 to USB TTL Converter (for NavCoder testing)

Schematic TH3122 To USB TTL

Description coming soon.. 
Last updated… Nov 19th, 2017

Schematic: TH3122 to RS-232 Serial

Schematic TH3122 To RS232

Description coming soon.. 
Last updated… Nov 19th, 2017

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

Continue Reading 7 Comments

31 Jul2015

Arduino & BMW I/K Bus Interface – Resources & Downloads

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

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

Downloads for this project are all available on my Google Drive, embedded below.
If the widget below doesn’t work for you, the google drive link is:
https://drive.google.com/folderview?id=0B5ZYJFTIIk5mflpsTE1SbU9yNFBsdGZrX2NxS1JmdHdiVUhaOGNPaGEyM1dOdnJRQ1FtcFk&usp=sharing

⚠ Module cannot be rendered as the requested content is not (longer) accessible. Contact the administrator to get access.

File Mirrors:

Coming soon..

Useful Links:

  • BMW Wiring Diagrams

 

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

Continue Reading 1 Comment

31 Jul2015

Arduino & BMW I/K Bus Interface – Integration

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

** DRAFT Aug 8th, 2015**

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

There are several locations in a BMW E46 to tap into the K-Bus wiring. The three I will write about are:

• CD Changer connector – in Trunk
• Radio K-Bus wiring
• K-Bus terminal/junction block, above fuse box

CD Changer connector:

This is a great place for the Arduino interface as the connector provides a +12V wire, ground, and the K-Bus line.
The CD Changer is an optional unit on most cars, but the wiring is typically there even if you do no have the actual CD Changer.

The wiring is located in the trunk – drivers’ side, behind the trim.
The connector we’re interested in is designated as X18180 in the BMW Wiring Diagram System (WDS).
Remember: The K-Bus line is always White & Red with Yellow dots.

 Photos below:

bmw e46 arduino kbus trunk
bmw e46 arduino kbus trunk
bmw e46 arduino kbus cd changer
bmw e46 arduino kbus cd changer
bmw e46 arduino kbus integration
bmw e46 arduino kbus integration
bmw e46 arduino kbus radio test

Radio K-Bus wiring:

DIY coming soon.

K-Bus terminal block:

My personal favorite location to tap into the K-Bus. I plan to do a clean tap, using an OEM socket/contact and wire.
DIY coming soon.

Arduino Interface Integration:

Coming Soon.

Reslers’ Interface Integration:

Coming Soon.

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

Continue Reading 28 Comments

31 Jul2015

Arduino & BMW I/K Bus Interface – Programming

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

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

As I mentioned on the intro page of this project, I am not a software programmer – I am only familiar with web-based languages such as PHP, HTML, CSS, etc. For this reason I looked online for coding support, and stumbled upon a forum thread on the Arduino forums, created by ian332isport. He was essentially building the same type of interface using an Arduino. He sent me the base code I used to get started with my project – couldn’t have done it without him!

All of the project code is available on my BitBucket page, as well as on Google Drive (embedded below).
The older versions required modifications to the core of the Arduino IDE, and the use of an outdated IDE. The latest versions no longer require this, and use an I-Bus library.
Code descriptions:

  • v0.0.1 – alpha
  • v0.1.0 – beta

⚠ Module cannot be rendered as the requested content is not (longer) accessible. Contact the administrator to get access.

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

Continue Reading 5 Comments

  • 1
  • 2
  • 3
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