Skip to the content
4 layers100 × 51.5 mmSTM32 CONTROLLER DESIGN, the printed circuit board in 3D

4-layer STM32 industrial gateway bridging RS-485/Modbus-RTU and CAN — KiCad schematic/layout + C firmware

Size
100 × 51.5 mm
Copper layers
4
Thickness
1.6 mm
Parts
51
Nets
107
Pads
227
Tracks, vias
125, 0
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
12 Aug 2026
Updated
12 Aug 2026

Overview

STM32 CONTROLLER DESIGN is an open-source printed circuit board by shreyadascoder2004, from the shreyadascoder2004/stm32-can-modbus-gateway repository on GitHub, published under the MIT licence. It is a 4-layer board of 100 × 51.5 mm with 51 parts on 107 nets, routed with 125 tracks and 0 vias.

It is built around the MAX485ED, SN65HVD230D and TPS54233D, with the SS34 and SMBJ24A among its other parts. Its parts include 22 capacitors, 11 resistors, 5 ICs, 4 diodes and 4 connectors. It belongs with the interfaces and adapters boards and the STM32 boards of this library.

Main components

5

README

README.md

STM32 CAN–Modbus Industrial Gateway

A 4-layer STM32-based industrial protocol gateway that bridges RS-485/Modbus-RTU networks with CAN bus networks — designed end-to-end from schematic to PCB layout in KiCad, with C firmware handling real-time protocol translation.

Why this exists

Industrial factory floors often run a mix of legacy RS-485/Modbus-RTU equipment (sensors, PLCs, HMIs) and newer CAN-based nodes (motor controllers, automotive-grade modules). This gateway lets a Modbus master (PC, PLC, SCADA system) read and write values on CAN-based devices without either side needing to natively support the other's protocol — the same role commercial gateways (e.g. Moxa, Advantech) fill in real deployments.

How it works

  1. A Modbus master sends a request (Read Holding Registers / Write Single Register) over RS-485
  2. The STM32 receives it via UART, validates the frame (CRC16), and parses the register address and value
  3. A lookup table maps the Modbus register to a CAN ID
  4. The STM32 sends the corresponding CAN frame onto the bus
  5. A CAN node responds; the STM32 receives it, maps it back to a Modbus register, and replies to the master over RS-485

USB is reserved for local configuration/debug access.

Hardware

  • MCU: STM32F407VET6 (LQFP100)
  • Power: 24V DC input → TPS54233 buck (5V) → AP1117-33 LDO (3.3V)
  • RS-485: MAX485E transceiver, jumper-selectable termination, fail-safe biasing
  • CAN: SN65HVD230 transceiver, jumper-selectable 120Ω termination
  • Board: 4-layer stackup (Signal / GND plane / 3V3 plane / Signal), designed in KiCad — schematic, footprint assignment, and layout completed with dedicated ground and power planes

See /hardware for the full KiCad project.

Firmware

Written in C using the STM32 HAL, structured so the protocol logic is hardware-independent and separately testable:

  • modbus_crc.c — Modbus CRC16 checksum
  • modbus_parser.c — Modbus RTU frame parsing and response building
  • can_mapping.c — Modbus register ↔ CAN ID lookup table
  • main.c — HAL integration: UART receive interrupt, CAN filter/notification setup, and the gateway's main translation loop

Clock tree: 8MHz HSE crystal → PLL → 168MHz SYSCLK, with CAN bus timing configured for 500kbps on the 42MHz APB1 peripheral clock.

See /firmware for the full STM32CubeIDE project.

Status

  • Schematic: complete, ERC-clean
  • PCB layout: components placed, 4-layer stackup and plane pours complete, routing in progress
  • Firmware: compiles cleanly against the current pin mapping; logic modules (CRC, frame parsing, ID mapping) are hardware-independent and unit-testable on a PC
  • Hardware validation: pending PCB fabrication and assembly — no physical board has been tested yet

Build instructions

