# My Can bus Gauge solution. (BMW)



## kennybobby (Aug 10, 2012)

*reverse engineering*

Thanks for sharing the results of your hard work on the CAN bus, esp hex codes...


----------



## Thaniel (May 25, 2008)

*Re: reverse engineering*



kennybobby said:


> Thanks for sharing the results of your hard work on the CAN bus, esp hex codes...


Sure. To me sharing information is what forums are all about. 

I still remember the first time I used the web to find a solution to an electrical problem in my car (was in the '90's). Was amazing to see that someone smart figured it out and the fact they shared it was great for all the car owners. Just trying to do my bit.

The can codes are E46 and similar BMW's. But the method of extracting them would be similar (more or less documented on bimmerforums). Then the programs I made could easily be adjusted to the values and formulas for another car.

Thaniel


----------



## albo2 (Oct 4, 2011)

Thanks this info is invaluable, I'm doing the same but on the serial stream of my Curtis I finally got it to work last night, it's nearly as much fun as the first drive, I guess I'm still chasing that initial rush, I'm also going to have it calculate charge time and control a wireless power adaptor to turn power off to the charger, I hope to also control this from an Android tablet or phone as an extra safety measure, anyway I'm about to read through your blog now cheers.


----------



## hbthink (Dec 21, 2010)

I got a cluster from the AZD auction the one thats used in the Ford Transit Connect. If someone with a running car could scan these codes or if someone has the codes or if they just happen to be the same codes used here that be great! I could use the cluster. I have no information on it so far so anything anyone else knows would be helpful.

Steve


----------



## Thaniel (May 25, 2008)

My e-mail notification worked!!



albo2 said:


> Thanks this info is invaluable, I'm doing the same but on the serial stream of my Curtis I finally got it to work last night, it's nearly as much fun as the first drive, I guess I'm still chasing that initial rush, I'm also going to have it calculate charge time and control a wireless power adaptor to turn power off to the charger, I hope to also control this from an Android tablet or phone as an extra safety measure, anyway I'm about to read through your blog now cheers.


Yes it is quite fun to integrate everything. I had always wanted to be able to some of this "magic". Learning to use microcontrolers has opened a whole new world.



hbthink said:


> I got a cluster from the AZD auction the one thats used in the Ford Transit Connect. If someone with a running car could scan these codes or if someone has the codes or if they just happen to be the same codes used here that be great! I could use the cluster. I have no information on it so far so anything anyone else knows would be helpful.


Dig hard on the internet. You might get lucky and find some can bus information. Be sure to search on other cars that have a similar ECU. 

Thaniel


----------



## spaceballs3000 (Jun 22, 2012)

Thanks Thaniel, 

This is great info! I'm currently doing an E46 conversion, and I will be watching your progress on this closely.

Just from what you have already gathered I will using that to control my Gauges. 

If I learn anything additional E46 CAN bus wise I'll make sure to share it here!


----------



## acree (Sep 4, 2013)

I hate to bump this thread up from 5 months ago, but I believe the OP will have some valuable insight regarding my problem. A quick background on myself, I am an electrical engineer and have worked with CANBUS's in the past. So please don't be afraid to get technical.

I will soon be stuffing an LS3 in my '13 Subaru BRZ. I will be keeping the stock engine control module in the car as it interfaces with many of the body ECU's. The main problem I foresee at this point is getting an RPM signal into the Subaru ECM. The LS3 has a completely different crank angle sensor and reluctor wheel than the FA20, which is the stock BRZ motor. The LS3 ECM outputs a square wave, 2 pulse per revolution tach signal. The only tach input for the Subaru ECM is the stock crank angle sensor which picks up from a wacky odd-shaped 29 tooth reluctor wheel. So the idea of recreating the CAS input for the BRZ would be very very tricky. And I also do not want to use the tach output from the LS3 ECM. 

Here's what I'm trying to accomplish: I want to create a controller to sniff the RPM value off of the GM high speed canbus from the LS3 ECM, which is referred to as GMLAN. I want to take that RPM value and feed it to the CANBUS in the Subaru. This all has to be done with the stock Subaru ECM in place! And here's why...

The stock tachometer gets its information off of the CANBUS. The electric power steering also requires the CANBUS to fully operate. In order to maintain full functionality of the car, the stock Subaru ECM must remain in place. I'm trying to feed the RPM signal to the Subaru CANBUS while leaving all ECU's in place. 

