Skip to the content
2 layers94.9 × 40.6 mmEsp32-c3-board bms, the printed circuit board in 3D

Esp32-c3-board bms

ieb/N2KNMEA0183Wifi2

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

Size
94.9 × 40.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
43
Nets
38
Pads
127
Tracks, vias
258, 11
Pours
4
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
6 Apr 2024
Updated
1 Sep 2026

Overview

Esp32-c3-board bms is an open-source printed circuit board by ieb, from the ieb/N2KNMEA0183Wifi repository on GitHub. It is a 2-layer board of 94.9 × 40.6 mm with 43 parts on 38 nets, routed with 258 tracks and 11 vias.

It is built around the MP2307DN-Z, AMS1117-5.0 and TJA1050. Its parts include 16 capacitors, 8 resistors, 8 connectors, 6 ICs and 3 diodes. It belongs with the radio and wireless and power boards and the ESP32 and RISC-V boards of this library.

Main components

3

README

README.md

N2K / NMEA0183 WiFi + BLE bridge

ESP32-C3 firmware that bridges an NMEA2000 (CAN) bus to WiFi and Bluetooth LE clients. Parses a working subset of N2K PGNs, emits NMEA0183 and SeaSmart over TCP/UDP/HTTP streams, serves a local web UI and admin, and publishes a compact binary boat-state feed over BLE GATT for mobile PWAs.

Also bridges a JBD / JDB BMS over TTL/UART, exposing register data both as custom PGNs on the N2K bus and as a dedicated BLE battery characteristic.

Features

  • NMEA2000 CAN node — parse + emit, built on top of the NMEA2000 library.
  • NMEA0183 generation from N2K PGNs (see lib/N2KHandler/NMEA0183N2KMessages.h).
  • TCP server on port 10110, UDP broadcast, and long-lived chunked HTTP streams (/api/nmea0183, /api/seasmart) with per-client PGN filtering.
  • SeaSmart (PCDIN) passthrough with filter negotiation.
  • BLE GATT server (BoatWatchBLE) — see docs/ble-transport.md:
    • 0xAA00 service — autopilot state, command channel, battery.
    • 0xFF00 service — navigation state (lat/lon, COG/SOG, heading, wind, depth, STW, log) and engine state (RPM, temps, volts, pressures, hours, status bits).
    • PIN-based auth with per-connection and global brute-force lockouts.
    • Fields revert to "not available" sentinels when their source PGN stops arriving (≤15 s for nav and slow-cadence engine fields; 5 s for engine-running-only fields), so clients don't see stale values.
  • JBD BMS bridge over UART — cell voltages, pack V/I/SoC, temps, FET status, errors.
  • Engine freeze-frame logging to flash (lib/freezeframe).
  • Performance calculations (polar VMG, target boat speed, target wind angle, leeway — see lib/performance).
  • Logbook to SPIFFS (lib/logbook).
  • HTTP admin interface (config upload, FS operations, reboot, status).
  • WiFi station or AP mode, mDNS.

UIs

The UIs live in their own repos and talk to the firmware over HTTP streams or BLE:

  • N2KBMSFwUi — read-only SPIFFS-hosted UI for mobile browsers.
  • N2KUi — installable PWA with admin.
  • N2KLifePo4 — installable PWA for the LiFePO4 BMS (BLE).
  • NMEA2000_Booklet — Kindle 4 booklet for use on deck in sunlight.

Hardware

Current target is an ESP32-C3 on a custom PCB (see pcb/). Brownout threshold is lowered from the 3.1 V default to 2.8 V to ride out BLE radio bring-up transients. CAN transceiver, isolated UART to the BMS, LED, and connectors are documented in the schematic.

ESP32-C3 board

HTTP API

All paths marked "admin only" require HTTP basic auth against credentials in config.txt.

