Arduino Chat

TJBaker57

Guru
Original poster
Aug 16, 2015
2,074
Colorado
Not too long ago @itstallion posted about installing a power steering system from an Equinox into a project of his. The task invloved using an Arduino to do some communication tasks in order to enable the power steering unit to activate and come to life.

I had long had an idea to use an Arduino or maybe Raspberry Pi to read a sensor or two and transmit the data to apps like Torque Pro, OBD Fusion, Car Scanner ELM & OBD, and so on. Any app that allows for user entered PID definitions. The sensor data would be sent over the existing serial data bus and as such would be displayed by the phone (or tablet) right alongside the standard factory sensor data that the vehicle provides.

It would only work with vehicles using the GM implementation of the SAE J1850 VPW protocol commonly referred to as the "serial data" line. I have a fair understanding of the J1850 message structure so I felt comfortable with that part. I know nothing of CANBUS protocol so I wouldn't even attempt to do anything with that.

Arduino however was and is a whole new ballgame for me. itstallion provided the final boot in the rear that got me started thinking that just maybe I could do this myself and stop looking for someone else to take the idea and make something of it.

I am no electronics engineer nor programmer so I had to seek out circuitry and portions of code from around the web and staple it all together with the code shared by itstallion. Many things were altered in the codes I used and a few different circuits were tried out then altered and retried. The code is certainly not pretty, but at the moment does what I was looking to do. I tried to use optocouplers for interfacing with the vehicle data bus but eventually settled on some circuitry taken from the ELM327 datasheet.

And so here I am several months later and while there is still a lot more to do I at least have something to play with that works in both my 2005 Yukon and my 2002 Trailblazer. Nothing fancy yet, just using a thermistor that I already had on hand and just taping it to a radiator or heater hose so it's not yet a very accurate reading but it's something.

IMG_20220310_201812.jpg

The Arduino board seen here is a Nano though I used an Uno and a SparkFun Redboard version during the trials. Not shown in this image is the thermistor or it's connections. Far from a finished item, I expect I will continue to add this or that and simply fiddle with the thing. Next thing I'd like to do is get a proper temperature sensor and maybe cut in a sensor well into a heater hose to get a better reading.

@Saleh what questions were you looking to ask?? I titled this thread "Arduino Chat" thinking we didn't have such a thread yet.
 

Saleh

Newbie
Mar 10, 2022
6
Qassim
Thank you @TJBaker57

Okay, this might be very long but it will be in 2 parts.
Please correct any typing mistakes, as this is not my first language.


Part 1: I'm an IT student, currently making an Android App to scan cars, live data, supported PIDs, Read/Clear DTC, Scan other modules and hopefully controlling some of the car's features.

right now I feel stuck in few things. I love cars and I love creating apps but I had no knowledge in cars, I did gain a lot of information because of this but it's still not enough to do exactly what I want.



Part 2: At first I thought that I can simply control and car using a cheap Elm327 adapter and do some coding, it's way harder than I imagine and requires some hardware (eg. Arduino) and things that I have never heard of before.

First of all I wanted to start from the scratch to understand everything, Right now I have a working app it has a Terminal and it does work!

I wanted to add a "Read/Clear Trouble Codes" which is sending the command (03) to get DTC and (04) to clear DTC.
I found out that it only get OBD2 codes and what I mean by that.. I used another app and I found that my coworker car has 14 DTCs, my app only showed me 1 DTC, in the other app under OBD2 codes there were only 1 DTC which my app managed to get but the other 13 codes in the other app were under ABS/SRS/BCM/... and there were like around 15 modules not all had DTC but it was like a list of modules and every module has below it the DTC if it had any.

Now to the big question how DID that app read more codes than my app, it must have used a different commands to get to the others modules. I need help in that.


Right now I'm waiting for my Arduino Uno + MCP2515 to be delivered to me hopefully sooner than later.
I also have a 2 Elm327
1 very cheap it's very bad doesn't support all the commands and I took from my brother.
I have bought a very good one which is Veepeak BLE+ from amazon and it's really good it supports all the commands. it's elm327 V2.2 if anyone interested to know.


