Skip to the content
2 layers64.8 × 41 mmOkayCAN, the printed circuit board in 3D

The okayest ESP32-S2 CAN development board

Size
64.8 × 41 mm
Copper layers
2
Thickness
1.6 mm
Parts
52
Nets
69
Pads
181
Tracks, vias
386, 48
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
27 Oct 2021
Updated
5 Mar 2022

Overview

OkayCAN is an open-source printed circuit board by jglim, from the jglim/OkayCAN repository on GitHub, published under the MIT licence. It is a 2-layer board of 64.8 × 41 mm with 52 parts on 69 nets, routed with 386 tracks and 48 vias.

It is built around the ESP32-S2-WROOM-N4, SN65HVD230D and MT1470, with the DFLS130L, MMSZ5254C-E3-08 and TYPE-C-31-M-12 among its other parts. Its parts include 11 resistors, 7 capacitors, 5 diodes, 3 ICs and 3 connectors. It belongs with the ESP32 boards of this library.

Main components

6

README

README.md

OkayCAN

The okayest ESP32-S2 CAN development board

Expectations shield

OkayCAN board

Features

  • Essentially an ESP32-S2 with a CAN transceiver and supporting components.
  • Native USB support, saving on an additional USB-UART chip.
  • Designed to fit a commonly available OBD enclosure and its 16-pin connectors.
  • Each board should cost about US$10 each when assembling about 10 boards, making it fairly affordable in small runs.
  • Easy to assemble/manufacture, as all components are on a single side, and most components are surface mounted.
  • Uses a USB-C connector, which is easier to interface when the device is installed in difficult-to-reach places.

Free

This project is permissively licensed (MIT)

  • No restrictions and no royalties on private / commercial use.
  • The design files (schematic, board) can be downloaded and modified to fit your own requirements.
  • Ready-to-use manufacturing files (gerbers, BOM) are also available. Send it to your preferred fab to have the boards made.
  • Please feel free to sell the boards that you have made, even if it is a 1:1 clone. There is no need for attribution too.
  • The selected iso-tp stack from lishen2 that is included in the examples is also MIT-licensed.

Get an OkayCAN

Build it yourself

  • PCB: Gerbers are zipped and ready to be uploaded to your fab
  • BOM: Almost every component has a matching LCSC part number, and the CSV works with their BOM upload feature.
    • The only odd part is the OBD2 header (with case), which has to be sourced from marketplaces like Aliexpress
  • Assembly: as most of the parts are surface-mounted, getting a stencil will make the process much quicker.

Buy one

I'm not assembling any for sale at this time, though I would love to see it being accessible to more people. If you decide to sell complete boards, please let me know so that I may be able to share about it. Everyone is welcome to create and sell clones/variants of the OkayCAN.


Firmware

OkayCAN_GettingStarted

Get started quickly with this example, which queries a (MB) ECU for parameters such as VIN, part number, and software versions, then displays it on the serial port.

The example will demonstrate communications with an ECU over UDS (a layer above CAN), as well as usage of the serial port over USB CDC. When working properly, the serial should show an output similar to this:

text
Voltage: 11993 mV
00000BBE TX ISO-TP: 22 F1 8C
00000BC3 RX ISO-TP: 62 F1 8C 33 31 33 31 XX XX XX XX
Received Serial Number: 3131XXXX
Voltage: 11979 mV
00000FA7 TX ISO-TP: 22 F1 90
00000FAC RX ISO-TP: 62 F1 90 57 44 44 32 34 36 32 30 30 31 4A XX XX XX XX XX XX
Received VIN Original: WDD2462001JXXXXXX
Voltage: 12003 mV
00001390 TX ISO-TP: 22 F1 A0
00001394 RX ISO-TP: 62 F1 A0 57 44 44 32 34 36 32 30 30 31 4A XX XX XX XX XX XX
Received VIN Current: WDD2462001JXXXXXX
Voltage: 12003 mV
00001779 TX ISO-TP: 22 F1 21
00001783 RX ISO-TP: 62 F1 21 36 35 31 39 30 34 30 33 30 31 36 35 31 39 30 32 33 31 30 31 36 35 31 39 30 33 31 34 33 31
Received Software block data:
6519040301
6519023101
6519031431
Voltage: 11984 mV
00001B62 TX ISO-TP: 22 F1 00
00001B67 RX ISO-TP: 62 F1 00 02 21 31 01
Received Variant ID: 2131
Voltage: 12003 mV