MethodPathPurpose
GET/**Static file from SPIFFS (UI bundle).
GET/api/storeCurrent store snapshot, CSV.
GET/api/devicesDevices seen on the N2K bus, text.
GET/api/nmea0183Chunked NMEA0183 stream.
GET/api/seasmartChunked SeaSmart stream; ?pgns=... filters.
GET/api/status.jsonFilesystem + heap status. admin
GET/api/fs.jsonFilesystem listing. admin
POST/api/fs.jsonop=delete or op=upload (multipart). admin
GET/config.txtCurrent configuration file. admin
POST/api/reboot.jsonReboot. admin

Simulators for the HTTP/TCP/BMS side live under simulator/.

TCP / UDP (port 10110)

Emits NMEA0183 sentences by default. A client can switch its session to SeaSmart by sending a PGN filter request — once switched, the stream stays in SeaSmart mode for that client. Some noisy PGNs (e.g. Raymarine pilot updates) are filtered by default to protect bandwidth.

text
$PCDCM,1,7,127489,127505,127488,128259,129026,130312,128267*77

UDP is used for broadcast to LAN clients. Note that ChromeOS blocks UDP broadcast to Android apps running in containers, so the TCP and HTTP stream paths exist as a workaround.

BLE

See docs/ble-transport.md for the binary frame layouts, magic bytes, scaling factors, and notification cadence. Characteristics notify at ≤2 Hz when data changes, and fall back to a 1 Hz keep-alive carrying the latest values (or NA sentinels if the source PGN has gone stale).

Authentication is a 4-digit PIN (ble.pin in config.txt). Brute force is bounded by a per-connection lockout (30 s after 5 failures, disconnect after 10) and a global lockout (5 min after 20 cumulative failures across all connections). Unauthenticated clients are disconnected after 30 s.

SeaSmart format reference

SeaSmart/PCDIN sentences published on the NMEA0183 streams:

text
$PCDIN,01F119,00000000,0F,2AAF00D1067414FF*59
                                           ^^ checksum
                          ^^^^^^^^^^^^^^^^ data (whole message)
                       ^^ source
              ^^^^^^^^ hex time
       ^^^^^^ PGN
^^^^^^ NMEA0183 id

Hex time decoded as ((parseInt(value,32)/1024)+1262304000)*1000 giving ms since 1970. Reference: SeaSmart protocol PDF.

Usage

On boot the firmware reads data/config.txt from SPIFFS and either joins the configured WiFi network (station mode) or starts its own AP. Find the resulting IP, then:

  • http://<ip>/ — data / status view.
  • http://<ip>/admin.html — admin view (upload config, reboot).

A serial monitor on the ESP32 gives lower-level diagnostics; press h<CR> for a help screen. The running git SHA is printed with h.

Developing

Project uses PlatformIO. Default environment is esp32-c3.

text
pio run                                  # build firmware
pio run -t upload                        # flash firmware
pio run --target buildfs -e esp32-c3     # build SPIFFS image
pio run --target uploadfs -e esp32-c3    # flash SPIFFS image
pio device monitor                       # serial console

The SPIFFS image is populated from data/. To repopulate it from the current UI source, clone the relevant UI repo (for the read-only UI that's N2KBMSFwUi) and run its build script. Simulators under simulator/ are Node-based and useful for exercising the HTTP/TCP/BMS paths without hardware.

Known limitations / history

  • WebSockets were removed — the ESP async WebSocket library crashes when more than one client connects and the upstream bug is unfixed. Chunked HTTP streams replaced them and are stable under load.
  • Earlier PCB revisions carried a BME280, ADS1115, TFT display, touch sensors, and an OLED. These are all archived — sensing moved to external CAN-based sensors (see CanPressure) and display moved to apps. The archived code lives under lib/archive/.
  • An earlier instability was traced to blocking TCP writes hanging the main loop; fixed by moving to an async TCP server. CAN bus loaded to 100 % is handled without drops.

Layout

text
src/                 firmware entry point
lib/
  N2KHandler/        PGN parsing, NMEA0183 emitters, freeze-frame hooks
  bluetooth/         BoatWatch BLE server, engine/nav encoders
  network/           HTTP, TCP, UDP, mDNS, wifi bring-up
  jdbbms/            JBD/JDB BMS UART driver
  performance/       polar-based performance calculations
  logbook/           SPIFFS logbook writer
  freezeframe/       engine event freeze-frame recorder
  config/            config.txt loader
docs/ble-transport.md   BLE GATT + binary framing spec
simulator/           Node-based HTTP/TCP/BMS simulators
pcb/                 board design files
ui/                  scratch / local UI assets (main UIs are in separate repos)

BUGS/TODO

  • Chromebook and Phone continue to show connection instability. Probably fixed with a 500ppm SCA setting.

Chromebook and Phone continue to show connection instability.

Could be the shared WiFi/BLE chips in both devices, but could also be the ESP32 having a 500ppm sleep clock accuracy (SCA). Default with NimBLE seems to be 60ppm. I see 520 connection closed reasons in the ESP32 logs, https://github.com/apache/mynewt-nimble/issues/1777 indicates SCA could be the cause.

Testing over 48h is not conclusive since the WiFi environment is not as challenging with weak signals causing the OS interfer with BLE while prioritising Wifi. However, there seem to be fewer disconnects due to 520, and on that basis I am keeping the 500ppm setting for SCA in this commit.

Parts

43
QtyValueFootprintReferences
5100nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC1, C5, C11, C13, C105
410uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC2, C3, C4, C12
4CONN_1MountingHole:MountingHole_3.5mmP3, P4, P5, P6
310KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR2, R5, R6
21N5819Diode_SMD:D_1206_3216Metric_Pad1.42x1.75mm_HandSolderD1, D204
247KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR1, R4
1100KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR7
1100uFCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC205
110nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC10
1180pFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC7
118pFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC9
11KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR8
11uFCapacitor_SMD:C_1210_3225Metric_Pad1.33x2.70mm_HandSolderC206
122uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC6
122uHInductor_SMD:L_APV_ANR6045L1
1500mA ThermistorResistor_SMD:R_2010_5025Metric_Pad1.40x2.65mm_HandSolderTH201
16.8nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC8
18.45KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR3
1AMS1117-5.0Package_TO_SOT_SMD:SOT-223-3_TabPin2U6
1BMS UARTConnector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_VerticalP102
1CANConnector_Wire:SolderWire-1.5sqmm_1x04_P6mm_D1.7mm_OD3mmP101
1MP2307Package_SO:SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.62x3.51mmU3
1PC817Package_DIP:DIP-4_W7.62mmU4
1PowerConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ1
1SMBJ30CA-TR TSVDiode_SMD:D_SMB_HandsolderingD203
1STIS0621Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU7
1SwitchConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ2
1TJA1050Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU102
1esp32-c3-ebayiebSpecials:ESP-C3-Zero-ebayU2

More from ieb/N2KNMEA0183Wifi

3
  • 2 layers94.9 × 40.6 mmEsp32-c3-board, the printed circuit board in 3D

    Esp32-c3-board

    ieb/N2KNMEA0183Wifi

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

    32 parts2
  • 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 layers73.2 × 69.1 mmESP32CanBoard, the printed circuit board in 3D

    ESP32CanBoard

    ieb/N2KNMEA0183Wifi

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

    30 parts2

Similar boards

  • 2 layers97 × 54.3 mmAttiny3226Board, the printed circuit board in 3D

    Attiny3226Board

    ieb/N2KEngine

    N2K Single board engine monitor using a 328p

    73 parts
  • 2 layers108 × 47 mmEsp32board, the printed circuit board in 3D

    Esp32board

    ieb/N2KEngineEsp32

    N2K Engine Interface with BLE built around an ESP32 and ADS1115 ADCs

    88 parts
  • 2 layers80 × 30 mmAc sensor, the printed circuit board in 3D

    Ac sensor

    sshoecraft/ac-sensor

    AC Sensor used in hydronic HVAC system

    24 parts
  • 4 layers173.9 × 93.4 mmZ3660 v022, the printed circuit board in 3D

    Z3660 v022

    shanshe/Z3660

    Amiga 4000 CPU accelerator board based on A3660 and Z-turn FPGA board

    198 parts78GPL-3.0
  • 2 layers99.6 × 100 mmPCB Fujitora, the printed circuit board in 3D

    PCB Fujitora

    OPRobots/FujitoraBot

    Robotracer - siguelíneas de alto rendimiento; con succión, tracción brushless en sistema tetra y procesador STM32F4

    118 parts68GPL-3.0
  • 2 layers39.9 × 45 mmCanBus Radio VAG, the printed circuit board in 3D

    CanBus Radio VAG

    AugustoS97/CanBus-Radio-VAG

    CANBUS PCB to control original functions of VAG (VW, SKODA, SEAT, AUDI) cars (such us original DSP and other functions).

    35 parts16
  • 2 layers149.2 × 83.7 mmNodo BMS 1 1, the printed circuit board in 3D

    Nodo BMS 1 1

    AugustoS97/BMS-BatterySystem

    Repositorio con el diseño de un BMS y una batería como TFM

    117 parts7GPL-3.0
  • 2 layers52.3 × 50.3 mmSdisfp, the printed circuit board in 3D

    Sdisfp

    cleverfox/sdi_fiber_converter

    62 parts2

Questions

How big is the Esp32-c3-board bms PCB?

It measures 94.9 × 40.6 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Esp32-c3-board bms use?

43 parts, built around the MP2307DN-Z, AMS1117-5.0 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 Esp32-c3-board bms KiCad files?

From the ieb/N2KNMEA0183Wifi repository on GitHub, at the commit this page was made from: the board is pcb/esp32-c3-board-bms/esp32-c3-board-bms.kicad_pcb and its schematic pcb/esp32-c3-board-bms/esp32-c3-board-bms.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Esp32-c3-board bms design in my own project?

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