now to the most important question:
I already know that there are commands needs to be send like
ATZ reset all
ATH1 Headers On
ATL1 allow long message
ATMA Monitor All

I think getting to the wanted module has to be doing something with sending the command (AT SH xx yy zz) then sending a another Hex number but I have no idea what I should put in the xyz to get to the module that I wanted there are no data anywhere!
are cars all the same? is there like a file or a list I can lookup from it because I haven't found anything.
 
Last edited:

Saleh

Newbie
Mar 10, 2022
6
Qassim
I see you have ordered a CAN controller, MCP2515. I have no knowledge of CANBUS so unfortunately I will be of very little help there. Currently I think one thing you should read first is the datasheet for the ELM327 from ELM electronics. This document will explain much of what you are asking about message addressing and so on.

Yeah this file has a lot of good information but not the ones that I'm currently looking for.

For example I just found this, I believe this was for Chevrolet.
but I'm not really sure if this is correct or not.

AT SH 6C xx F1the AT command that need to be sent
AT SH 6C 10 F110 = ECM (main engine brain)
AT SH 6C 28 F128 = ABS
AT SH 6C 40 F140 = BCM (body control module)
AT SH 6C 58 F158 = Airbag Module
AT SH 6C 60 F160 = IPC (instument panel cluster)
AT SH 6C 62 F162 = Hud
AT SH 6C 80 F180 = Radio
AT SH 6C C0 F1C0 = Immobilizer
19 C2 FF 00Current Codes
19 D2 FF 00Current and Pending Codes
6C F1 58 59 81 00 13 99This is a response.
AA BB CC DD EF GH IJ KL
AA = Node to node​
BB = Adress to scanner you're using​
CC= Witch part the code is located in. Engine,trans,abs,airbag m.m.​
DD= This I'm not sure about​
E = First part of the code​
F = Second part of the code​
G = Third part of the code​
H = Fourth part of the code​
IJ= Status of the code 00=god 11=and up eq.fault​
KL= Checksum of the code just ignore this one​
 

TJBaker57

Guru
Original poster
Aug 16, 2015
2,074
Colorado
Yeah this file has a lot of good information but not the ones that I'm currently looking for.

For example I just found this, I believe this was for Chevrolet.
but I'm not really sure if this is correct or not.


Almost all of the command strings in the table you posted are for use with a GM vehicle only, likely earlier than 2008, that uses the SAE J1850 VPW protocol. Some of it is correct and some is not. None of them are correct for a CAN bus vehicle.

The MCP2515 you ordered is for a CANBUS vehicle. That device will not work for vehicles that are using the SAE J1850 VPW protocol, except in the case of vehicles that are running multiple protocols.

Are the vehicles you are asking about General Motors vehicles communicating with the SAE J1850 VPW protocol?? Can you tell us a specific vehicle that you are working with, year, make, model, and engine?

If yes than we can discuss these commands in a more appropriate thread where this is discussed in detail.

 

Saleh

Newbie
Mar 10, 2022
6
Qassim
Almost all of the command strings in the table you posted are for use with a GM vehicle only, likely earlier than 2008, that uses the SAE J1850 VPW protocol. Some of it is correct and some is not. None of them are correct for a CAN bus vehicle.

The MCP2515 you ordered is for a CANBUS vehicle. That device will not work for vehicles that are using the SAE J1850 VPW protocol, except in the case of vehicles that are running multiple protocols.

Are the vehicles you are asking about General Motors vehicles communicating with the SAE J1850 VPW protocol?? Can you tell us a specific vehicle that you are working with, year, make, model, and engine?

If yes than we can discuss these commands in a more appropriate thread where this is discussed in detail.



I have 5 Cars they are all Gasoline:
1- Honda Accord 2013 V4 (LX-B or EX)
2- GMC Yukon 2010 V8 5.3L SLE
3- GMC Sierra 2009 V8 5.3L 1500 Base
4- Toyota Land Cruiser 2013 V8 4.6L GXR
5- Mercedes S350 2008 V6 AMG
 