Hardware: open hardware/*.kicad_pro in KiCad 8+

Firmware: open firmware/ as an existing project in STM32CubeIDE, or import via File → Open Projects from File System

License

MIT

Parts

51
QtyValueFootprintReferences
12100nFCapacitor_SMD:C_0805_2012MetricC11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22
410kResistor_SMD:R_0805_2012MetricR2, R3, R6, R7
310uFCapacitor_SMD:C_0805_2012MetricC5, C7, C8
2120Resistor_SMD:R_0805_2012MetricR10, R11
220pFCapacitor_SMD:C_0805_2012MetricC9, C10
2560Resistor_SMD:R_0805_2012MetricR8, R9
2SS34Diode_SMD:D_SMAD2, D3
1100kResistor_SMD:R_0805_2012MetricR4
1100nCapacitor_SMD:C_0805_2012MetricC2
110nFCapacitor_SMD:C_0805_2012MetricC6
110uCapacitor_SMD:C_0805_2012MetricC1
12.2nFCapacitor_SMD:C_0805_2012MetricC4
122uFCapacitor_SMD:C_0805_2012MetricC3
122uHInductor_SMD:L_1210_3225MetricL1
1330Resistor_SMD:R_0805_2012MetricR5
152.3kResistor_SMD:R_0805_2012MetricR1
18MHzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
1AP1117-33Package_TO_SOT_SMD:SOT-223-3_TabPin2U2
1CAN_TERMINALTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ4
1CAN_TERM_JUMPERConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJP2
1DC_IN_24VTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ1
1LEDLED_SMD:LED_0805_2012MetricLED1
1MAX485EPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU4
1RS485_TERMINALTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3_1x03_P5.00mm_HorizontalJ3
1SMBJ24ADiode_SMD:D_SMBD1
1SN65HVD230Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU5
1STM32F407VETxPackage_QFP:LQFP-100_14x14mm_P0.5mmU3
1SWD_HEADERConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2
1SW_PushButton_Switch_SMD:SW_SPST_TL3305ASW1
1TERM_JUMPERConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJP1
1TPS54233Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU1

Similar boards

  • 2 layers100 × 80 mmMeganecan gw, the printed circuit board in 3D

    Meganecan gw

    Barbedx/MeganeCAN

    ESP32-based CAN-bus companion for Renault Megane 2 infotainment displays.

    68 parts3
  • 4 layers95.6 × 59.9 mmFlight computer rocketry, the printed circuit board in 3D

    Flight computer rocketry

    Himanshukohale22/Flight_control_controller_V1.2

    Hardware files for universal flight controller for small UAV's.

    145 parts1MIT
  • 6 layers39.7 × 48.2 mmKicad Cansat, the printed circuit board in 3D

    Kicad Cansat

    Mathou7/2627_Projet2A_Cansat

    84 parts
  • 2 layers25.4 × 25.4 mmRecitation buck converter, the printed circuit board in 3D

    Recitation buck converter

    silaswaxter/senior_design_buck_converter

    A buck converter PCB design based on TI's TPS54233 IC

    22 parts
  • 2 layers71.9 × 50 mmRejsaCAN board, the printed circuit board in 3D

    RejsaCAN board

    hancho6319/My_PCB_Designs_repo

    79 parts
  • 4 layers65 × 56 mmROCK 5 CANbus HAT, the printed circuit board in 3D

    ROCK 5 CANbus HAT

    eiten/rock5b_can_pwr

    Radxa Rock 5B CANbus and Power HAT

    41 parts

Questions

How big is the STM32 CONTROLLER DESIGN PCB?

It measures 100 × 51.5 mm and has 4 copper layers, 1.6 mm thick.

What parts does the STM32 CONTROLLER DESIGN use?

51 parts, built around the MAX485ED, SN65HVD230D, TPS54233D and SS34. 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 STM32 CONTROLLER DESIGN KiCad files?

From the shreyadascoder2004/stm32-can-modbus-gateway repository on GitHub, at the commit this page was made from: the board is STM32 CONTROLLER DESIGN.kicad_pcb and its schematic STM32 CONTROLLER DESIGN.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the STM32 CONTROLLER DESIGN 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).