Skip to the content
2 layers73.1 × 58.9 mmESP32CanBoard, the printed circuit board in 3D

ESP32CanBoard

ieb/CanDiagnose5

Small firmware to run on an ESP32 and diagnose devices and messages on a canbus.

Size
73.1 × 58.9 mm
Copper layers
2
Thickness
1.6 mm
Parts
35
Nets
30
Pads
122
Tracks, vias
265, 15
Pours
2
Routed
Yes
KiCad
KiCad 4
Created
27 Oct 2021
Updated
19 Apr 2026

Overview

ESP32CanBoard is an open-source printed circuit board by ieb, from the ieb/CanDiagnose repository on GitHub. It is a 2-layer board of 73.1 × 58.9 mm with 35 parts on 30 nets, routed with 265 tracks and 15 vias.

It is built around the RS485, SP3481CN-L and TJA1050. Its parts include 8 connectors, 7 diodes, 6 resistors, 4 capacitors and 4 ICs. It belongs with the interfaces and adapters boards and the ESP32 and RISC-V boards of this library.

Main components

3

README

README.md

Can Diagnose

Runs on a ESP32 with a webserver exposing an API to diagnose and monitor CanBus traffic. Based on Datadisplay and DeviceAnalyser from the NMEA2000 libraries.

  • Setup Wifi
  • Setup MDNS registration
  • Implement webserver
  • Serve files from Flash (SPIFFS)
  • Implement data api /api/data/ where n == 0-10.
  • Expose set of standard CAN messages on /api/data
  • Implement simple UI in Javascript hosted on SPIFFS, targetting eink and normal browsers (based on SignalK eink)
  • Implement BPM280 source
  • Implement calibration mechanism using DAC
  • [Fail] Implement ADC Source

The ESP32 ADC source cannot be made reliable enough or accurate enough to be used to monitor a battery. It is possible to get down to a 0.2% error with a callibrated lookup table, however the ADC mechamism (Sucessive Aproximation Register) produced noisy values that are frequetly as much as +- 3%. At 12.6v this is 0.4v which is unworkable. Offsetting the voltage with a precision opamp so the ESP32 reads from 11 to 15v would reduce this to 0.15v, however this is still to large to be usable. Multi sampling helps generate a stable reading, however this requires 64 samples with a /5 moving average so over at least 60s. This does give and acceptable accuracy, but the speed of measuring the voltage is close to unworkable.

All attenuations were tried, and 1,2,4,16,32,64 clock divisions were tried to see if the rate of the SAR made any difference. It does not appear to change the results.

On that basis, I am giving up on using the ESP32 ADC for this purpose.

It still provides a good platform for a Wifi data server, and Can reader.

  • Redesign PCB to use 16bit ADC over i2c (ADS1115)
  • Implement ADC sensor code.
  • Implement admin interface.
  • Support configuration and calibration via web browser.
  • Support Configuraiton of single and differential ADC.
  • Add OLED display
  • Add touch sensor to control oled display
  • Bench Calibrate expecialy shunt
  • Install test and calibrate. - Failed, the distance beween the board and the batteries is too great to get reliable shunt measurements.
  • Investigate using a shunt amplifier as used by VRA Alternator controll
  • Implement remote battery sensor using Modbus (see BatterySensor project)
  • Reimplement PCB to have no BME280 and no ADS1115 replacing with a RS485 interface to ModBus devices. (see CanPressure for Can based pressure, humidity, temperature sensor)
  • Implement Modbus master

Usage

The device will boot and connect to wifi controlled by its burned in config file (data/config.txt). There are 2 modes it can run in, a WiFi client or a AP. If its configured to be an AP, then join its network. If its a client find its ip. From now on this will be

Go to its ip on http:// and you will see a data view of the data it is capturing. Go to http:///admin.html and you will see a admin view with the ability to upload a new configuration file and reboot.

Both these views ae SPAs served from static files burned into the ESP32 Flash using APIs.