So this brings me to my question. How do I ensure that the Subaru main engine control unit won't continually send out a "0" value for the RPM even if my own controller is sending out an rpm value? I'm worried about the ECM overriding my RPM value on the bus. The stock crank angle sensor for the stock Subaru ECM is going to be disconnected and therefore the ECM will think the engine speed is also 0 rpm. 
Is there a way to change the RPM parameter in the Suby ECM to a "slave" state where it never sends? 

I must leave the Suby ECM intact on the CANBUS because it feeds other vital information to the rest of the body ECU's. I just need to make sure that when I feed the CANBUS a value for the data at the RPM address, the Suby ECM doesn't over right that value. 

My apologies for such a long post, but I really have no experience when it comes to interfacing two master nodes on the same CANBUS.


----------



## Thaniel (May 25, 2008)

acree said:


> I hate to bump this thread up from 5 months ago, but I believe the OP will have some valuable insight regarding my problem. A quick background on myself, I am an electrical engineer and have worked with CANBUS's in the past. So please don't be afraid to get technical.


Sorry I just wrote a long detailed answer and I hit a wrong button and the stupid computer deleted all the info. Since your question is pretty specific and LSx related. Please drop me an e-mail or PM me your e-mail so I can write in an e-mail program that saves drafts. 
Thaniel.


----------



## acree (Sep 4, 2013)

Thaniel said:


> Sorry I just wrote a long detailed answer and I hit a wrong button and the stupid computer deleted all the info. Since your question is pretty specific and LSx related. Please drop me an e-mail or PM me your e-mail so I can write in an e-mail program that saves drafts.
> Thaniel.


Sent! Thank you sir.


----------



## Thaniel (May 25, 2008)

Here is a video of my latest program and circuit running the guages of my car via can bus from an rpm sensor mounted to my EV motor (on the work bench).






http://www.youtube.com/watch?v=dCNWM0GJJ2s

Thaniel


----------



## Caps18 (Jun 8, 2008)

What sensor/motor do you have? Does the Ardruino create the CAN messages then?

Any other details about how you got it to work? (I just noticed that there is a 1st page )

I haven't gotten to my gauges yet, but I am a little worried that they won't work. I don't have a tach gauge right now, but it would be nice. It would also be nice if there was an EV friendly version of this product... My goal is to put one of these in eventually.

https://www.youtube.com/watch?v=09Or4c1a59w


----------



## Thaniel (May 25, 2008)

Caps18 said:


> What sensor/motor do you have? Does the Ardruino create the CAN messages then?
> 
> Any other details about how you got it to work? (I just noticed that there is a 1st page )
> 
> ...


The sensor is the typcial a "geartooth" sensor picking up targets that are mounted on the spinning shaft of the motor. The tricky bit is in what happens after the sensor. The motor (as seen on the work bench in the video happens to be a Warp9. But it work with anything spinning. It goes like this:

RPM sensor -> Arduino -> Can bus chips -> Instrument cluster.

The magic happens in the Arduinio and canbus chips. It takes the pulsed signal from the RPM sensor converts it to an RPM then translates that into the correct format for the BMW and sends it out on the BMW's can bus using can bus chips.

The temp is handled by a ADC (MCP3002 if memory is correct). It samples a voltage (0-5V). So could be anything really. But it's a pretty standard set up for a temp sensor or TPS etc.

The MIL and ELM lights are controlled by grounding or bringing high different pins. IF the input or output voltage is greater than 12V I put it through an optocoupler to ensure the Arduino doesn't get fried (yes I've done that).

The module being tested in the video will be installed into a EV in the next few weeks. 

Though this particular set up is designed for a E46 BMW the concept and hardware should work for any can bus based driven instrument cluster. Would just need to change the can bus codes required to drive it (which may or may not be available off the net. I had to reverse engineer the BMW's).

Thaniel


----------



## bwjunkie (Jul 31, 2013)

very cool. Are you also reading any CAN messages or just writing? My project is messages from BMS CAN and then show the lowest voltage on an analog meter.

But now I definitely want to get the same RPM set you have, that is sweet.
-josh


----------



## Thaniel (May 25, 2008)

Yah the program and can chips both send and receive. It is actually pretty easy once one has the right can bus messages.

Thaniel


----------



## Jprince (10 mo ago)

Bringing back an old thread.. the links on the first page is that the code for the ardunio ? Can someone hold my hand haha looking at getting the can to work with a ls swap ( I know cliché) In a e46
Thank you


----------

