Skip to the content
4 layers90.5 × 68.6 mmMESC brain board, the printed circuit board in 3D

A control theory and software development repo for a balancing robot.

Size
90.5 × 68.6 mm
Copper layers
4
Thickness
1.6 mm
Parts
55
Nets
103
Pads
245
Tracks, vias
414, 45
Pours
6
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
3 Aug 2025
Updated
24 Jun 2026

Overview

MESC brain board is an open-source printed circuit board by owhite, from the owhite/balancing-robot-notes repository on GitHub, published under the MIT licence. It is a 4-layer board of 90.5 × 68.6 mm with 55 parts on 103 nets, routed with 414 tracks and 45 vias.

It is built around the ESP32-WROOM-32D, TL3342F160QG and BAT54S. Its parts include 8 connectors, 5 ICs, 3 capacitors, 3 switches and 1 diode. It belongs with the robots and motor control boards and the ESP32 and NXP (LPC, Kinetis, i.MX RT) boards of this library.

Main components

3

README

PCBs/brainboardV1.4/README.md

MESC BRAIN BOARD

A PCB and software development project for a balancing robot.

The goal is to use a hobby Electronic Speed Controller (one open source example, and this circuit for a brain board, a teensy 4.0, and an ESP-32, in combination with MESC firmware.

GENERAL APPROACH

A separation of concerns is divided across these architectures:

  • Teensy: Runs the high-level brain → gait generator, balance estimator, RC inputs
  • MESC: The firmware on the ESC for control → torque or velocity loops per joint
  • ESP32: Easy to log and analyze later → pumps UDP to the computer
  • Desktop computer → perfectly adequate way of viewing high speed data with UDP

TEENSY 4.0

  • 600+ MHz ARM Cortex-M7 — plenty of headroom for filtering, control loops, gait logic, telemetry
  • Tons of I/O for IMU, encoders, RC input, WiFi (via ESP add-on), etc.
  • Precise timing with elapsedMicros or interrupts for deterministic control
  • Great for real-time control, sensor fusion, and behavior modeling

MESC MOTOR CONTROLLER

  • Deploys on simple DIY or commercially available ESC boards
  • Executes low-level Field-Oriented Control (FOC) motor control
  • Built-in support for encoders, FOC, and torque estimation
  • Accurate low-level motor control using current sensing
  • Reads angular position from the MT6701 encoder via SPI or PWM
  • UART/CAN interface (RX + TX) Real-time communication with the Teensy
  • PWM / FOC commutation w/ efficient, smooth motor operation

OTHER BRAIN BOARD FEATURES

  • RC receiver connector (for PWM/PPM/SBUS input)
  • ESP32 UART serial programmer
  • Power input connector
  • Voltage divider (to monitor battery voltage)
  • Push-button E-stop connector
  • Power button (for system on/off)
  • IMU connector (e.g., MPU-6050)
  • Buzzer (for system alerts or E-stop signal)
  • MESC I/O
  • Reserved 2 GPIO pins on Teensy for emergency shutoff to MESC
  • CAN connector (for MESC motor control)

CAN BUS

  • Full-duplex communication between Teensy and motor controllers
  • Carries:
    • Commands: set_torque, set_velocity, enable_motor, zero_encoder, etc.
    • Telemetry: encoder position, estimated torque, velocity, fault codes
  • Real-time performance with minimal latency
  • Can support multiple motor controllers on the same bus

MANY THANKS

This project would never happen without:

NOTES

Ever wanted to change all the names of kicad files at once?

use this:

text
python3 replace_kicad_names.py VESC_brain_board MESC_brain_board

[LINK]

STILL NEEDS WORK

  • Not great design w/ DC-DC conversion from high voltage VBat
  • Replace out the IMU for a ICM-42688-P
  • Order / revise pushbuttons for programming the ESP32
  • Ensure 3.3V CAN transciever

VERSIONS

  • See github tag pcb-v1 for V1.0
  • Retreive with this command: "git checkout pcb-v1"

Parts

55
QtyValueFootprintReferences
610kResistor_SMD:R_0603_1608Metric1k_1, 10k_1, 10k_4, 10k_5, 10k_7, 10k_8
5100nFCapacitor_SMD:C_0603_1608MetricDC_1, DC_2, DC_3, DC_4, DC_6
320kResistor_SMD:R_0603_1608Metric20k_1, 20k_3, R20k_4
3Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ12, J13, J15
210uFCapacitor_SMD:C_0805_2012MetricC21, DC_5
21kResistor_SMD:R_0603_1608Metric1k_21, 1k_22
2Conn_01x01Connector_Wire:SolderWire-2sqmm_1x01_D2mm_OD3.9mmJ24, J25
2Conn_01x06Connector_JST:JST_PH_B6B-PH-K_1x06_P2.00mm_VerticalMESC1, MESC2
2TL3342F160QGButton_Switch_SMD:SW_Push_SPST_NO_Alps_SKRKS11, S12
1120Resistor_SMD:R_0603_1608MetricR_120
15kResistor_SMD:R_0603_1608Metric5k_2
190kResistor_SMD:R_0603_1608Metric90k_1
1BAT54SPackage_TO_SOT_SMD:SOT-23-3D22
1BLUELED_SMD:LED_0603_1608MetricD_BLU2
1C_Polarized_Small_USCapacitor_Tantalum_SMD:CP_EIA-3216-18_Kemet-AC22
1Conn_01x01Connector_PinSocket_2.54mm:PinSocket_1x01_P2.54mm_VerticalJ22
1Conn_01x04Connector_JST:JST_PH_B4B-PH-K_1x04_P2.00mm_VerticalCAN1
1Conn_01x08Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalMP1
1Conn_01x18Connector_PinSocket_2.54mm:my_PinSocket_3x07_P2.54mm_VerticalJ1
1ESP32-WROOM-32DRF_Module:ESP32-WROOM-32DU11
1LD1117S18TR_SOT223Package_TO_SOT_SMD:SOT-223-3_TabPin2U21
1LED BLULED_SMD:LED_0603_1608MetricD_BLU1
1LED GRNLED_SMD:LED_0603_1608MetricD_GRN1
1LED REDLED_SMD:LED_0603_1608MetricD_RED1
1SERIAL1Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ14
1SW_SPDTButton_Switch_THT:SW_NKK_BB15AHSW_SPDT21
1SolderJumper_3_OpenJumper:SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mmJP1
1SpeakerCDS-13138-SMT-TR:SPKR_CDS-13138-SMT-TRLS1
1TJA1050T/CM,118Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU1
1TL3342F160QGButton_Switch_SMD:SW_SPST_B3SL-1022PS1
1Teensy4.0teensy:Teensy40U2
1my_BC337Package_TO_SOT_SMD:SOT-23Q1
1my_buck_boostConverter_DCDC:my_buck_boostU22

The 51 most common of 55 parts.

More from owhite/balancing-robot-notes

7
  • 4 layers84.5 × 64 mmMESC brain board, the printed circuit board in 3D

    MESC brain board

    owhite/balancing-robot-notes

    A control theory and software development repo for a balancing robot.

    59 partsMIT
  • 4 layers84.5 × 64 mmMESC brain board, the printed circuit board in 3D

    MESC brain board

    owhite/balancing-robot-notes

    A control theory and software development repo for a balancing robot.

    53 partsMIT
  • 4 layers84.5 × 64 mmMESC brain board, the printed circuit board in 3D

    MESC brain board

    owhite/balancing-robot-notes

    A control theory and software development repo for a balancing robot.

    45 partsMIT
  • 2 layers59.1 × 59.1 mmESC caddyV1.0, the printed circuit board in 3D

    ESC caddyV1.0

    owhite/balancing-robot-notes

    A control theory and software development repo for a balancing robot.

    26 partsMIT
  • 2 layers49.7 × 38 mmMoteus adaptor, the printed circuit board in 3D

    Moteus adaptor

    owhite/balancing-robot-notes

    A control theory and software development repo for a balancing robot.

    14 partsMIT
  • 4 layers38.4 × 30 mmMT6701 ENCODER, the printed circuit board in 3D

    MT6701 ENCODER

    owhite/balancing-robot-notes

    A control theory and software development repo for a balancing robot.

    11 partsMIT
  • 2 layers13.9 × 23.1 mmMT6701 ENCODER, the printed circuit board in 3D

    MT6701 ENCODER

    owhite/balancing-robot-notes

    A control theory and software development repo for a balancing robot.

    7 partsMIT

Similar boards

  • 2 layers74.9 × 59.7 mmEMS BUS, the printed circuit board in 3D

    EMS BUS

    JakobThiessen/SmartHome_EMS-BUS-WI-FI-GATEWAY

    ESP32-EMS WiFi gateway for read and control EMS and Heatronic compatible devices such as boilers, thermostats, solar modules and heat pumps.

    51 parts1
  • 2 layers60 × 100 mmRgb controller, the printed circuit board in 3D

    Rgb controller

    Sanderhuisman/rgb_controller

    69 partsApache-2.0
  • 4 layers16.9 × 119.4 mmOrbit, the printed circuit board in 3D

    Orbit

    earthtojake/text-to-cad

    Design physical products with AI

    182 parts26kMIT
  • 2 layers192.4 × 50 mmOmote, the printed circuit board in 3D

    Omote

    OMOTE-Community/OMOTE-Hardware

    Open Source Remote - Hardware

    187 parts157GPL-3.0
  • 2 layers37.5 × 99 mmDiy oled 3d controller, the printed circuit board in 3D

    Diy oled 3d controller

    open3doled/open-3d-oled

    If running windows 11 or 10 with DPI scaling be sure to disable it as follows. 1) Right click properties on 3dplayer.exe in the 3DPlayer folder 2) Click on "Compatability" tab then click on the button at the bottom…

    42 parts98
  • 8 layers424.5 × 336.3 mmBarebones, the printed circuit board in 3D

    Barebones

    nzevh/barebones

    fully open source laptop based on the RK3588 Soc

    1,033 parts23CERN-OHL-S-2.0

Questions

How big is the MESC brain board PCB?

It measures 90.5 × 68.6 mm and has 4 copper layers, 1.6 mm thick.

What parts does the MESC brain board use?

55 parts, built around the ESP32-WROOM-32D, TL3342F160QG and BAT54S. 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 MESC brain board KiCad files?

From the owhite/balancing-robot-notes repository on GitHub, at the commit this page was made from: the board is PCBs/brainboardV1.0/MESC_brain_board.kicad_pcb and its schematic PCBs/ESC_caddyV1.0/ESC_caddyV1.0.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the MESC brain board 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).