OkayCAN_OBD

UNVERIFIED: No vehicle to test on; tested against a simulated ecu on another esp32. Please let me know if this works! --jg

Queries an OBD-II compliant ECU for its engine speed, vehicle speed, and throttle position. These parameters are typically supported by most ECUs.

A open Wi-Fi network with the name "OkayCAN-OBD" is also created, and serves a simple web page over http at 192.168.4.1 . The page shows real-time results of the OBD queries as JSON if they are available.

OBD Example screenshot


Hardware

⚠️ Warning: components are rated for 12V only! Please do not connect to 24V systems.

OkayCAN V1.0

Please use the newer V1.1 as it addresses a board outline issue

Schematic (PDF)

OkayCAN schematic

TL;DR: Power: Vin (USB: 5V, OBD: 12V) with a diode "OR" into a 3.3V buck regulator (MT1470). uC: CAN_TX @ GPIO5, CAN_RX @ GPIO4, VSENSE @ GPIO2 (Divider ratio: Vin-10K,1.6K-GND) OBD: Only CAN TX/RX, VBATT and chassis GND are connected. Other pins are NC.

⚠️ The MT1470 regulator only starts operating at 4.5V, which leaves a small margin for the schottky's forward voltage when running off 5V from USB.

ℹ️ The optional 120R CAN resistors should not be populated for normal operation as the bus on the vehicle's port normally includes termination resistors.

ℹ️ Test points are available on the back. The ESP32-S2 can also be flashed with an external USB-UART with these test points (like the regular ESP32).

Board

OkayCAN board

ℹ️ V1.0 requires a minor case modification to fit properly, as the OBD connector's sides are too wide. There are two small plastic tabs on the case, near the OBD header which can be safely removed to allow the board to fit properly.

BOM

Available here. Budgetary component prices available in this extended BOM.


OkayCAN V1.1

Latest version

Minor revision to V1.0

  • Adjusted board outline to fit the standard cases without modifications
  • Added an optional user LED to GPIO16, unpopulated by default
  • Minor routing improvements, footprint positions are unchanged and a stencil from V1.0 will still work on this board

DFU

The ESP32-S2 has a USB ROM bootloader which is read-only. This guarantees that a faulty firmware will not brick the device. OkayCAN includes BOOT and RESET buttons which can be used to bring the device into DFU, to upload a new firmware.

Enter DFU mode with these steps:

  1. Press BOOT button
  2. Press RESET button
  3. Release RESET button
  4. Release BOOT button

Animated DFU instructions

The device can also be put into DFU mode using only the BOOT button. Hold down BOOT while disconnecting and reconnecting the USB cable, then release BOOT.

After flashing the firmware, remember to press RESET once, or reconnect the USB cable to exit DFU and start running your firmware.


Contributing

Please..

  • Build cool stuff with the OkayCAN (and let me know if you do, too!).
  • Point out and suggest fixes if there are any issues with the hardware design or firmware.
  • Add or improve on the existing examples.
  • If you fab these boards with a pick-and-place, I would love to hear about your experience.

Need ideas on what to build? Here are some ideas:

  • Control an instrument cluster for your racing or truck sim.
  • A vehicle communications interface e.g. a J2534 interface.
  • Wireless coding/tuning/upgrading via your phone
  • Race telemetry/logger with digital gauges

License

MIT

Parts

