Skip to the content
4 layers166.3 × 70 mmGanglia, the printed circuit board in 3D

Ganglia is an open BLDC / brushed motor driver platform — custom PCB hardware plus STM32 firmware that runs a real-time control loop on top of FreeRTOS.

Size
166.3 × 70 mm
Copper layers
4
Thickness
1.6 mm
Parts
202
Nets
179
Pads
642
Tracks, vias
3,694, 1,253
Pours
66
Routed
Yes
KiCad
KiCad 4
Created
3 Jul 2026
Updated
3 Jul 2026

Overview

Ganglia is an open-source printed circuit board by H2O-Tnp, from the H2O-Tnp/ganglia repository on GitHub. It is a 4-layer board of 166.3 × 70 mm with 202 parts on 179 nets, routed with 3,694 tracks and 1,253 vias.

It is built around the 74LVCH245AD, MAX3485ED and LM324, with the AT24C64CN, LM1117-3.3 and TPS2041BDGN among its other parts. Its parts include 72 resistors, 54 capacitors, 22 transistors, 18 diodes and 10 ICs. It belongs with the robots and motor control boards of this library.

Main components

12

README

README.md

Ganglia

Ganglia is an open BLDC / brushed motor driver platform — custom PCB hardware plus STM32 firmware that runs a real-time control loop on top of FreeRTOS. It targets robotics joints and similar position/velocity controlled actuators, exposing the driver over Modbus (RS-485) and USB CDC.

Repository layout

