Site Information

 Loading... Please wait...

CAN Bus, SAE J1939, NMEA 2000 Programming With ESP32, Supporting USB, Bluetooth, BLE, And WiFi

Posted by Wilfried Voss on

The  ESP32 Series of modules by Espressif supports the integration of WiFi, Bluetooth, and Bluetooth LE for a wide range of applications, most prominently for IoT (Internet of Things). For instance, using WiFi ensures connectivity within a large radius. Using Bluetooth allows the user to easily detect (with low-energy beacons) a module and connect it to a smartphone. Furthermore, the module adds priceless functionality and versatility to applications with in-built antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules. In addition, all ESP32 Series of modules maintain an extended operating temperature range of -40°C to 105°C in support of commercial application development.

ESP32 Resources

ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Module

ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Module

We at Copperhill Technologies are using the ESP32 to address the growing demand for wireless communication and create a product line of CAN Bus, SAE J1939, and NMEA 2000 gateways with USB, Bluetooth, BLE, and WiFi capability.

We offer a variety of  ESP32-Powered CAN Bus Modules, but in the following we focus on the ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Module. However, the instructions to follow also apply to the CAN Bus FeatherWing For ESP32.

This board comes with an onboard ESP32 WROOM-32 WiFi, Bluetooth Classic, BLE Module, and a CAN Bus port with a transceiver. Also, onboard is an RGB LED, IO pins on a 0.1" pad.

Programming is accomplished through the popular Arduino IDE connected to the USB-to-Serial converter with USB-C connector, automatic bootloader and reset.

How To Install the ESP32 Module into the Arduino IDE

The Arduino Integrated Development Environment (IDE) is a cross-platform application (for Windows, macOS, Linux) written in functions from C and C++. It is used to write and upload programs to Arduino compatible boards and, with the help of third-party cores, other vendor development boards such as the ESP32 module.

The Arduino IDE is a free download available at:

Once you have installed the IDE, you need to go through a few more steps to install and use your ESP32 Board in Arduino IDE. For more information, see:

Note: In the above referenced link, i.e., in section "Testing your ESP32 Board," select the Adafruit ESP32 Feather.

Arduino CAN Bus Library for ESP32

The Arduino Library for ESP32 CAN Bus (ESP32-Arduino-CAN) is available as a free download from the Github website. The code provides full support for the onboard SJA1000 CAN Bus controller, and there are examples on how to use the code.


  • Support the CAN Bus from the ESP32 (SJA1000)
  • CAN Messages send and receive
  • Various Bus speeds
  • Standard and Extended Frames
  • CAN Message Filter

Download the code at:

You can use the code "as is," you can implement it directly into your project. As an alternative, you can also create a new library that will be incorporated into the Arduino IDE. For more information, see:

ESP32 CAN Bus Demo Application

In addition to the usage examples,  SKPang Electronics has created a demo program that works directly with our ESP32-CAN board:

ESP32 - SAE J1939 and NMEA 2000 Implementation

We at Copperhill Technologies already provide a free-of-charge  SAE J1939 protocol stack for the Arduino platform, which currently supports the Arduino Uno, Mega 2560, and Due. We are working on adding support for our Teensy-CAN products as well as the ESP23.

We are also implementing a NMEA 2000 protocol stack since it is a derivative of SAE J1939, i.e., the code extensions are relatively minimal. See also:

The NMEA 2000 implementation comes with a considerable price tag (as described in above referenced post), which means that the protocol stack will not be free-of-charge. We will incorporate the code into our ESP32 hardware to create a NMEA 2000 protocol converter to support USB, Bluetooth, BLE, and WiFi.

Internet of Things Projects with ESP32: Build exciting and powerful IoT projects using the all-new Espressif ESP32Internet of Things Projects with ESP32: Build exciting and powerful IoT projects

The ESP32, a low-cost MCU with integrated Wi-Fi and BLE capabilities, comes with various modules and development boards for building IoT applications efficiently. Wi-Fi and BLE are standard network stacks for Internet-of-Things applications providing cost-effective solutions for your business and project requirements.

This book is a fundamental guide for developing ESP32 programs and starts by explaining GPIO (General Purpose I/O) programming with sensor devices. Next, the reader gets up to speed with ESP32 development through several IoT projects such as weather stations, sensor loggers, smart homes, Wi-Fi cams, and Wi-Fi wardriving. Finally, the reader learns how to use ESP32 boards to facilitate interactions between mobile applications and cloud servers, such as AWS.

By the end of this book, the reader knows how to control a range of IoT projects using the ESP32 chip.

More Information...