Connecting to the serial port monitor allows lower level control and diagnostics, enter 'h' to get help.

Developing

Project uses PlatformIO in VSCode. WebUI is in ui/einkweb with build files added to data/ to be built into a flash image using ./buidui.sh

PIO commands

because I alwaysforget.

  • pio run -t upload
  • pio device monitor

See buildui.sh for SPIFFS image commands.

Connectors

text
---------------------------------------------
|           a b c d e f g h                 |
|  A                                        |
|  B                                        |
|  C                                        |
|  D                                     H  |
|  E                                     I  |
|  F                                     J  |
|  G           i j k l m                 K  |
---------------------------------------------

a  SPI BL   GPIO13
b  SPI RST  GPIO12
c  SPI DC   GPIO26
d  SPI CS   GPIO25
e  SPI SCK  GPIO33
f  SPI MOSI GPIO32
g  SPI GND  
h  SPI 3V    
i  i2c GND      Display black/blue
j  i2c SCL  D5    Display green
k  i2c SDA  D18    Display white
l  i2c BTN  D19    Display yellow
m  i2c 3V       Display red

eInk Waveshare display

This uses SPI output only with a bunch of additional pins.

text
eInk DIN <-  f  SPI MOSI GPIO32
eInk CLK <-  e  SPI SCK  GPIO33
eInk CS  <-  d  SPI CS   GPIO25
eInk DC  <-  c  SPI DC   GPIO26
eInk RST <-  b  SPI RST  GPIO12
eInk BUSY -> a  SPI BL   GPIO13

4 inch TFT display 480x320 24 bit colour driven by a ILI9488 driver.

uses SPI + a PWM blacklight. Control via a TPP233 Touch switch. Library is TFT_eSPI library. Pin mappings defined as compile definitions.

text
-D TFT_MISO=GPIO_NUM_35
-D TFT_MOSI=GPIO_NUM_32
-D TFT_SCLK=GPIO_NUM_33
-D TFT_CS=GPIO_NUM_25
-D TFT_DC=GPIO_NUM_26
-D TFT_RST=GPIO_NUM_27
-D TFT_PWM_BL=GPIO_NUM_14
-D ILI9488_DRIVER

The display sleeps after 60s of inactivity to reduce power drain, but turning off the backlight. Sleeping the IMI9488 driver has not been done as of yet. Pages are implemented as classes using widgets. When a page is selected it is allocated into heap and does not exist while not displaying. On other drivers here all pages were compiled in, however the RAM usage is higher on account of full colour and display size.

In most cases attempts to update the screen, on screen causes flickering so double buffering of updates is done using sprits with DMA transfers from the sprite to the screen. Images for screen are stored in jpg on flash, consuming about 30KB per screen.

Drawing to sprites also works in 1bpp, 4bpp or 16bpp.

TFT case

3d printed case, with 2 touch sensors and round shielded cable, as ribbon will emit too much interference to nearby devices.

Wires

|| color || designation || ESP32 Pin ||

| Red | 5v | 5v | | black | 0v | 0v | | pink | CS | GPIO_NUM_25 | | cyan | Reset | GPIO_NUM_27 | | white | DC/RS | GPIO_NUM_26 | | blue | SDI(MOSI) | GPIO_NUM_32 | | green | SCK | GPIO_NUM_33 | | grey | LED | GPIO_NUM_14 | | Purple | SDO(MISO) | GPIO_NUM_35 | | Orange | 3.3v | 3.3v | | Brown | Touch Lower | GPIO_NUM_19 | | Yellow | Touch Top | TBD |

Due to the additional touch pins a fresh PCB is probably needed.

Parts