TJBaker57

Guru
Original poster
Aug 16, 2015
2,074
Colorado
I have 5 Cars they are all Gasoline:
1- Honda Accord 2013 V4 (LX-B or EX)
2- GMC Yukon 2010 V8 5.3L SLE
3- GMC Sierra 2009 V8 5.3L 1500 Base
4- Toyota Land Cruiser 2013 V8 4.6L GXR
5- Mercedes S350 2008 V6 AMG


I think those will all be on some version of CANBUS. Possibly ISO 15765-4 protocol. A different message structure than what you are seeing here.
 

Saleh

Newbie
Mar 10, 2022
6
Qassim
I think those will all be on some version of CANBUS. Possibly ISO 15765-4 protocol. A different message structure than what you are seeing here.
Okay, but how can or from where can I get more details to start working, all I have are just Hex numbers with no information and I have no idea what they are for or what they mean..


Yes you are correct, They all use this protocol ISO 15765-4 which is number 6 if I send they command ATDPN

is there like a guide or a start point that will help me start getting the information that I want?


it feels like that I'm trying to read Japanese with no access to translations, you know what I mean?
 
  • Like
Reactions: TJBaker57

TJBaker57

Guru
Original poster
Aug 16, 2015
2,074
Colorado
feels like that I'm trying to read Japanese with no access to translations, you know what I mean?

I do indeed know what you mean. It took me several years to seek out and begin to understand informations pertaining to SAE J1850 VPW. As I have stated many many times my knowledge of CAN is practically zero. I do not know where to even begin with ISO 15765 except to say that the ELM327 datasheet does at least begin to describe how to request Diagnostic Trouble Codes on a CAN system.
 

mrrsm

Lifetime VIP Donor
Oct 22, 2015
5,988
Tampa Bay Area
A Related Thread for the Use of an Arduino Device to Transfer Mileage intact between Two Instrument Panel Clusters:

 
  • Like
Reactions: TJBaker57

mrrsm

Lifetime VIP Donor
Oct 22, 2015
5,988
Tampa Bay Area
@TJBaker57 ... If you ever decide to branch out from the Class 2 Networks Solid PID Apps Work you've been so successful working on and want to investigate the CAN-Bus Networks HI-LO Data Packets for their Module Information, THIS Arduino DIY Project appears quite easy to do and looks very promising for future CAN-Bus Network Diagnostics and Problem Solving:

 

santon

Registered Member
Jun 3, 2020
48
Israel
Very interesting thread! I also started to experiment with J1850VPW. To interface the Arduino UNO to J1850 bus, I built a simple 3 transistor interface published here. As a library, I am currently use this one. To work with the above 3 transistor interface, this library should be set to ACTIVE_LOW during the initialization in the sketch. Here you can see the Arduino controls the gauges of the TB instrument cluster. (Not all stepper motors are OK in this cluster).
 
Last edited:

mrrsm

Lifetime VIP Donor
Oct 22, 2015
5,988
Tampa Bay Area
There are enormous resources available for creators of Arduino and Raspberry PI Projects who more often than not, park their 'Works In Progress' by storing them either locally or remotely in repositories.

GITHUB tries to keep track of all the "Pulling" and "Pushing" of "Commits" on such efforts that define What is being Stored in Repository "Branches" along with any Changes that have been made. This is critical when Developers need to keep track of their Code Changes along with any Changes made by other contributors "...On Different Branches".

However, from time to time, this can get very confusing and frustrating to navigate effectively when things don't "Stay on Their Branches" and go sideways. THIS Dude (A Young Microsoft Employee) puts on an excellent GIT vs. GIT-HUB Clinic, explaining the Basic Concepts and how to use the Command Line inputs that can help straighten out these confusing concepts:

 
  • Like
Reactions: christo829

Forum Statistics

Threads
22,103
Posts
621,887
Members
16,626
Latest member
katcarrnh

Members Online

Members Online

Members Online