Go Down

Topic: [SOLVED] CAN-BUS workaround for MB Transmission Range Recognition Switch (Read 215 times) previous topic - next topic

casmic911

Problem = Purchased a Mercedes clk 320 for $850. That was the first problem. Second being the PCB board underneath the shiftier/gear selector that tells the trans controller what gear it is in etc. has made its maker. The actual potentiometer that reads the gear selector is functioning as it should. The problem I believe by mapping the board best I could, is with the SN65HVD230 CAN Bus Module Comm Module. Also there was corrosion damage to 4 of the 8 pins. Everything else seemed fine. So I purchaced a KNARCO SN65HVD230 CAN chip along with a CHENBO TM Smart Electronics MCP2515 CAN BUS Module TJA1050 Receiver Development Board and CAN-BUS Shield.

Solution = can I or would it be possible to

a) solder the new chip to the bad chip original location. Being that is the only problem. Or does the old chip hold a code memory similar to eprom or bios that I would have read and flash to the new chip?

b) is it possible to take the data from the Potentiometer directly via analog(read) and feed it through the new chip? Then relay the data off the new chip to the trans control unit, or tap it back into the board? (same as (a) I guess, just an off board since the chip I bought is already soldered to a break-out.

c) Is there any other way around this, so I don't have to spend as much as i did on the entire car, to fix this problem?

I was able to read data from the gear selector potentiometer using the code below. As it was close enough to give me an idea if it worked or not, and to get a better look at what pin was for what. I am new to Arduino, still in the learning curve.

So the short of it I am asking those who have coded Arduino using any CAN-BUS type hardware to help me write a program to make this car shift its gears/or actually to just tell the trans unit what position the automatic shifter lever is at i.e P, R, N, D ;-)

If someone can point me in the right direction I would be more than thankful.

Code that worked as a quick visual to the analog of the gear changer position

Code: [Select]

int sensorPin = A0; // the pin that the sensor is connected to
int voltagePin1 = A1; // pin connected to voltage divider
float voltage1;       // variable to store voltage value
int voltagePin2 = A2; // pin connected to voltage divider
float voltage2;       // variable to store voltage value

// YOUR calibration
float offset = 513.0; // zeroing bi-directional sensor
float span = 0.05883; // span

const byte numReadings = 32; // number of readings for smoothing (max 64)
int readings[numReadings]; // raw A/D readings
byte index = 0; // index of the current reading
unsigned int total = 0; // running total
float current; // resulting current

#include <LiquidCrystal.h>
#include <Wire.h>

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
 lcd.begin(16, 2);
  lcd.clear();
Serial.begin(115200); // ***set serial monitor to this value***
for (index = 0; index < numReadings; index++) { // fast-fill the array at startup
  readings[index] = analogRead(sensorPin);
  total = total + readings[index];
}
index = 0; // reset index
}

void loop() {
total = total - readings[index]; // subtract the last reading
readings[index] = analogRead(sensorPin); // one unused reading to clear any ghost charge
readings[index] = analogRead(sensorPin); // read the sensor
total = total + readings[index]; // add the reading to the total
index = index + 1; // advance to the next position in the array
if (index >= numReadings) // if we're at the end of the array
  index = 0; // wrap around to the beginning

// convert value to current
current = (total / numReadings - offset) * span; // value to current conversion

// volt
voltage1 = analogRead(voltagePin1);  // Read voltagePin1
voltage1 = (voltage1*15.45)/1024.0;   // calculates actual voltage

voltage2 = analogRead(voltagePin2);  // Read voltagePin2
voltage2 = (voltage2*15.45)/1024.0;   // calculates actual voltage

// print to serial monitor
Serial.print("Current is ");
Serial.print(current); // default two decimal places | ...(current, 1);  is one decimal place
Serial.print(" Amp   "); // CHANGED to Serial.print
Serial.print("BatteryVoltage is ");
Serial.print(voltage1);
Serial.print(" Volts    ");
Serial.print("SunVoltage is ");
Serial.print(voltage2);
Serial.println(" Volts     ");  // end of line

lcd.setCursor(0, 0);
lcd.print(current);
lcd.setCursor(0, 1);
lcd.print(voltage1);
lcd.setCursor(0, 2);
lcd.print(voltage2);

}

pert

DON'T CROSS POST!!!!!!!!!!!!!!!!!!!!
http://forum.arduino.cc/index.php?topic=576709
I HAVE REPORTED THIS THREAD TO THE MODERATORS

Duplicate posts waste the time of the people helping you. I might spend 15 minutes writing a detailed answer on this thread, without knowing that someone already did the same in the other thread. This behavior is very disrespectful to the people you're asking for assistance. Just because we give our time freely doesn't mean it has no value.

In the future, take some time to pick the forum section that best suits the topic of your question and then only post once to that forum section. This is basic forum etiquette, which you would already know if you had bothered reading the sticky "How to use this forum - please read." post you will find at the top of every forum section. It contains a lot of other useful information. Please read it.


Paul_KD7HB

Problem = Purchased a Mercedes clk 320 for $850. That was the first problem. Second being the PCB board underneath the shiftier/gear selector that tells the trans controller what gear it is in etc. has made its maker. The actual potentiometer that reads the gear selector is functioning as it should. The problem I believe by mapping the board best I could, is with the SN65HVD230 CAN Bus Module Comm Module. Also there was corrosion damage to 4 of the 8 pins. Everything else seemed fine. So I purchaced a KNARCO SN65HVD230 CAN chip along with a CHENBO TM Smart Electronics MCP2515 CAN BUS Module TJA1050 Receiver Development Board and CAN-BUS Shield.