52
QtyValueFootprintReferences
10G***labelkibuzzard-615D3B2E, kibuzzard-615D34A6, kibuzzard-615D34B0, kibuzzard-615D34B9, kibuzzard-615D34C8, kibuzzard-615D34D3, kibuzzard-615D34D3, kibuzzard-615D34DF, kibuzzard-615D361C, kibuzzard-615D3669
30.1uFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC1, C2, C3
31.6KResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR2, R5, R11
322uFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC5, C6, C7
2100KResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR7, R9
210KResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR1, R4
25.1KResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR6, R8
2DFLS130LDiode_SMD:D_PowerDI-123D2, D4
2LEDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD1, D5
2SW_PushJGCommonFootprintLibrary:HRO-K2-1807SW1, SW2
110uHJGCommonFootprintLibrary:CHILSIN-LVF303012L1
1120RResistor_SMD:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR3
11uFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC4
131.6KResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR10
1Conn_01x04Connector_JST:JST_XH_B4B-XH-AM_1x04_P2.50mm_VerticalJ3
1ESP32-S2-WROOMJGCommonFootprintLibrary:XCVR_ESP32-S2-WROOMU1
1LOGOJGCommonFootprintLibrary:OkayCAN_SilkG***
1MMSZ5254C-E3-08Diode_SMD:D_SOD-123D3
1MT1470Package_TO_SOT_SMD:SOT-23-6_HandsolderingU3
1OBD2_ConnectorJGCommonFootprintLibrary:OBD-MaleJ1
1SN65HVD230Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU2
1TP_3V3TestPoint:TestPoint_Pad_D1.0mmTP9
1TP_BOOTTestPoint:TestPoint_Pad_D1.0mmTP3
1TP_CANHTestPoint:TestPoint_Pad_D1.0mmTP6
1TP_CANLTestPoint:TestPoint_Pad_D1.0mmTP7
1TP_GNDTestPoint:TestPoint_Pad_D1.0mmTP8
1TP_RESETTestPoint:TestPoint_Pad_D1.0mmTP4
1TP_RXTestPoint:TestPoint_Pad_D1.0mmTP2
1TP_SENSETestPoint:TestPoint_Pad_D1.0mmTP5
1TP_TXTestPoint:TestPoint_Pad_D1.0mmTP1
1TYPE-C-31-M-12JGCommonFootprintLibrary:HRO_TYPE-C-31-M-12J2

Similar boards

  • 4 layers99 × 53.3 mmPSLab, the printed circuit board in 3D

    PSLab

    fossasia/pslab-hardware

    PSLab Hardware Design and Schematics https://pslab.io

    199 parts1.7kApache-2.0
  • 2 layers65.5 × 41 mmLamps, the printed circuit board in 3D

    Lamps

    eddyem/stm32samples

    Code samples and ready projects based on bare-metal STM32

    78 parts208
  • 2 layers155 × 80 mmESP32Controller, the printed circuit board in 3D

    ESP32Controller

    simon-jouet/ESP32Controller

    ESP32-based 3D printer controller

    171 parts134
  • 2 layers27.9 × 92.7 mmESP32-S2-WROOM, the printed circuit board in 3D

    ESP32-S2-WROOM

    ccadic/ESP32-S2-DevBoardTFT

    Esp32-S2 dev board with 240x240 IPS display

    29 parts79
  • 2 layers51.1 × 30 mmFranzininho WIFI, the printed circuit board in 3D

    Franzininho WIFI

    Franzininho/Franzininho-WIFI-dev-edition

    Versão da Franzininho para teste e validação do ESP32-S2

    31 parts39
  • 2 layers124 × 35 mmWfred rev6, the printed circuit board in 3D

    Wfred rev6

    newHeiko/wiFred

    wiThrottle-compatible hardware controller

    87 parts28GPL-3.0
  • 2 layers64.3 × 25.4 mmFranzininho WiFi, the printed circuit board in 3D

    Franzininho WiFi

    Franzininho/Franzininho-WiFi

    Franzininho WiFi is a board with ESP32-S2.

    38 parts24
  • 4 layers51.3 × 23.4 mm20210211 eduino, the printed circuit board in 3D

    20210211 eduino

    ccadic/HackZeGarage

    ESP32-S2 and CC1101S 433Mhz usb stick to record and send car gates/garages data keys and open stuff

    33 parts19

Questions

How big is the OkayCAN PCB?

It measures 64.8 × 41 mm and has 2 copper layers, 1.6 mm thick.

What parts does the OkayCAN use?

52 parts, built around the ESP32-S2-WROOM-N4, SN65HVD230D, MT1470 and DFLS130L. 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 OkayCAN KiCad files?

From the jglim/OkayCAN repository on GitHub, at the commit this page was made from: the board is Hardware/V1.1/OkayCAN/OkayCAN.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the OkayCAN design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).