Building a low cost OBD2 ECU Simulator

Re: Building a low cost OBD2 ECU Simulator

Postby ybpvin » Wed Nov 04, 2015 3:25 pm

Hi friends! I have I similar problem like Juanko http://techtinker.co.za/forum/viewtopic.php?f=14&t=10#p403 . Arduino writes the initialization, but does not transmit OBD Elm327 data on the scanmaster. I bought a Chinese clone can bus on which the unknown frequency of the quartz. In the photos the seller 8 MHz, and 16 MHz originals.
You do not have the required permissions to view the files attached to this post.
ybpvin
 
Posts: 1
Joined: Wed Nov 04, 2015 7:25 am

Re: Building a low cost OBD2 ECU Simulator

Postby lithium » Thu Mar 03, 2016 9:06 am

I have the same CAN module. It works fine with arduino nano. I think, that quartz frequency is not important.
You just need to connect INT pin to D2 on arduino.

btw; great project! :D
lithium
 
Posts: 3
Joined: Sun Feb 07, 2016 11:28 am

Re: Building a low cost OBD2 ECU Simulator

Postby lithium » Tue Mar 08, 2016 3:06 pm

I want to return 17 characters long VIN. But don't know, how to return 17 characters...
With following code I get "X" as VIN number in ScanmasterELM. How to return complete 17 characters long string??

unsigned char SupportedVI[4] = {4, 73, 0, 208}; // this enables VIN support
// mode 9, pid 2
unsigned char vin[5] = {4, 73, 2, 0, 88}; // 88=X

if(BuildMessage=="2,9,0,0,0,0,0,0,") {CAN.sendMsgBuf(0x7E8, 0, 4, SupportedVI);}
if(BuildMessage=="2,9,2,0,0,0,0,0,") {CAN.sendMsgBuf(0x7E8, 0, 5, vin);}
lithium
 
Posts: 3
Joined: Sun Feb 07, 2016 11:28 am

Re: Building a low cost OBD2 ECU Simulator

Postby MartinViljoen » Tue Mar 08, 2016 9:19 pm

lithium wrote:I want to return 17 characters long VIN. But don't know, how to return 17 characters...
With following code I get "X" as VIN number in ScanmasterELM. How to return complete 17 characters long string??

unsigned char SupportedVI[4] = {4, 73, 0, 208}; // this enables VIN support
// mode 9, pid 2
unsigned char vin[5] = {4, 73, 2, 0, 88}; // 88=X

if(BuildMessage=="2,9,0,0,0,0,0,0,") {CAN.sendMsgBuf(0x7E8, 0, 4, SupportedVI);}
if(BuildMessage=="2,9,2,0,0,0,0,0,") {CAN.sendMsgBuf(0x7E8, 0, 5, vin);}


Usually a VIN number is returned over 2 or more messages because a VIN is too long to be sent as one message.

In my Jeep's case it gets sent over 2 Messages.

See this where I'm showing how I got my VIN
viewtopic.php?f=14&t=11
Image
User avatar
MartinViljoen
 
Posts: 109
Joined: Mon Oct 06, 2014 5:23 pm
Location: Centurion South Africa

Re: Building a low cost OBD2 ECU Simulator

Postby lithium » Fri Mar 11, 2016 8:33 am

I see...

I got now working VIN :) My ECU simulator is now almost perfect :)

if(BuildMessage.substring(0,6)=="2,9,2,") { // mode 09, pid 02
CAN.sendMsgBuf(0x7E8, 0, 8, vin_msg1);
CAN.sendMsgBuf(0x7E8, 0, 8, vin_msg2);
CAN.sendMsgBuf(0x7E8, 0, 8, vin_msg3);
}
lithium
 
Posts: 3
Joined: Sun Feb 07, 2016 11:28 am

Re: Building a low cost OBD2 ECU Simulator

Postby bman101 » Thu Mar 31, 2016 12:01 am

Do you know if it would be possible to connect this to a raspberry pi without using the CAN-BUS shield? Thanks.
bman101
 
Posts: 1
Joined: Wed Mar 30, 2016 11:57 pm

Re: Building a low cost OBD2 ECU Simulator

Postby lcooper » Wed Jul 20, 2016 1:08 am

lithium wrote:I see...

I got now working VIN :) My ECU simulator is now almost perfect :)

if(BuildMessage.substring(0,6)=="2,9,2,") { // mode 09, pid 02
CAN.sendMsgBuf(0x7E8, 0, 8, vin_msg1);
CAN.sendMsgBuf(0x7E8, 0, 8, vin_msg2);
CAN.sendMsgBuf(0x7E8, 0, 8, vin_msg3);
}


Could you further help with your variables and other snippets of code, I'm trying to build an ECU simulator.
lcooper
 
Posts: 2
Joined: Sat Jul 02, 2016 5:23 pm

Re: Building a low cost OBD2 ECU Simulator

Postby lcooper » Wed Jul 20, 2016 5:38 am

MartinViljoen wrote:Enjoy!!!

Comments Please!


I have a couple of questions.

I'm sending the monitor status, however just the first 2 bytes are getting to the scanner, do I have to split it up or what else I'm missing.

What is the last 2 parts of the message for? Is there a limit on the length?

Thank you.
lcooper
 
Posts: 2
Joined: Sat Jul 02, 2016 5:23 pm

Re: Building a low cost OBD2 ECU Simulator

Postby chris62 » Mon Apr 16, 2018 10:23 pm

Hi MArtin, thank you for sharing this great project.

I plan to simulate an ECU on my old cars (French cars from 1958 to 1983) to read all the sensors and display the informations via Torque APP.
My question is about the 12 volts supply. When an ELM dongle is plugged into a real car ECU, I guess it is powered by the 12v supply on the OBD Plug. But how does it work If I plug an ELM dongle into a CAN BUS shield (via a OBD to DB9 cable) ? I can't find any information on this particular point.

If anyone could explain how to bring those 12 volts to the ELM dongle it would help me a lot ;-) maybe the seeed shield has everything built in to do it, Then I missed it...Thanks a lot to anyone taking time to answer me, and once again great project, I hope it will alos work for me !
chris62
 
Posts: 1
Joined: Thu Mar 15, 2018 12:19 pm

Re: Building a low cost OBD2 ECU Simulator

Postby MartinViljoen » Wed May 09, 2018 7:15 am

chris62 wrote:Hi MArtin, thank you for sharing this great project.

I plan to simulate an ECU on my old cars (French cars from 1958 to 1983) to read all the sensors and display the informations via Torque APP.
My question is about the 12 volts supply. When an ELM dongle is plugged into a real car ECU, I guess it is powered by the 12v supply on the OBD Plug. But how does it work If I plug an ELM dongle into a CAN BUS shield (via a OBD to DB9 cable) ? I can't find any information on this particular point.

If anyone could explain how to bring those 12 volts to the ELM dongle it would help me a lot ;-) maybe the seeed shield has everything built in to do it, Then I missed it...Thanks a lot to anyone taking time to answer me, and once again great project, I hope it will alos work for me !


Hi Chris.

When you connect the ELM's USB connector to the PC it power's up with the 5V supplied by your computers USB port. Same with the CAN bus shiled connected to the arduino. It's also getting power from the arduino.
Image
User avatar
MartinViljoen
 
Posts: 109
Joined: Mon Oct 06, 2014 5:23 pm
Location: Centurion South Africa

Previous

Return to OBD2 & CAN-BUS Projects

Who is online

Users browsing this forum: No registered users and 0 guests

cron