Solution = can I or would it be possible to

a) solder the new chip to the bad chip original location. Being that is the only problem. Or does the old chip hold a code memory similar to eprom or bios that I would have read and flash to the new chip?

b) is it possible to take the data from the Potentiometer directly via analog(read) and feed it through the new chip? Then relay the data off the new chip to the trans control unit, or tap it back into the board? (same as (a) I guess, just an off board since the chip I bought is already soldered to a break-out.

c) Is there any other way around this, so I don't have to spend as much as i did on the entire car, to fix this problem?

I was able to read data from the gear selector potentiometer using the code below. As it was close enough to give me an idea if it worked or not, and to get a better look at what pin was for what. I am new to Arduino, still in the learning curve.

So the short of it I am asking those who have coded Arduino using any CAN-BUS type hardware to help me write a program to make this car shift its gears/or actually to just tell the trans unit what position the automatic shifter lever is at i.e P, R, N, D ;-)

If someone can point me in the right direction I would be more than thankful.

Code that worked as a quick visual to the analog of the gear changer position

Code: [Select]

int sensorPin = A0; // the pin that the sensor is connected to
int voltagePin1 = A1; // pin connected to voltage divider
float voltage1;       // variable to store voltage value
int voltagePin2 = A2; // pin connected to voltage divider
float voltage2;       // variable to store voltage value

// YOUR calibration
float offset = 513.0; // zeroing bi-directional sensor
float span = 0.05883; // span

const byte numReadings = 32; // number of readings for smoothing (max 64)
int readings[numReadings]; // raw A/D readings
byte index = 0; // index of the current reading
unsigned int total = 0; // running total
float current; // resulting current

#include <LiquidCrystal.h>
#include <Wire.h>

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
 lcd.begin(16, 2);
  lcd.clear();
Serial.begin(115200); // ***set serial monitor to this value***
for (index = 0; index < numReadings; index++) { // fast-fill the array at startup
  readings[index] = analogRead(sensorPin);
  total = total + readings[index];
}
index = 0; // reset index
}

void loop() {
total = total - readings[index]; // subtract the last reading
readings[index] = analogRead(sensorPin); // one unused reading to clear any ghost charge
readings[index] = analogRead(sensorPin); // read the sensor
total = total + readings[index]; // add the reading to the total
index = index + 1; // advance to the next position in the array
if (index >= numReadings) // if we're at the end of the array
  index = 0; // wrap around to the beginning

// convert value to current
current = (total / numReadings - offset) * span; // value to current conversion

// volt
voltage1 = analogRead(voltagePin1);  // Read voltagePin1
voltage1 = (voltage1*15.45)/1024.0;   // calculates actual voltage

voltage2 = analogRead(voltagePin2);  // Read voltagePin2
voltage2 = (voltage2*15.45)/1024.0;   // calculates actual voltage

// print to serial monitor
Serial.print("Current is ");
Serial.print(current); // default two decimal places | ...(current, 1);  is one decimal place
Serial.print(" Amp   "); // CHANGED to Serial.print
Serial.print("BatteryVoltage is ");
Serial.print(voltage1);
Serial.print(" Volts    ");
Serial.print("SunVoltage is ");
Serial.print(voltage2);
Serial.println(" Volts     ");  // end of line

lcd.setCursor(0, 0);
lcd.print(current);
lcd.setCursor(0, 1);
lcd.print(voltage1);
lcd.setCursor(0, 2);
lcd.print(voltage2);

}

To find the answer about the chip, read the data sheet! To remove and replace the chip, cut the legs. Then using a proper soldering iron and solder wick, clean off all the old solder. The solder is LEAD FREE! Then clean the entire area with IPA, alcohol, to remove any flux, The using solder with no-clean flux, put a tiny bit of solder on each pad.

Then place the new chip on the pads, oriented just like the old chip and solder two pins on opposite corners. When you are satisfied with the legs all going to the center of the pads, solder the remaining legs.

Paul

casmic911

Sorry about the cross posting. I reported them myself once I was told it was against policy here. Thanks for the replies. I receive the chip in a few hours. By looking at the PCB closely it looks like there might be other weak points or corrosion. Can I just use the data off the automatic shit lever potentiometer, and relay it using the new chip or is there more to it than that? The PCB board primary functions by the look of it are for lighting the correct LED for the gear that the potentiometer gives out I believe. The board does also have the optional manual shift mode when you move the lever right or left. And a Winter or Summer optical switch. I can do without these. I know this sounds like a long shot, because it is. 

casmic911

Just to update and thank Paul for the reply on proper replacing and cleaning of the PCB board. It took a total of 3 days and about 10 hours of cleaning, tracing, testing, removing bad components. I only had to remove one set of capacitor resistor just before the problem chip. Come to find out the one I ordered was not the same. The chip had the same function almost but the data sheet of the problem chip was used VOK not VO or similiar you see today. The chip was retired some time ago. Long story short I carefully cleaned with alcohol. Used a multimeter to find any shorts or dead ends. As best I could anyway. I started to get an understanding of the circuit I believed the chip was apart of. There was barely anything left to solder to on the chip it was so corroded. As to about half the soldered components. I was able to slowly build the connection back to the pad by manipulating the solder. The chip was indeed a serial interface part of the CAN BUS network. All the squinting soldering and profanity paid off. IT LIVES. After reseting the obd2 code it finially was communicating again. Saved me about $600 ;-)

Paul_KD7HB

I am pleased you got it all working again. Be sure to list your new skill on your resume!

Paul

Go Up