text
ganglia/
├── PCB/         Schematics and board layouts (gEDA, KiCad, plus legacy ATmel + TI variants)
│   ├── V1, V2, V2.01, V2.02, V3.01    Hardware revisions
│   ├── R1.01, R1.03, STMVersionV1     Production / STM-based revisions
│   └── KICAD_V3.01                    Current KiCad project
├── software/
│   ├── stm32/   Main firmware (this is what you'll usually build)
│   ├── asf_based/   Older ATmel-Studio-Framework firmware
│   ├── test01/      Bench / scratch code
│   └── plot_BLDC.m  MATLAB/Octave plotting helper for motor_log.txt
└── SelfDocs/Circuits/   LaTeX (circuitikz) notes

Firmware (software/stm32)

  • MCU family: STM32F4 (STM32F405RG) or STM32F3 (STM32F303RC), selected at configure time
  • RTOS: FreeRTOS (CMSIS-RTOS port, CM4F/CM3)
  • Peripherals: ADC (current sensing), TIM (encoder + PWM), SPI (absolute encoder), USART/RS-485 (Modbus), USB CDC (debug console), IWDG
  • Control: PID position / velocity / torque loop with profile generator (sine, ramp, square — see recent commits) and homing
  • Configuration: register-mapped — every tunable is a Modbus register, persisted to on-chip EEPROM emulation
  • Build artefacts: STM32Ganglia.elf, .hex, .bin, plus a CRC-appended STM32Ganglia-CRC.hex for use with the v3 bootloader

Module map

PathPurpose
src/main.cpp, startup, HAL MSP, syscalls
control/PID + outer control loop (Control.cpp, pid.cpp)
Motor/Motor commutation / drive abstraction
Encoder/Quadrature + SPI absolute encoder
profile/Motion profile generator
homing/Homing state machine
Modbus/RS-485 + Modbus ASCII slave
Registers/Register map — settings, status, control, stream data
tasks/FreeRTOS task entry points (control, Modbus, CAN)
usbd*/ST USB device + CDC class glue
eeprom/EEPROM emulation + Modbus binding
wdg/, MicroTime/, AveragingBuffer/, CircularBuffer/Support utilities

Building

The build is CMake-driven and expects ST's CubeF3/F4 packages plus FreeRTOS and srecord on disk. Point these env vars at the right places before configuring:

VariableMeaning
STM_FAMILYSTM32F4 or STM32F3
STM_COMMONRoot of the STM32CubeF{3,4} package (contains Drivers/, Middlewares/)
FREE_RTOSRoot of the FreeRTOS source tree
SRECORDDirectory containing srec_cat.exe (used to append the CRC)
CPREFCross-compiler prefix, typically arm-none-eabi

Then, from software/stm32:

sh
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../gcc_arm_none_eabi.cmake
make -j

The custom target produces both a plain STM32Ganglia.hex and STM32Ganglia-CRC.hex. Use the CRC version with ganglia-bootloader-v3; the plain one is fine for ST-Link / DFU flashing of a bare board.

Flashing

  • ST-Link / OpenOCD: openocd -f ganglia.cfg (uses stlink-v2-1 + stm32f4x).
  • DFU (single board): dfu-util -a 0 -d 0483:df11 -s 0x08000000:leave -R -D STM32Ganglia.bin
  • DFU (multiple boards in parallel): see multiburn, which fans out dfu-util across several USB ports at once.

On Linux you'll want a udev rule so dfu-util can talk to the device without root — see the snippet at the bottom of CMakeLists.txt.

Hardware

The PCB/ tree is the full history of the board, including the early ATmel/TI prototypes. The active design lives in PCB/KICAD_V3.01. Older gEDA-PCB files (Intelcont*.pcb, main_Atmel*.sch) are kept for archaeology.

Branching

This repo started life under Mercurial (.hgflow, .hgignore) and uses a hgflow-style layout: master is stable, develop is the integration branch, features live on feature/*, releases on release/*, hotfixes on hotfix/*.

Versioning

Firmware / hardware versions are baked into software/stm32/inc/version.h (HW_VERSION, SW_VERSION). Bump SW_VERSION on releases.

Parts

202
QtyValueFootprintReferences
2210kResistors_SMD:R_0603R3, R12, R16, R20, R21, R23, R24, R26, R29, R35, R38, R41, R43, R44, R46, R48 +6
180.01 uFCapacitors_SMD:C_0603C5, C6, C10, C11, C12, C14, C15, C16, C24, C27, C50, C51, C53, C55, C56, C59 +2
12150Resistors_SMD:R_0603R18, R19, R28, R30, R37, R40, R52, R55, R59, R62, R65, R81
70.1 uFCapacitors_SMD:C_0603C7, C13, C19, C20, C47, C49, C52
7CONN_01X01HG_Devices:AWG12GND, GND2, P5, P6, P7, PWR, PWR2
60.47uCapacitors_SMD:C_0603C23, C26, C48, C54, C57, C58
61Resistors_SMD:R_0603R31, R32, R33, R34, R83, R84
6BSS123Housings_SOT-23_SOT-143_TSOT-6:SOT-23Q3, Q4, Q13, Q14, Q15, Q16
6BUK969R3HG_Devices:sot404Q7, Q8, Q9, Q10, Q19, Q20
6PMD3001DHG_Devices:SOT457Q5, Q6, Q11, Q12, Q17, Q18
6PMEG6010Diodes_SMD:SOD-323D5, D6, D7, D8, D9, D11
6SMAJ16C 16VHG_Devices:DO-214ACZ1, Z2, Z10, Z11, Z12, Z13
41 uFCapacitors_SMD:C_0603C2, C17, C18, C42
4220Resistors_SMD:R_0603R4, R6, R27, R53
4ESH2PDHG_Devices:DO-220AAZ4, Z6, Z7, Z9
4LEDLEDs:LED-0603LED1, LED2, LED3, LED4
30.1 uF polyethyleneHG_Devices:WIMA2824C29, C30, C37
3100kResistors_SMD:R_0603R90, R91, R92
310uF 6.3VCapacitors_SMD:C_1206C22, C28, C31
322kResistors_SMD:R_0603R5, R7, R25
327kResistors_SMD:R_0603R36, R39, R42
333kResistors_SMD:R_0603R47, R50, R79
3BZX384CxxxDiodes_SMD:SOD-323D14, Z3, Z5
3R_ZeroResistors_SMD:R_0201R8, R13, R17
20.1uCapacitors_SMD:C_0603C41, C61
21.2kResistors_SMD:R_0603R45, R49
21nCapacitors_SMD:C_0603C39, C60
227Resistors_SMD:R_0603R10, R11
233 pFCapacitors_SMD:C_0603C1, C3
2ACS712Housings_SOIC:SOIC-8_3.9x4.9mm_Pitch1.27mmU6, U7
2BC807-40Housings_SOT-23_SOT-143_TSOT-6:SOT-23Q1, Q2
2EHS2PDHG_Devices:DO-220AAZ14, Z15
2Jack3PHG_Devices:78171-0003J5, J6
2RResistors_SMD:R_0603R67, R68
2ZENERcpavlina:SOD-80D13, Z8
10.01uCapacitors_SMD:C_0603C34
10.1uFCapacitors_SMD:C_0603C32
110 uF 50VCapacitors_SMD:c_elec_5x5.7C4
1100 uF 25V LOW ESRCapacitors_SMD:c_elec_8x6.5C21
11000uF 50V electrolyteCapacitors_ThroughHole:C_Radial_D16_L25_P7.5C25
111kResistors_SMD:R_0603R9
112kResistors_SMD:R_0603R2
11kResistors_SMD:R_0603R22
11uFCapacitors_SMD:C_0603C33
12.7kResistors_SMD:R_0603R14
168kResistors_SMD:R_0603R15
174LVCH245HG_Devices:QFN4525-20U4
1AT24C64CHousings_SSOP:TSSOP-8_4.4x3mm_Pitch0.65mmU2
1BC817-40Housings_SOT-23_SOT-143_TSOT-6:SOT-23Q21
1BD9G341EFJHousings_SOIC:SOIC-8-1EP_3.9x4.9mm_Pitch1.27mmU1
1BYG23M-E3HG_Devices:DO-214ACD2
1CCapacitors_SMD:C_0603C43
1CONN_01X05HG_Devices:78171-0005P1
1LM1117-3.3SMD_Packages:SOT-223U5
1LM324Housings_SSOP:TSSOP-14_4.4x5mm_Pitch0.65mmU11
1MAX3485Housings_SOIC:SOIC-8_3.9x4.9mm_Pitch1.27mmU8
1MPZ2012S101AT 0.02 OhmsCapacitors_SMD:C_0805L2
1NX8045GBHG_Devices:2-SMDX1
1Q_PMOS_GSDHousings_SOT-23_SOT-143_TSOT-6:SOT-23Q22
1R_ZeroResistors_SMD:R_0603R1
1SAM3S4CHousings_QFP:LQFP-100_14x14mm_Pitch0.5mmU10
1SRR6038-150Y 15 uHHG_Devices:SRR6038L3
1SS14-E3HG_Devices:DO-214ACD1
1TPS2041BDGNHousings_SSOP:MSOP-8-1EP_3x3mm_Pitch0.65mmU3
1USB_BConnect:USB_Micro-BP3
1Variable_ResistorHG_Devices:3314GR85
1ZENERHG_Devices:DO-214ACD4

More from H2O-Tnp/ganglia

2
  • 4 layers69.9 × 59.7 mmBLDC 4, the printed circuit board in 3D

    BLDC 4

    H2O-Tnp/ganglia

    Ganglia is an open BLDC / brushed motor driver platform — custom PCB hardware plus STM32 firmware that runs a real-time control loop on top of FreeRTOS.

    169 parts
  • 2 layers57.2 × 33.8 mmDOACon, the printed circuit board in 3D

    DOACon

    H2O-Tnp/ganglia

    Ganglia is an open BLDC / brushed motor driver platform — custom PCB hardware plus STM32 firmware that runs a real-time control loop on top of FreeRTOS.

    18 parts

Similar boards

  • 4 layers42 × 65 mmIcarus Flight Computer, the printed circuit board in 3D

    Icarus Flight Computer

    daedalus-ind/icarus-hardware

    Hardware of the onboard flight computer for the Icarus rocket.

    106 parts2MIT
  • 4 layers229 × 157 mmOMower, the printed circuit board in 3D

    OMower

    vasimv/OMower

    SDK for open-source open-hardware 2/4 wheels robots platform

    421 parts11GPL-3.0
  • 4 layers58.9 × 48.4 mmApppd, the printed circuit board in 3D

    Apppd

    chithigun23/ANUFS-APPPD

    An update to the Accelerator Pedal Position Plausibility Device to remain compliant with the use of a paddle shift system.

    103 parts
  • 4 layersIONPAK2, the printed circuit board in 3D

    IONPAK2

    m-labs/ionpak

    A modern, low-cost universal controller for hot-cathode ionization vacuum gauges. (WIP)

    259 parts23
  • 2 layers91.4 × 40.6 mmMhixy, the printed circuit board in 3D

    Mhixy

    iblue/mhi-xy-bus

    Reverse engineering of the Mitsubishi Heavy Industries X/Y Bus as used in FDUM air condition

    70 parts6
  • 2 layers150 × 80 mmRpi extension, the printed circuit board in 3D

    Rpi extension

    andriy-bilynskyy/rpi-extension

    This project is a PCB design to create SDR transceiver using Raspberry Pi and Radioberry boards. Simple connection of boards seems incomplete:

    97 partsMIT
  • 2 layers105 × 50 mmMagneto chico, the printed circuit board in 3D

    Magneto chico

    MarianoDel/kicad_magneto_chico

    Placa para el magneto chico

    53 parts

Questions

How big is the Ganglia PCB?

It measures 166.3 × 70 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Ganglia use?

202 parts, built around the 74LVCH245AD, MAX3485ED, LM324 and AT24C64CN. 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 Ganglia KiCad files?

From the H2O-Tnp/ganglia repository on GitHub, at the commit this page was made from: the board is PCB/KICAD_V3.01/ganglia.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Ganglia design in my own project?

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