35
QtyValueFootprintReferences
5SMBJ30CA-TR TSVDiodes_SMD:DO-214ABD101, D102, D103, D104, D203
44K7Resistors_SMD:R_0805R11, R16, R17, R101
4CONN_1Connect:1pinP3, P4, P5, P6
4ThermistorResistors_SMD:R_1812TH1, TH2, TH101, TH102
2100nFCapacitors_SMD:C_0805C101, C105
21N5819Diodes_SMD:D_1206D105, D204
1100uFCapacitors_SMD:C_1210C205
11WireConnect:bornier3K1
11uFCapacitors_SMD:C_1210C206
12K2Resistors_SMD:R_0805R15
13K3Resistors_SMD:R_0805R14
1500mA ThermistorResistors_ThroughHole:Resistor_Horizontal_RM7mmTH201
1CANConnect:bornier4P101
1DCDCConverterDivers:DC-DC-ConverterU5
1DisplayPin_Headers:Pin_Header_Straight_1x05P103
1DsiplayPin_Headers:Pin_Header_Straight_1x08P104
1ESP32DevDivers:ESP32DevU1
1RS485Connect:bornier4P102
1SP3481CNHousings_SOIC:SOIC-8_3.9x4.9mm_Pitch1.27mmIC101
1TJA1050Housings_SOIC:SOIC-8_3.9x4.9mm_Pitch1.27mmU102

More from ieb/CanDiagnose

1
  • 2 layers102.8 × 42 mmBatteryMonitor, the printed circuit board in 3D

    BatteryMonitor

    ieb/CanDiagnose

    Small firmware to run on an ESP32 and diagnose devices and messages on a canbus.

    28 parts5

Similar boards

  • 2 layers45.5 × 45.1 mmSwitch, the printed circuit board in 3D

    Switch

    BASM/sh

    Smart House

    32 partsMIT
  • 4 layers100 × 80 mmBluePillComNode, the printed circuit board in 3D

    BluePillComNode

    SimulatedFlow/kicad-board-2026-07-27-bluepillcomnode

    STM32 Bluepill ComNode - industrial comms carrier with RS485, CAN bus and 0-10V analog interface. Hand-solderable THT, bare PCB. KiCad source files.

    26 parts
  • 2 layers118.7 × 40.6 mmEsp32-c3-board waveshare, the printed circuit board in 3D

    Esp32-c3-board waveshare

    ieb/N2KNMEA0183Wifi

    Exposes NMEA2000 and BMS data over BLE for Apps to use. Also supports Wifi/http/tcp/udp services.

    30 parts2
  • 2 layers99.7 × 50.2 mmTrainAutomator, the printed circuit board in 3D

    TrainAutomator

    MichMich/DigitalTrainController

    Work in progress ...

    42 parts4
  • 2 layers29.4 × 11.2 mmUSB Serial, the printed circuit board in 3D

    USB Serial

    yuqlid/USB-Serial

    小型USBシリアル変換基板 Type-Cコネクタ版

    21 parts3MIT
  • 2 layers91.4 × 91.4 mmBixi, the printed circuit board in 3D

    Bixi

    msherman13/bixi

    36 parts1
  • 2 layers115 × 45 mmOpenBilgeAlarm, the printed circuit board in 3D

    OpenBilgeAlarm

    Miceuz/OpenBilgeAlarm

    An open source bilge water level alarm system

    59 partsApache-2.0
  • 2 layers100 × 93 mmSpeeduino base, the printed circuit board in 3D

    Speeduino base

    Tjeerdie/SPECTRE

    Speeduino compatible engine control unit (ECU) based around black STM32F407VET6 board.

    213 parts59GPL-3.0

Questions

How big is the ESP32CanBoard PCB?

It measures 73.1 × 58.9 mm and has 2 copper layers, 1.6 mm thick.

What parts does the ESP32CanBoard use?

35 parts, built around the RS485, SP3481CN-L and TJA1050. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the ESP32CanBoard KiCad files?

From the ieb/CanDiagnose repository on GitHub, at the commit this page was made from: the board is pcb/ESP32CanBoard.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the ESP32CanBoard design in my own project?

Its repository states no licence, so its author keeps all rights: ask ieb before reusing the design.