ESP8266 CAN Bus with MCP2515

I have just bought another ESP8266/NodeMCU development board cheapy from eBay (this one) with an ESP-12E chip on board. I’ve also bought an SPI-CAN bus interface with the common Microchip MCP2515 CAN controller to try and create a CAN-Wifi gateway.

The pinout for the ESP-12E NodeMCU board is apparently as below:
ESP-12E NodeMCU Pinout

There are not a lot of details on the CAN module board, but the pinout is written on it – although the Vcc voltage isn’t noted:

MCP2515 CAN-SPI Board

The MCP2151 datasheet is here. The board also uses a TJA1050 CAN Transceiver to translate the voltage levels to CAN. It appears that the MCP2151 can operate between 2.7V and 5.5V but the TJA1050 requires 5V, and since there are no voltage regulators on the board, I will assume I have to supply VCC with 5V

I’ve then found an Arduino ‘Unified CAN Bus library’ on the Arduino forums and have forked it on GitHub to start porting it to the ESP8266. This is a great idea – it’s a single library which should support many different types of MCU, across many different CAN controllers – so it should be a great place to start and would be nice to add ESP8266 compatibility to the library.

In order to test whether the CAN communication is working at all, I am using a PCAN USB Gateway from PEAK, and PiSnoop ECU Calibration Tool from Pi Innovo. The PCAN USB gateway uses the (almost) industry standard D-Sub pinout for CAN connections on DB-9 connectors shown below where CAN-H is pin 7 and CAN-L is pin 2:



Got it working – check it out here: ESP8266 Wifi CAN Gateway

4 thoughts on “ESP8266 CAN Bus with MCP2515

  1. Pingback: ESP8266 MCP2515 CAN Bus to Wifi Gateway | An Engineer's Blog

  2. Gopalakrishna

    This is a good work. Wondering if there is a schematic for the connections explained anywhere – for example, the connectors between ESP8266 and MCP2515. It would be great if any info is provided.


Leave a Reply

Your email address will not be published. Required fields are marked *