{"id":33373,"date":"2020-06-05T04:15:29","date_gmt":"2020-06-04T20:15:29","guid":{"rendered":"\/blog\/?p=33373"},"modified":"2022-09-16T11:38:36","modified_gmt":"2022-09-16T03:38:36","slug":"mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications","status":"publish","type":"post","link":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/","title":{"rendered":"MCP2515 CAN-BUS Arduino Tutorial &#8211; Getting started, Interfacing, Applications"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><video autoplay loop muted src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/515.mp4\" playsinline><\/video><\/figure>\n\n\n\n<p>If you want to use a microcontroller like your Arduino and its peripheral devices to control your automobile, check out this Arduino CAN BUS tutorial, as we use the MCP2515, CAN-BUS controller module to do that. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"text-decoration: underline;\">Introduction<\/span><\/h2>\n\n\n\n<p>In today&#8217;s time, automobiles have around 60 to 100 sensors units for sensing and exchanging information. With more and more features being added to cars like autonomous driving, airbag systems, smart car systems, sensors units continue to increase. <\/p>\n\n\n\n<p>With sensor units delivering important information like speed and etc, any miscommunication or loss of data could lead to fatal accidents. <\/p>\n\n\n\n<p>Thus, standard communication protocols like UART, I2C, SPI, are not in the equation as they are not as reliable as other communication protocols like the CAN, LIN and FlexRay.<\/p>\n\n\n\n<p>CAN compared to other available protocols is more commonly used and popular. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"text-decoration: underline;\">More about CAN (Controller Area Network) BUS<\/span><\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/11\/image-156.png\" alt=\"\" width=\"486\" height=\"204\"\/><figcaption><a href=\"https:\/\/www.seeedstudio.com\/CAN-BUS-Shield-V2.html?utm_source=blog&amp;utm_medium=blog\">CAN-BUS Shield V2<\/a>,&nbsp;<a href=\"https:\/\/www.seeedstudio.com\/Serial-CAN-BUS-Module-based-on-MCP2551-and-MCP2515.html?utm_source=blog&amp;utm_medium=blog\">Serial CAN-BUS Module,<\/a> <\/figcaption><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>CAN which stands for Controller Area Network is used to allow microcontrollers and devices to communicate with each other within a vehicle without a host computer<br>which allow for control and data acquisition. These devices are also called Electronic Control Units (ECU) and they enable communication between all parts of a vehicle.<ul><li>ECU in an automotive CAN BUS system can be an energy control unit, airbag, audio system, etc. Today, you can find up to 70 ECUs in a modern car.<\/li><li>In layman term, the CAN BUS involves a bunch of linked ECUs within a vehicle that communicate with each other based on a broadcast. Every ECU intercepts every broadcast, but individually decide whether or not to react to it.<\/li><\/ul><\/li><li>CAN is a serial communication bus designed for industrial and automotive applications. For example, they are found in vehicles, farming equipment, industrial environments, etc<ul><li>Why not use other communication peripherals like UART, SPI and I2C?<\/li><li>Well, compared to other communication protocols like UART, SPI and I2C, using CAN BUS communication protocol are much more reliable as they are standard automotive communication protocols that are used to transmit vital data like a throttle position in a vehicle. If miscommunication or loss of data occurs, it could lead to critical failures.<\/li><\/ul><\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/11\/image-160.png\" alt=\"\" class=\"wp-image-27413\" width=\"493\" height=\"205\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/11\/image-160.png 788w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/11\/image-160-300x125.png 300w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/11\/image-160-768x321.png 768w\" sizes=\"(max-width: 493px) 100vw, 493px\" \/><figcaption>Ref:&nbsp;<a href=\"http:\/\/www.volkspage.net\/technik\/ssp\/ssp\/SSP_238.pdf\">Volkspage<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Without CAN BUS protocol, electronic modules in vehicles will have to communicate with each other using direct, point-to-point analog signal lines. With each module requiring a direct line connected for communication, not only is it time-consuming, it will be messy with all the excessive amount of wiring as seen on the picture above<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/11\/image-161.png\" alt=\"\" class=\"wp-image-27414\" width=\"515\" height=\"190\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/11\/image-161.png 767w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/11\/image-161-300x111.png 300w\" sizes=\"(max-width: 515px) 100vw, 515px\" \/><figcaption>Ref:&nbsp;<a href=\"http:\/\/www.volkspage.net\/technik\/ssp\/ssp\/SSP_238.pdf\">Volkspage<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>With CAN BUS protocol, it eliminates the need of all these wiring by enabling electronic devices to communicate with each other with a single multiplex wire that connects each node in the network to the main dashboard as seen on the picture above.<ul><li>The multiplex wire and architecture enable signals to be combined and transmitted over the entire network with just a single wire while ensuring each electronic module in vehicles receives data from sensors and actuators. This allows the user to be able to connect any number of ECUs in your vehicle through the two-wire bus.<\/li><li>It also allows for several features to be added via just software. Furthermore, an ECU is able to use data from another ECU which eliminates the need to install the same sensors in multiple devices.<\/li><\/ul><\/li><li>With a CAN BUS system, you can now network electronic modules such as control units or intelligent sensors such as the wheel angle sensor.<\/li><\/ul>\n\n\n\n<p>Want to find out more about CAN BUS? Check out our <a href=\"https:\/\/www.seeedstudio.com\/blog\/2019\/11\/27\/introduction-to-can-bus-and-how-to-use-it-with-arduino\/\">guide on CAN BUS <\/a>where you will learn more about CAN protocol, CAN network, CAN message and many more. <\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"text-decoration: underline;\">Arduino MCP2515 CAN BUS Interface Tutorial<\/span><\/h2>\n\n\n\n<p>In this tutorial, we will be using Seeed&#8217;s CAN-BUS Shield V2.0 which is made up of the <strong>MCP2515<\/strong>&nbsp;CAN Bus controller with SPI interface and&nbsp;<strong>MCP2551<\/strong>&nbsp;CAN transceiver to give your Arduino\/Seeeduino CAN-BUS capability.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-13.png\" alt=\"\" class=\"wp-image-33378\" width=\"298\" height=\"233\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-13.png 379w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-13-300x235.png 300w\" sizes=\"(max-width: 298px) 100vw, 298px\" \/><figcaption><a href=\"https:\/\/www.seeedstudio.com\/CAN-BUS-Shield-V2.html\"> CAN-BUS Shield V2.0<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<p>The shield has a CAN controller MCP2515 which is a high speed CAN transceiver. For any beginners and makers, the CAN-BUS Shield V2.0 is perfect for you to enter the world of CAN with its easy connection peripherals.<\/p>\n\n\n\n<p>The CAN BUS Shield works well with Arduino UNO (ATmega328), Arduino Mega (ATmega1280\/2560) as well as Arduino Leonardo (ATmega32U4). <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Hardware Overview of CAN BUS Shield V2.0<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/files.seeedstudio.com\/wiki\/CAN_BUS_Shield\/image\/hardware_overview_1.png\" alt=\"\" width=\"406\" height=\"323\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>DB9 Interface<\/strong>&nbsp;&#8211; to connect to OBDII Interface via a DBG-OBD Cable.<\/li><li><strong>V_OBD<\/strong>&nbsp;&#8211; It gets power from OBDII Interface (from DB9)<\/li><li><strong>Led Indicator<\/strong>:<ul><li><strong>PWR<\/strong>: power<\/li><li><strong>TX<\/strong>: blink when the data is sending<\/li><li><strong>RX<\/strong>: blink when there&#8217;s data receiving<\/li><li><strong>INT<\/strong>: data interrupt<\/li><\/ul><\/li><li><strong>Terminal<\/strong>&nbsp;&#8211; CAN_H and CAN_L<\/li><li><strong>Arduino UNO pin out<\/strong><\/li><li><strong>Serial Grove connector<\/strong><\/li><li><strong>I2C Grove connector<\/strong><\/li><li><strong>ICSP pins<\/strong><\/li><li><strong>IC<\/strong>&nbsp;&#8211; MCP2551, a high-speed CAN transceiver (<a href=\"https:\/\/files.seeedstudio.com\/wiki\/CAN_BUS_Shield\/resource\/Mcp2551.pdf\">datasheet<\/a>)<\/li><li><strong>IC<\/strong>&nbsp;&#8211; MCP2515, stand-alone CAN controller with SPI interface (<a href=\"https:\/\/files.seeedstudio.com\/wiki\/CAN_BUS_Shield\/resource\/MCP2515.pdf\">datasheet<\/a>)<\/li><\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Pin map of CAN BUS Shield V2.0<\/h4>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/files.seeedstudio.com\/wiki\/CAN_BUS_Shield\/image\/PINMAP.png\" alt=\"\" width=\"578\" height=\"451\"\/><\/figure><\/div>\n\n\n\n<p>Without further ado, let us jump right into the tutorial.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What do you need?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>2 x <a href=\"https:\/\/www.seeedstudio.com\/CAN-BUS-Shield-V2.html\">CAN-BUS Shield<\/a><\/li><li>2 x Arduino UNO \/ <a href=\"https:\/\/www.seeedstudio.com\/item_detail.html?p_id=2517\">Seeeduino V4.2<\/a><\/li><li>2 x<a href=\"https:\/\/www.seeedstudio.com\/item_detail.html?p_id=234\"> Jumper Wire<\/a><\/li><\/ul>\n\n\n\n<p>You will require 2 of each CAN-BUS shield and Arduino as one will act as a transmitter while the other will act as a receiver where communication will happen between them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step by Step Tutorial<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1:&nbsp;Hardware&nbsp;Connection<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, connect each CAN-BUS shield into Seeeduino V4.2 and connect the 2 CAN-BUS shield together via 2 jumper wires as shown below. (CAN_H to CAN_H and CAN_L to CAN_L)<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"655\" height=\"425\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2019\/11\/image-163.png\" alt=\"\" class=\"wp-image-27418\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/11\/image-163.png 655w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2019\/11\/image-163-300x195.png 300w\" sizes=\"(max-width: 655px) 100vw, 655px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Setting up Software<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Download the library for CAN BUS&nbsp;<a href=\"https:\/\/github.com\/Seeed-Studio\/CAN_BUS_Shield\">here<\/a>&nbsp;and install the library to Arduino IDE after download has completed.<\/li><li>If you do not know how to install an Arduino library, you can follow the instructions&nbsp;<a href=\"http:\/\/wiki.seeed.cc\/How_to_install_Arduino_Library\/\">here<\/a>.<\/li><li>One of the node (a node means Seeeduino + CAN_BUS Shield) acts as master, the other acts as slaver. The master will send data to slaver constantly.<\/li><li>Open the&nbsp;<strong>send<\/strong>&nbsp;example (<strong>File &gt; Examples &gt; CAN_BUS_Shield-master &gt;send<\/strong>) and upload to the&nbsp;<strong>master<\/strong>&nbsp;as shown below:<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/github.com\/SeeedDocument\/CAN_BUS_Shield\/raw\/master\/image\/send%20example.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>After that, Open the&nbsp;<strong>receive_check<\/strong>&nbsp;example (<strong>File &gt; Examples &gt; CAN_BUS_Shield-master &gt; receive_check<\/strong>) and upload to the&nbsp;<strong>slaver<\/strong>&nbsp;as shown below<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/github.com\/SeeedDocument\/CAN_BUS_Shield\/raw\/master\/image\/receive%20check%20example.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: View Results<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Open the Serial Monitor of Arduino IDE(<strong>slaver<\/strong>), you will get the data sent from the master. Below is a photo of what it will look like:<br><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/SeeedDocument\/CAN_BUS_Shield\/master\/image\/serial_monitor.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4: APIs (Application Program Interface)<\/h4>\n\n\n\n<p>For the APIs of this software, you can:<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Set the Baud Rate<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li>This function is used to initialize the baud rate of the CAN Bus system. The available baud rates are listed as follows:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>#define CAN_5KBPS    1\n#define CAN_10KBPS   2\n#define CAN_20KBPS   3\n#define CAN_25KBPS   4\n#define CAN_31K25BPS 5\n#define CAN_33KBPS   6\n#define CAN_40KBPS   7\n#define CAN_50KBPS   8\n#define CAN_80KBPS   9\n#define CAN_83K3BPS  10\n#define CAN_95KBPS   11\n#define CAN_100KBPS  12\n#define CAN_125KBPS  13\n#define CAN_200KBPS  14\n#define CAN_250KBPS  15\n#define CAN_500KBPS  16\n#define CAN_666kbps  17\n#define CAN_1000KBPS 18<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Set Receive Mask and Filter<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li>There are&nbsp;2&nbsp;receive mask registers and&nbsp;<strong>5<\/strong>&nbsp;filter registers on the controller chip that guarantee you getting data from the target device. They are useful especially in a large network consisting of numerous nodes.<\/li><li>We provide two functions for you to utilize these mask and filter registers. They are:<\/li><\/ul>\n\n\n\n<p>Mask<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>init_Mask(unsigned char num, unsigned char ext, unsigned char ulData);<\/code><\/pre>\n\n\n\n<p>Filter<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>init_Filt(unsigned char num, unsigned char ext, unsigned char ulData);<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>num&nbsp;represents which register to use. You can fill 0 or 1 for mask and 0 to 5 for filter.<\/li><li>ext&nbsp;represents the status of the frame. 0 means it\u2019s a mask or filter for a standard frame. 1 means it\u2019s for a extended frame.<br><\/li><li>ulData&nbsp;represents the content of the mask of filter.<\/li><\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">Check Receive<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li>The MCP2515 can operate in either a polled mode, where the software checks for a received frame, or using additional pins to signal that a frame has been received or transmit completed.<\/li><li>Use the following function to poll for received frames:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>INT8U MCP_CAN::checkReceive(void);<\/code><\/pre>\n\n\n\n<p>The function will return 1 if a frame arrives, and 0 if nothing arrives.<br><\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Get CAN ID<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li>When some data arrive, you can use the following function to get the CAN ID of the \u201csend\u201d node.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>INT32U MCP_CAN::getCanId(void)<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"5-send-data\">Send Data<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>CAN.sendMsgBuf(INT8U id, INT8U ext, INT8U len, data_buf);<\/code><\/pre>\n\n\n\n<p>It is a function to send data onto the bus. In which:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>id&nbsp;represents where the data comes from.<\/li><li>ext&nbsp;represents the status of the frame. \u20180\u2019 means standard frame. \u20181\u2019 means extended frame.<\/li><li>len&nbsp;represents the length of this frame.<\/li><li>data_buf&nbsp;is the content of this message.<\/li><\/ul>\n\n\n\n<p>For example, In the \u2018send\u2019 example, we have:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>unsigned char stmp&#91;8] = {0, 1, 2, 3, 4, 5, 6, 7};\nCAN.sendMsgBuf(0x00, 0, 8, stmp); \/\/send out the message 'stmp' to the bus and tell other devices this is a standard frame from 0x00.<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"6-receive-data\">Receive Data<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li>The following function is used to receive data on the \u2018receive\u2019 node:<br><\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>CAN.readMsgBuf(unsigned char len, unsigned char buf);<\/code><\/pre>\n\n\n\n<p>In conditions that masks and filters have been set. This function can only get frames that meet the requirements of masks and filters.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>len&nbsp;represents the data length.<\/li><li>buf&nbsp;is where you store the data.<\/li><\/ul>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"generate-a-new-baudrate\">Generate a New BaudRate<\/h5>\n\n\n\n<p>We had provided many frequently-used baud rates, as shown below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#define CAN_5KBPS    1\n#define CAN_10KBPS   2\n#define CAN_20KBPS   3\n#define CAN_25KBPS   4\n#define CAN_31KBPS   5\n#define CAN_33KBPS   6\n#define CAN_40KBPS   7\n#define CAN_50KBPS   8\n#define CAN_80KBPS   9\n#define CAN_83KBPS   10\n#define CAN_95KBPS   11\n#define CAN_100KBPS  12\n#define CAN_125KBPS  13\n#define CAN_200KBPS  14\n#define CAN_250KBPS  15\n#define CAN_500KBPS  16\n#define CAN_666KBPS  17\n#define CAN_1000KBPS 18<\/code><\/pre>\n\n\n\n<p>Yet you may still can\u2019t find the rate you want. Here we provide software to help you to calculate the baud rate you need.<\/p>\n\n\n\n<p>Click&nbsp;<a href=\"https:\/\/github.com\/SeeedDocument\/CAN_BUS_Shield\/raw\/master\/resource\/CAN_Baudrate_CalcV1.3.zip\">here<\/a>&nbsp;to download the software, it\u2019s in Chinese, but it\u2019s easy to use. Here is the interface translated for easier usage:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/github.com\/SeeedDocument\/CAN_BUS_Shield\/blob\/master\/image\/CAN_BUS_Shield_SetBaud.jpg?raw=true\" alt=\"\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Open the software, what you need to do is to set the baud rate you want, and then do some simple setting, then click&nbsp;calculate.<\/li><li>Then you will get some data, cfg1, cfg2 and cfg3.<\/li><li>You need to add some code to the library.<\/li><li>Open&nbsp;mcp_can_dfs.h, you need to add below code at about line 272<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>#define MCP_16MHz_xxxkBPS_CFG1 (cfg1)    \/\/ xxx is the baud rate you need\n#define MCP_16MHz_xxxkBPS_CFG2 (cfg2)\n#define MCP_16MHz_xxxkBPS_CFG3 (cfg2)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Then let\u2019s go to about line 390, add below code:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>#define CAN_xxxKBPS NUM       \/\/ xxx is the baudrate you need, and NUM is a number, you need to get a different from the other rates.<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Open&nbsp;mcp_can.cpp, goto the function&nbsp;mcp2515_configRate(at about line 190), then add below code:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>case (CAN_xxxKBPS):\n    cfg1 = MCP_16MHz_xxxkBPS_CFG1;\n    cfg2 = MCP_16MHz_xxxkBPS_CFG2;\n    cfg3 = MCP_16MHz_xxxkBPS_CFG3;\n    break;<\/code><\/pre>\n\n\n\n<p>That\u2019s all! Now, you can use the baud rate you need!<\/p>\n\n\n\n<p>If you want to connect the shield to your automobile, you can check out this <a href=\"https:\/\/www.seeedstudio.com\/DB9-to-OBD2-Cable-With-Switch-p-2872.html\">OBD&gt;DB9 cable<\/a>.&nbsp;This cable allows you to connect to an OBD-connector and DB9-connector easier for you to read data and control your car. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><a href=\"https:\/\/www.seeedstudio.com\/DB9-to-OBD2-Cable-With-Switch-p-2872.html\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/files.seeedstudio.com\/wiki\/CAN_BUS_Shield\/image\/obd_cable.jpg\" alt=\"\" width=\"298\" height=\"223\"\/><\/a><\/figure><\/div>\n\n\n\n<p>Want to debug your CAN BUS? Check out this <a href=\"https:\/\/www.seeedstudio.com\/USB-CAN-Analyzer-p-2888.html\">USB-CAN Analyzer<\/a>! With it, you can easily import the acquired CAN-BUS data to your computer for analysis. With the help of the supporting software, you can use this USB-CAN Analyzer to develop, test, manage, and maintain CAN Bus network, as well as receiving, sending, analyzing CAN data.&nbsp; <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.seeedstudio.com\/USB-CAN-Analyzer-p-2888.html\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-15.png\" alt=\"\" class=\"wp-image-33380\" width=\"303\" height=\"247\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-15.png 315w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-15-300x246.png 300w\" sizes=\"(max-width: 303px) 100vw, 303px\" \/><\/a><\/figure><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"text-decoration: underline;\">Alternative CAN BUS module<\/span><\/h2>\n\n\n\n<p>If your project is space limited and also doesn&#8217;t need other functions except for CAN-BUS, here is a Grove CAN-BUS module which is Arduino compatible, more compact, and cost-effective. It is also based on the MCP2515 and MCP2551 module. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.seeedstudio.com\/wp-content\/uploads\/2020\/06\/image-14.png\" alt=\"\" class=\"wp-image-33379\" width=\"304\" height=\"236\" srcset=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-14.png 325w, https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-14-300x232.png 300w\" sizes=\"(max-width: 304px) 100vw, 304px\" \/><figcaption><a href=\"https:\/\/www.seeedstudio.com\/Serial-CAN-BUS-Module-based-on-MCP2551-and-MCP2515.html\">Serial CAN-BUS Module based on MCP2551 and MCP2515<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"text-decoration: underline;\">Other CAN-BUS Products You Can Try<\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.seeedstudio.com\/wio-esp32-can-dev-kit-p-5466.html\" target=\"_blank\" rel=\"noreferrer noopener\">Wio ESP32 CAN Dev Kit\u00a0<\/a><\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/b5e839932a12c6938f4f9ff16fa3726a\/4\/5\/45-font_2.jpg\" alt=\"\" width=\"376\" height=\"282\"\/><\/figure><\/div>\n\n\n\n<p><strong><a href=\"https:\/\/www.seeedstudio.com\/wio-esp32-can-dev-kit-p-5466.html\" target=\"_blank\" rel=\"noreferrer noopener\">Wio ESP32 CAN Dev Kit<\/a> <\/strong>is based on the <strong>ESP32C3<\/strong> and uses the\u00a0<strong>Wio-E5 STM32WLE5JC<\/strong> module as\u00a0the Long Range controller. It supports <strong>CAN FD &amp; CAN2.0<\/strong> communication and <strong>features outstanding RF performance<\/strong> and <strong>high extensibility<\/strong>. It&#8217;s ideal for car hacking and Long Range sensor network management.<\/p>\n\n\n\n<p>This is an upgraded version of the Wio-E5 CAN Dev Kit,\u00a0<strong>it consists of a Wio ESP32 CAN bus Dev Board, an antenna(EU868\/US915), a U.FL antenna, and a waterproof case.<\/strong><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.seeedstudio.com\/LoRa-E5-CAN-FD-dev-kit-CANBUS-p-5398.html\" target=\"_blank\" rel=\"noreferrer noopener\">Wio-E5 CAN FD Dev Kit<\/a><\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/b5e839932a12c6938f4f9ff16fa3726a\/1\/0\/102991697_front-05.jpg\" alt=\"\" width=\"416\" height=\"312\"\/><\/figure><\/div>\n\n\n\n<p><a href=\"https:\/\/www.seeedstudio.com\/LoRa-E5-CAN-FD-dev-kit-CANBUS-p-5398.html\" target=\"_blank\" rel=\"noreferrer noopener\">Wio-E5 CAN Development Kit<\/a> is based on the <strong>Wio-E5 STM32WLE5JC<\/strong> Module and supports <strong>CAN FD<\/strong>, <strong>CAN2.0<\/strong>, and <strong>RS485 communication<\/strong>. It supports industrial standards, provides a waterproof case and solar charging interface, and comes with high extensibility and compatibility. It&#8217;s ideal for car hacking and Long Range sensor network management.<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.seeedstudio.com\/CAN-BUS-FD-HAT-for-Raspberry-Pi-p-4742.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=4742&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">2-Channel CAN-BUS(FD) Shield for Raspberry Pi<\/a><\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/b5e839932a12c6938f4f9ff16fa3726a\/1\/0\/103990563_preview-07.png\" alt=\"\" width=\"444\" height=\"333\"\/><\/figure><\/div>\n\n\n\n<p><a href=\"https:\/\/www.seeedstudio.com\/CAN-BUS-FD-HAT-for-Raspberry-Pi-p-4742.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=4742&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">The\u00a02-Channel CAN-BUS(FD) Shield for Raspberry Pi<\/a>\u00a0is based on<strong>\u00a0<a href=\"https:\/\/files.seeedstudio.com\/wiki\/CANBUS-HAT-for-Raspberry-Pi\/MCP2518FD-Data-Sheet-20006027A.pdf\">MCP2518 CAN FD<\/a><\/strong><a href=\"https:\/\/files.seeedstudio.com\/wiki\/CANBUS-HAT-for-Raspberry-Pi\/MCP2518FD-Data-Sheet-20006027A.pdf\"> <strong>Controller<\/strong><\/a>\u00a0and\u00a0<a href=\"https:\/\/github.com\/SeeedDocument\/2-Channel-CAN-BUS-FD-Shield-for-Raspberry-Pi\/raw\/master\/res\/MCP2557-datasheet.pdf\"><strong>MCP2557 CAN FD Transceiver<\/strong><\/a>\u00a0which communicates with Raspberry Pi via the<strong> high-speed SPI interface<\/strong>.\u00a0It supports\u00a0<strong>CAN FD<\/strong> (CAN with Flexible Data-Rate) protocol is an upgraded version of the traditional CAN BUS that increases the CAN\u2019s transmission rate from 1Mbps to 8Mbps. At the same time, CAN FD improves real-time performance and extends user data frames, providing higher efficiency.<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.seeedstudio.com\/Grove-CAN-BUS-Module-based-on-GD32E103-p-5456.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=5456&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">Grove &#8211; CAN BUS Module<\/a><\/h3>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/b5e839932a12c6938f4f9ff16fa3726a\/1\/1\/114992978_front-05.jpg\" alt=\"\" width=\"379\" height=\"284\"\/><\/figure><\/div>\n\n\n\n<p>This <a href=\"https:\/\/www.seeedstudio.com\/Grove-CAN-BUS-Module-based-on-GD32E103-p-5456.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=5456&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">Grove &#8211; CAN BUS Module<\/a> based on GD32E103 adopts a brand-new design, uses the\u00a0<strong>cost-effective\u00a0and high-performance GD32E103 microcontroller<\/strong>\u00a0as the main control, and cooperates with a firmware we wrote to complete the function of the serial port to CAN FD.<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.seeedstudio.com\/CANBed-Arduino-CAN-BUS-Development-Kit-Atmega32U4-with-MCP2515-and-MCP2551-p-4365.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=4365&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">CANBed &#8211; Arduino CAN-BUS Development Kit<\/a><\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/b5e839932a12c6938f4f9ff16fa3726a\/1\/0\/102991321-45-font-all.jpg\" alt=\"\" width=\"402\" height=\"302\"\/><\/figure><\/div>\n\n\n\n<p><a href=\"https:\/\/www.seeedstudio.com\/CANBed-Arduino-CAN-BUS-Development-Kit-Atmega32U4-with-MCP2515-and-MCP2551-p-4365.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=4365&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">CANBed &#8211; Arduino CAN-BUS Development Kit<\/a> embeds an\u00a0<strong>ATmega32U4 chip<\/strong>, which means you don\u2019t need to add other jump wires to another Arduino Board, it is an Arduino board itself plus\u00a0MCP2515\u00a0CAN Bus controller\u00a0and MCP2551 CAN Bus transceiver!\u00a0<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.seeedstudio.com\/CAN-BUS-OBD-II-RF-Dev-Kit-p-5140.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=5140&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">CAN BUS OBD-II RF Dev Kit<\/a><\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/b5e839932a12c6938f4f9ff16fa3726a\/1\/1\/110061304_can_bus_obd-ii_rf_dev_kit_all-13-min.png\" alt=\"\" width=\"455\" height=\"341\"\/><\/figure><\/div>\n\n\n\n<p><a href=\"https:\/\/www.seeedstudio.com\/CAN-BUS-OBD-II-RF-Dev-Kit-p-5140.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=5140&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">CAN BUS OBD-II RF Dev Kit<\/a> helps you\u00a0communicate wirelessly with your vehicle&#8217;s OBD-II interface using RF (Radio Frequency) through hundreds of meters, which means you can remotely process your vehicle property value data. We also provide tutorials based on Arduino about how you start with it and get data from vehicles.<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.seeedstudio.com\/Arduino-OBD2-Reader-Kit-p-5009.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=5009&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">CAN Bus Car Hacking Kit with Wio Terminal<\/a><\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/b5e839932a12c6938f4f9ff16fa3726a\/w\/e\/wechatimg3937_1.png\" alt=\"\" width=\"483\" height=\"272\"\/><\/figure><\/div>\n\n\n\n<p>This <a href=\"https:\/\/www.seeedstudio.com\/Arduino-OBD2-Reader-Kit-p-5009.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=5009&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">CAN Bus Car Hacking Kit<\/a> provides you with everything you need to hack your car, with a Wio Terminal, an OBD2 connector, and a Grove Serial CAN Bus Module. Almost all modern vehicles have an OBD2 interface. This kit enables you to get all the car information and even control the car through the OBD2 interface. It will be enjoyable for both beginners and experts alike.<\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.seeedstudio.com\/OBD-II-CAN-BUS-Development-Kit-p-2993.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=198&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">OBD-II CAN-BUS Development Kit<\/a><\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media-cdn.seeedstudio.com\/media\/catalog\/product\/cache\/b5e839932a12c6938f4f9ff16fa3726a\/h\/t\/httpsstatics3.seeedstudio.comseeedfile2017-11bazaar619187_bazaar613020_img_4697aa.jpg\" alt=\"\" width=\"415\" height=\"311\"\/><\/figure><\/div>\n\n\n\n<p>This <a href=\"https:\/\/www.seeedstudio.com\/OBD-II-CAN-BUS-Development-Kit-p-2993.html?queryID=bdaf76c35aa539e54d406fcf9c6c454b&amp;objectID=198&amp;indexName=bazaar_retailer_products\" target=\"_blank\" rel=\"noreferrer noopener\">OBD-II CAN-BUS Development Kit<\/a> is the perfect solution for you to communicate with your vehicle&#8217;s OBD-II interface without visiting a mechanic. It includes a\u00a0Serial CAN Bus module, an OBD-II Connector, and other accessories to help you do all the diagnostics and data logging with ease. We also provide a tutorial which is based on Arduino and you can easily obtain data from your vehicle by following this tutorial.\u00a0<\/p>\n\n\n\n<div style=\"height:\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"text-decoration: underline;\">Applications of CAN<\/span><\/h2>\n\n\n\n<p>Now you have learnt how to interface a CAN-BUS module with the Arduino, what are some of the applications of CAN?<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> Electronic Gear Shift System<\/li><li>Main Interface in Automation (like industrial)<\/li><li>Medical Equipment<\/li><li>Robotics<\/li><li>Auto Start\/Stop of Car Engine <\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>That&#8217;s all for today tutorial on MCP2515 CAN-BUS with the Arduino. Hope you learnt something new!<\/p>\n\n\n\n<p>Have questions on CAN or the tutorial? Just leave a comment in the comments down below! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to use a microcontroller like your Arduino and its peripheral devices to<\/p>\n","protected":false},"author":2781,"featured_media":33382,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"iawp_total_views":0,"footnotes":""},"categories":[1],"tags":[6,2144,2141,2143,2093],"class_list":["post-33373","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-arduino","tag-arduino-can-bus","tag-can-bus","tag-can-bus-system","tag-mcp2515"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MCP2515 CAN-BUS Arduino Tutorial - Getting started, Interfacing, Applications - Latest News from Seeed Studio<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MCP2515 CAN-BUS Arduino Tutorial - Getting started, Interfacing, Applications - Latest News from Seeed Studio\" \/>\n<meta property=\"og:description\" content=\"If you want to use a microcontroller like your Arduino and its peripheral devices to\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/\" \/>\n<meta property=\"og:site_name\" content=\"Latest News from Seeed Studio\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-04T20:15:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-16T03:38:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png\" \/>\n\t<meta property=\"og:image:width\" content=\"272\" \/>\n\t<meta property=\"og:image:height\" content=\"88\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"yida\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"yida\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/\",\"name\":\"MCP2515 CAN-BUS Arduino Tutorial - Getting started, Interfacing, Applications - Latest News from Seeed Studio\",\"isPartOf\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png\",\"datePublished\":\"2020-06-04T20:15:29+00:00\",\"dateModified\":\"2022-09-16T03:38:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/6457c21fb5499f36fcf657d48dc4380e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#primaryimage\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png\",\"contentUrl\":\"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png\",\"width\":272,\"height\":88,\"caption\":\"MCP2515 CAN-BUS Arduino Tutorial - Getting started, Interfacing, Applications\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.seeedstudio.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MCP2515 CAN-BUS Arduino Tutorial &#8211; Getting started, Interfacing, Applications\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#website\",\"url\":\"https:\/\/www.seeedstudio.com\/blog\/\",\"name\":\"Latest News from Seeed Studio\",\"description\":\"Emerging IoT, AI and Autonomous Applications on the Edge\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/6457c21fb5499f36fcf657d48dc4380e\",\"name\":\"yida\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/91a6af461a3a3af5aa79654f77822c7f?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/91a6af461a3a3af5aa79654f77822c7f?s=96&r=g\",\"caption\":\"yida\"},\"url\":\"https:\/\/www.seeedstudio.com\/blog\/author\/yida\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MCP2515 CAN-BUS Arduino Tutorial - Getting started, Interfacing, Applications - Latest News from Seeed Studio","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/","og_locale":"en_US","og_type":"article","og_title":"MCP2515 CAN-BUS Arduino Tutorial - Getting started, Interfacing, Applications - Latest News from Seeed Studio","og_description":"If you want to use a microcontroller like your Arduino and its peripheral devices to","og_url":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/","og_site_name":"Latest News from Seeed Studio","article_published_time":"2020-06-04T20:15:29+00:00","article_modified_time":"2022-09-16T03:38:36+00:00","og_image":[{"width":272,"height":88,"url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png","type":"image\/png"}],"author":"yida","twitter_card":"summary_large_image","twitter_misc":{"Written by":"yida","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/","url":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/","name":"MCP2515 CAN-BUS Arduino Tutorial - Getting started, Interfacing, Applications - Latest News from Seeed Studio","isPartOf":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#primaryimage"},"image":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#primaryimage"},"thumbnailUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png","datePublished":"2020-06-04T20:15:29+00:00","dateModified":"2022-09-16T03:38:36+00:00","author":{"@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/6457c21fb5499f36fcf657d48dc4380e"},"breadcrumb":{"@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#primaryimage","url":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png","contentUrl":"https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png","width":272,"height":88,"caption":"MCP2515 CAN-BUS Arduino Tutorial - Getting started, Interfacing, Applications"},{"@type":"BreadcrumbList","@id":"https:\/\/www.seeedstudio.com\/blog\/2020\/06\/05\/mcp2515-can-bus-arduino-tutorial-getting-started-interfacing-applications\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.seeedstudio.com\/blog\/"},{"@type":"ListItem","position":2,"name":"MCP2515 CAN-BUS Arduino Tutorial &#8211; Getting started, Interfacing, Applications"}]},{"@type":"WebSite","@id":"https:\/\/www.seeedstudio.com\/blog\/#website","url":"https:\/\/www.seeedstudio.com\/blog\/","name":"Latest News from Seeed Studio","description":"Emerging IoT, AI and Autonomous Applications on the Edge","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.seeedstudio.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/6457c21fb5499f36fcf657d48dc4380e","name":"yida","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seeedstudio.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/91a6af461a3a3af5aa79654f77822c7f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/91a6af461a3a3af5aa79654f77822c7f?s=96&r=g","caption":"yida"},"url":"https:\/\/www.seeedstudio.com\/blog\/author\/yida\/"}]}},"modified_by":"Kelvin","views":120810,"featured_image_urls":{"full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"thumbnail":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16-80x80.png",80,80,true],"medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"medium_large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"large":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"1536x1536":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"2048x2048":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"visody_icon":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",32,10,false],"magazine-7-slider-full":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"magazine-7-slider-center":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"magazine-7-featured":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"magazine-7-medium":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false],"magazine-7-medium-square":["https:\/\/www.seeedstudio.com\/blog\/wp-content\/uploads\/2020\/06\/image-16.png",272,88,false]},"author_info":{"display_name":"yida","author_link":"https:\/\/www.seeedstudio.com\/blog\/author\/yida\/"},"category_info":"<a href=\"https:\/\/www.seeedstudio.com\/blog\/category\/news\/\" rel=\"category tag\">News<\/a>","tag_info":"News","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/33373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/users\/2781"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/comments?post=33373"}],"version-history":[{"count":6,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/33373\/revisions"}],"predecessor-version":[{"id":71573,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/posts\/33373\/revisions\/71573"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media\/33382"}],"wp:attachment":[{"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/media?parent=33373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/categories?post=33373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.seeedstudio.com\/blog\/wp-json\/wp\/v2\/tags?post=33373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}