Site Information

 Loading... Please wait...

Blog

Embedded CAN Bus, SAE J1939, NMEA 2000 Development With ESP32

Posted by Wilfried Voss on

ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Module

Like many businesses in the CAN Bus marketplace, we have struggled with the global shortage of electronic components. For instance, our SAE J1939 gateways are equipped with NXP processors, mainly the LPC1754 and LPC1768. Unfortunately, both processors are currently unavailable, and they come with remarkably long delivery times that go well into next year. We still have inventory for some modules, but our most successful SAE J1939 gateways sold out quickly. However, every challenge comes with a motivation to solve the problem quickly, and we have done so by using off-the-shelf CAN Bus modules based on the ESP32 processor.

For instance, we have replaced our  SAE J1939 ECU Simulator Board With USB Port with the ESP32-based SAE J1939 To USB Gateway. The gateway functionality is 100% identical; the only difference is with the CAN hardware connection and the firmware update process.

The transformation process involved porting our SAE J1939 protocol stack to the ESP32, which was not difficult since the original version was developed for the Arduino line of CPU boards (Arduino Uno, Mega 2560, Due). The result was a very small memory footprint and a significant level of portability. Converting the stack to the LPC1754/1768 went fast and smooth as with the ESP32.

More Information on the SAEJ1939 ProtocolStack for Arduino...

For the CAN Bus hardware, we used the  ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Module by SK Pang Electronics. It comes with all the features required for a professional SAE J1939 gateway. That includes an extended input power range and extended temperature range. And we know out of years-long experience that we can rely on SK Pang's hardware; their electronic components are well designed, and the failure rate is neglectable.

The challenge of creating a new product also came with a blessing in disguise. The ESP32 processor provides vastly more memory resources and execution speed than the LPC processors, which opens the door for extended applications, most importantly IoT Connectivity.

The ESP32 is a series of low-cost, low-power system-on-chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series employs a Tensilica Xtensa LX6 microprocessor in both dual-core and single-core variations and includes built-in antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules.

ESP32 Features

  • 240 MHz dual core Tensilica LX6 microcontroller with 600 DMIPS
  • Integrated 512 KB SRAM
  • Integrated 802.11b/g/n HT40 WiFi transceiver, baseband, stack and LWIP
  • Integrated dual mode Bluetooth (classic and BLE)
  • 4 MByte flash included in the WROOM32 module
  • On-board PCB antenna
  • Programming via USB-C connector
  • CAN Bus transceiver
  • SPI, IIC, I2S, UART ports accessible through onboard connections
  • ADC, DAC channels accessible through onboard connections
  • External power supply (nominal: 12 VDC) with reverse polarity protection
  • Extended operating temperature range of -40C to +85C

For more technical information on CAN Bus programming with the ESP32, see our post:
CAN Bus, SAE J1939, NMEA 2000 Programming With ESP32, Supporting USB, Bluetooth, BLE, And WiFi...

ESP32 CAN Bus Modules

We at Copperhill Technologies currently offer two programmable CAN Bus modules based on the ESP32processor.

ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus ModuleOur ESP32 WiFi, Bluetooth Classic, BLE, CAN Bus Module 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.

There are multiple development resources, including sample code, schematics, data sheets, and more.

ESP32 Feather CAN Bus To IoT Module

The ESP32 Feather CAN Bus To IoT Module allows you to connect a CAN Bus network to IoT technologies such as WiFi, Bluetooth, and BLE. It combines two products, the Adafruit HUZZA32-ESP Feather and our CAN Bus Featherwing for ESP32.

The HUZZAH32 comes with the official WROOM32 module, which includes a built-in USB-to-Serial converter, automatic bootloader reset, Lithium-Ion/Polymer charger, and multiple GPIOs. 

In addition, it contains a dual-core ESP32 chip, 4 MB of SPI Flash, a tuned antenna, and all the passives you need to take advantage of this powerful new processor. The ESP32 supports both WiFi and Bluetooth Classic/LE, making it perfect for just about any wireless or Internet-connected project.

Future Application & Products

The ESP32 processor provides great memory resources and execution speed, which opens the door for extended applications and products. The Internet of Things (IoT) is one consideration for our future plans. However, before we get there, we will extend our SAE J1939 protocol stack to be NMEA 2000 compliant.

The new products in planning include:

  • CAN Bus, OBD-II, SAE J1939, NMEA 2000 Data Scanner with automatic baud rate detection
  • NMEA 2000 to USB Gateway
  • CAN Bus, OBD-II, SAE J1939, NMEA 2000 to Bluewtooth, BLE, Wifi Gateways

For more information, please feel free to contact us.