The purpose of this project is to watch how the PID codes work with an visual interface where you can change the values of the speed, rpm, temperature, and other sensor values that an ECU has. The ECU is simulated with an arduino nano. It supports Arduino UNO.
The simulated ECU was taken from this repository made by sugiuraii. There explain how to set values of the ECU to simulate it values. For now the HMI can set the Speed and RPM Speed from a car. Hope this repository can work to your projects and to lear more about cars and CANBUS protocol.
- Arduino Uno or Nano
- MCP2515 Module
- Processing
- Arduino IDE
- The ISO-TP library from altelch (it is necesary to download and install manually because it doesnt appear in the library manager in Arduino IDE).
- The MCP2515 library is usefull to send and receive CAN messages with the MCP2515 module.
First you have to flash your Arduino with the "ECUSim" program (ECUSim.ino). Then you have to open the app to connect with your Arduino.
The app is coded in processing, it connects with an Arduino via USBSerial but, to choose the USB port you only need to change a code from a line, look for:
myPort = new Serial(this,"YourPort",115200);
and between the "" put the USB port to connect with the Arduino. At the moment the App only can set the speed and rpm from the ECU, you can use the other program of "SEND_CAN.ino" to request the values with the PID's codes.
First you have to flash your arduino to get the values with the program in Arduino (Arduino_Sender_OBDII.ino).
At the moment the only parameters that show their value are speed and engine RPM. Only need to open the program from the "Scanner_App" folder with the name Scanner_App.pde. The same as the App ECU simulator, you need to change the port USB that is written in the line:
myPort = new Serial(this,"YourPort",115200);
After you modify this line, you can run the program and you'll see a window like the next image, with the Start button you will begin the scanner and can watch the values of RPM and Speed(Km/s). With the Stop buttton you end the scan.
- The SEND_CAN.ino program was tested with a real ECU computer to receive the values of the Engine rpm.
- The Scanner app is already tested with a real ECU, it works and it shows the engine rpm and the speed.