The ESP32 processor, integrating peripherals such as UART, CAN Bus, WIFI, and Bluetooth, allows a wide range of applications, and the low price adds to its popularity.
There are various ESP32 development boards available in the market, such as the ESP32-WROOM-32, as shown to the left. However, compared to popular systems like the Raspberry Pi or Arduino, the hardware resources, i.e., additional peripherals, are limited.
Consequently, the thought of tapping into the vast resources of the Raspberry Pi or Arduino system makes sense. In this post, I am using several of our Raspberry Pi CAN boards and accessing them per one of our ESP32 modules. This post's method also applies to any other ESP32 module that provides external SPI and UART signals.
Note: For more detailed information on the ESP32 SPI interface, please refer to another post, ESP32 Triple CAN Bus Application Through Adding Two MCP2515 Ports.
Connecting Arduino Shields to ESP32
This part is for those curious enough to ask why I didn't use the vast Arduino hardware resources (shields): As I mentioned in the above referenced post, the ESP32 uses a 3.3 VDC SPI signal level, which will not work with the 5 VDC signal level as used on Arduino shields. For the same reason, most Arduino shields will not work with the Arduino Due, which also uses 3.3 VDC.
Connecting Raspberry Pi PICAN HATs to ESP32
Please be aware that each ESP32 module might have different assignments for the SPI signals, i.e., MOSI, MISO, SCLK, and CS. Even the nomenclature of these signals may differ. But, as demonstrated below, the wiring is fairly straight-forward. The below diagram shows the necessary SPI signals on an ESP32-WROOM-32 development board as well as the RPi's 40-pin GPIO header:
The wiring is fairly easy:
ESP32 ----> RPi HAT
SCK ----> SCK SPI Data Output
MISO ----> MISO SPI Clock Input
MOSI ----> MOSI SPI Data Input
CS/SS ----> CS Chip Select
Again, refer to above referenced post for more information.
PICAN CAN Bus HAT For Raspberry Pi
The PICAN series of boards provides Controller Area Network (CAN) Bus capabilities for the Raspberry Pi. It comes with an easy-to-install SocketCAN driver, programming can be accomplished in C or Python, and we provide many programming samples and further references.
The PICAN series supports many hardware variants, including single- or dual channel ports, isolated or non-isolated, Classical CAN or CAN FD, NMEA 2000, plus additional features such as GPS, Gyro, Accelerometer, and Real-Time Clock (RTC).
All of the boards supporting Classical CAN use the MCP2515 CAN Bus controller, and so I was able to access all boards using the same software, and that includes the PICAN DUO boards. The software allows the use of multiple instances to access more than one SPI port. However, the RPi's GPIO header provides only two CS (Chip Select) signals, thus limiting the number of SPI ports to two.
The image on top of the page shows a setup with the PICAN-M - NMEA 0183 and NMEA 2000 HAT for Raspberry Pi. The NMEA 2000 port is controlled by the MCP2515, while the NME 0183 port is connected to the RPi's UART0_TX, and UART0_RX signals.
Electronics Projects with the ESP8266 and ESP32: Building Web Pages, Applications, and WiFi Enabled Devices
Copperhill Technologies highly recommends using this book for your wireless application projects. Yes, many good books and free online resources are available these days, but this is the book we are using. It made our approach to Bluetooth, BLE, and WIFI a breeze. Programming wireless applications without hassles was fun, and we will share them on this web page.
Projects throughout the book utilize the wireless functionality and processing power of the ESP microcontrollers. Projects are built in the Arduino IDE, so you don't need to download other programming software. In addition, mobile apps are now ubiquitous, making the app build projects of the book very relevant, as are the web page design projects.
In Electronics Projects with the ESP8266 and ESP32, you'll see how easy and practical it is to access information over the internet, develop web pages, build mobile apps to remotely control devices with speech recognition, or incorporate Google Maps in a GPS route tracking app. More Information...
I want to reiterate a point made in a previous post ("A Beginner's Guide to SAE J1939 Embedded Software Development"): When developing and testing your CAN Bus application, may it be Classical CAN, CAN FD, CANopen, SAE J1939, or NMEA 2000, you need to connect your device to a functional network. One solitary node connected to your [...]
This post is a follow-up on NMEA 2000 Data Scanner with Bluetooth, BLE for Android, iOS, PC Applications. In this new post, I also include SAE J1939, since NMEA 2000 is based on J1939. Also, in this particular case, instead of the NMEA2000-compatible 5-pin M12 connector, I used a DSUB9 as it applies to the CAN Bus [...]
Our N2K-BT gateway functions as a NMEA 2000 to Bluetooth data scanner for any host device with a Bluetooth or BLE (Bluetooth Low Energy) port, such as PCs, phones, or tablets. Therefore, it supports operating systems such as Windows, Linux, iOS, Android, and more. In addition, the wireless communication protocol employs easy-to-read and easy-to-process ASCII [...]
The following is a follow-up on our post Controller Area Network (CAN), SAE J1939, NMEA 2000 Wireless Module for IoT and ELD Applications. The CAN Bus, SAE J1939 and NMEA 2000 to Bluetooth Gateway is the first product of a new series of wireless gateways for IoT (Internet of Things), ELD (Electronic Logging Devices), and other applications. At the [...]
Due to the global shortage of electronic components, we at Copperhill Technologies began rethinking our strategy regarding new developments. Luckily, that change turned out to be a blessing in disguise because the transition from NXP LPC to the ESP32 processor opened the door to more industrial and automotive applications, especially those involving wireless transmissions for [...]
Like many other businesses, we have to deal with the global shortage of electronic components. For instance, the NXP LPC 17xx processors we used for our SAE J1939 gateways and the starter kit are not available at this time. Even worse, there is no reliable information if/when production resumes. This situation forced us to rethink [...]
This post will demonstrate how to add a CAN Bus port to the ESP32-WROOM32 development board, i.e., regarding hardware and software. Download this post as PDF... As a matter of fact, we already offer a hardware utilizing the ESP32 processor and an onboard CAN Bus transceiver as shown in the image to the left. The ESP32 WiFi, Bluetooth [...]
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 [...]
Kvaser introduced their DIN Rail SE410S-X10 Ethernet-to-CAN(FD) multi-channel interface with additional I/O support through add-on modules.Kvaser supplies advanced CAN Bus solutions to engineers designing and deploying systems in areas as wide-ranging as trucks and buses, petrol-driven and electric cars, industrial automation, avionics, construction equipment, building automation, domestic appliances, marine, medical, military, railway, telecoms, textiles and more.The [...]