Arduino CAN-BUS ECU Reader

07/06/2011

This project uses the Arduino board and the CAN-BUS shield .

This shield gives the Arduino CAN-Bus capability. It uses the Microchip MCP2515 CAN controller with MCP2551 CAN transceiver.

CAN connection is via a standard 9-way sub-D for use with OBDII cable. Ideal for automative CAN application.

The shield also have an uSD card holder, serial LCD connector and connector for an EM406 GPS module. Making this shield ideal for data logging application.

Features

  • CAN v2.0B at 1 Mb/s
  • High speed SPI Interface (10 MHz)
  • Standard and extened data and remote frames
  • CAN connection via standard 9-way sub-D connector
  • 9-way sub-D standard OBDII connection cable
  • Power can supply to Arduino by sub-D via fuse and reverse polarity protection.
  • Socket for EM406 GPS module
  • Micro SD card holder
  • Connector for serial LCD
  • Reset button
  • Joystick control
  • Two LED indicator

Documents

 

CAN-Bus shield

Short URL:

Tags: , , , , , , ,

18 Responses to Arduino CAN-BUS ECU Reader

  1. Roy Tansley MD Pro-Shift Tech Ltd on 15/09/2011 at 12:14

    Hello,

    I manufacture semi automatic gearshifters and I am interested in adding Can-bus to my systems, there will be a reasonably high volume if you can supply/support this?
    Please contact me at your earliest convenience.

    Kind regards,

    Roy Tansley

  2. Mehmet Yıldız on 09/12/2011 at 08:00

    Hello

    I am working on a CANbus project,shortly I want to explaine about my project. I want to develop a controller to communicate a electrical car controller via CANBUS . Actually , I already achieved communication by using Arduino and CAN-RS232 converter,but now I want to eliminate CAN-RS232 converter and use a CANBUS shield which consists a MCP2515 CAN Controller and MCP2551 High Speed Can Transceiver.Actually, I have two CANbus shields.I am using ArduinoUNO controller card , I want to achieve a simple example such that —–>
    ( http://www.youtube.com/watch?v=3P4nZnrv9mM&feature=player_embedded ) . I need help . Thanks for your time and response

    Sincerely

    MEHMET
    ANKARA/TURKEY

    Thanks for your time

    Sincerely

  3. Mehmet Yıldız on 15/12/2011 at 10:19

    I achieved communication , and a simple tutorial

  4. Stefan Weber on 01/02/2012 at 13:05

    Hi Mehmet,

    I am working in the same field as well and would be very interessted in that tutorial you spoke of. Would you share that ?

    Best
    Stefan
    KerstenWeber@gmx.de

  5. ali on 16/06/2012 at 10:50

    can i get a project in which i hv to ….get the DTC from CAN or OBD-II via ELM327 IC and then using microcontroller send it through a to a remote location using GSM module interfacing (may be sending to a server end),,,,tele maintenance of veh at a far off distance by sending DTC and receving remedy from server

  6. Toby Gardner on 07/11/2012 at 16:29

    Hi,

    I’m having trouble with the demo sketch, I download version 4 and extract the folders into my working arduino folder,
    Load the sketch and try to verify the code it comes up “Canbus” wasn’t defined and lists
    “Engine RPM”
    “Coolant temp”
    and so on ….

    Can anyone help please?
    I’m using arduino version 1 on windows XP

    Cheers Toby

    • reparateur on 11/12/2012 at 15:56

      >I’m having trouble with the demo sketch, I download version 4 and extract the folders into >my working arduino folder,
      >Load the sketch and try to verify the code it comes up “Canbus” wasn’t defined and lists
      >“Engine RPM”
      >“Coolant temp”
      >and so on ….
      I have exactly the same problems:
      Arduino ADK, Win7, Arduino 1.0.3
      ecu_reader_logger.ino:20:20: warning: Canbus.h: No such file or directory
      ecu_reader_logger.ino:596:55: warning: character constant too long for its type
      ecu_reader_logger.ino:624:56: warning: character constant too long for its type
      ecu_reader_logger.ino: In function ‘void error_P(const char*)’:
      ecu_reader_logger.ino:60: warning: only initialized variables can be placed into program memory area
      ecu_reader_logger.ino:67: warning: only initialized variables can be placed into program memory area
      ecu_reader_logger.ino: In function ‘void setup()’:
      ecu_reader_logger:160: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:160: error: ‘CANSPEED_500′ was not declared in this scope
      ecu_reader_logger.ino: In function ‘void loop()’:
      ecu_reader_logger:175: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:175: error: ‘ENGINE_RPM’ was not declared in this scope
      ecu_reader_logger:185: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:185: error: ‘VEHICLE_SPEED’ was not declared in this scope
      ecu_reader_logger:193: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:193: error: ‘ENGINE_COOLANT_TEMP’ was not declared in this scope
      ecu_reader_logger:202: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:202: error: ‘THROTTLE’ was not declared in this scope
      ecu_reader_logger.ino: In function ‘void logging()’:
      ecu_reader_logger:224: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:224: error: ‘CANSPEED_500′ was not declared in this scope
      ecu_reader_logger.ino:244: warning: only initialized variables can be placed into program memory area
      ecu_reader_logger.ino:247: warning: only initialized variables can be placed into program memory area
      ecu_reader_logger.ino:250: warning: only initialized variables can be placed into program memory area
      ecu_reader_logger.ino:259: warning: only initialized variables can be placed into program memory area
      ecu_reader_logger:263: error: ‘class SdFile’ has no member named ‘writeError’
      ecu_reader_logger:278: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:278: error: ‘ENGINE_RPM’ was not declared in this scope
      ecu_reader_logger:289: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:289: error: ‘VEHICLE_SPEED’ was not declared in this scope
      ecu_reader_logger:298: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:298: error: ‘ENGINE_COOLANT_TEMP’ was not declared in this scope
      ecu_reader_logger:307: error: ‘Canbus’ was not declared in this scope
      ecu_reader_logger:307: error: ‘THROTTLE’ was not declared in this scope

      • admin on 12/12/2012 at 23:26

        You need to copy the demo into your libraries folder and restart your IDE.

  7. Masa on 02/05/2013 at 04:01

    How do you do

    I have a trouble.
    I use “Arduino 1.0.4″ and your sketch “Canbus_v4″ but error messege have in “main.c”

    > for (uint8_t i = 0; i PRINT(“0x%02x “, message->data[i]);
    > }

    It have error messege following.

    ‘for’ loop initial declaration used outside C99 mode

    D:\arduino\arduino-1.0.4-windows\arduino-1.0.4\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=104 -ID:\arduino\arduino-1.0.4-windows\arduino-1.0.4\hardware\arduino\cores\arduino -ID:\arduino\arduino-1.0.4-windows\arduino-1.0.4\hardware\arduino\variants\standard -ID:\arduino\arduino-1.0.4-windows\arduino-1.0.4\libraries\SD -ID:\arduino\arduino-1.0.4-windows\arduino-1.0.4\libraries\SoftwareSerial C:\WINDOWS\TEMP\build6036453827169606216.tmp\main.c -o C:\WINDOWS\TEMP\build6036453827169606216.tmp\main.c.o
    main.c: In function ‘print_can_message’:
    main.c:38: error: ‘for’ loop initial declaration used outside C99 mode
    main.c: In function ‘main’:
    main.c:60: error: too few arguments to function ‘mcp2515_init’

    Could you help me?

    • Masa on 22/05/2013 at 18:32

      Hello

      the error not only this one

      could you tell me how to repare the scketch?

  8. mofalz on 14/06/2013 at 15:46

    Hi,
    How to modify library to add PID with different mode?
    Please help me.

  9. Jimmi DK on 20/01/2014 at 08:53

    Hi

    I am trying to interface the canbus-shield with a NetDuino 2 plus and wondering how to communicate with Serial LCD connector on the shield ? is it via SPI ?

    Kind regards

    Jimmi
    Denmark

  10. Prathap Chandra on 26/08/2014 at 13:44

    Dears

    I just got introduced to Arduino and I need to interface my steering wheel switchpack onto a CAN bus based simulator.
    I am using Arduino UNO + Sparkfun CANBUS Shield + VN1610 CAN Analyzer + Switchpack
    The switchpack talks to UNO on I2C
    The UNO talks to CAN Shield via SPI, for obvious reasons
    The Shield would port the data onto the CAN bus

    Right now am establishing communication between each of the devices i have mentioned above
    I am not able to get the CAN up and running, CAN Initialization is FAILING
    I have powered the CAN shield with 12V through DB9 and made sure that all the electronics is referenced to same ground plane.

    Kindly help me, why would i not be able to initialize CAN?

    • Saurav Paul on 29/07/2015 at 12:04

      Hi,

      I am facing the same problem of CAN initialisation when i connect my Arduino DUE with 3.3V CAN transceivers.
      I did a loop test using Arduino DUE’s CAN ports and that worked successfully. But the moment i interface the board with CAN transceivers i get CAN initialisation error. Please help me with possible causes of such a happening.

      Kind regards,
      Saurav

  11. Ovi on 22/09/2014 at 23:13

    Hello,
    I write here as I found no page for PiCAN, sorry if I missed it.
    I bought one from you and connected to my Raspberry Pi Model B.
    Followed the instructions (copied kernel, reboot, checked kernel version was ok, used instmod for all those modules, used lsmod to ensure they are installed, tried caninit with and without board connected works only with it connected) but when I connect it to a vector CANcaseXL I get only error frames from Canalyzer. Cable and CANcaseXL are good, tested connecting between 2 channels of the CANcase and same CANalyzer simulation.
    Any idea what could be wrong ?
    Thank you,
    Ovi

  12. Sokerer on 01/03/2015 at 00:45

    HI I am trying to operate the can bus shield with an arduino uno but i can not upload the demo sketch, the error which appears is the following:

    ecu_reader_logger.ino: In function ‘void logging()’:
    ecu_reader_logger.ino:263:8: error: ‘class SdFile’ has no member named ‘writeError’
    Error compiling.

    I tried almost everything reinstlled librries ,reinstlled arudino software 1.6 , but i can not find a way to work it
    Any clue?

  13. Matt on 02/09/2015 at 01:47

    Hi,
    I am having trouble getting the SD card to work,
    I have been trying to use the Card info default example and have changed the chip select to 9,
    Also made pin 10 & 9 output, and forced pin 9 high but still not working.
    Anyone got this working ?