Skip to the content
2 layers100 × 70 mmSTM32 Buck Converter, the printed circuit board in 3D

Design, simulation and optimization-assisted digital control of a 12 V to 5 V synchronous buck converter using MATLAB/Simulink, STM32 and KiCad.

Size
100 × 70 mm
Copper layers
2
Thickness
1.6 mm
Parts
31
Nets
18
Pads
134
Tracks, vias
121, 26
Pours
3
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
24 Jul 2026
Updated
10 Aug 2026

Overview

STM32 Buck Converter is an open-source printed circuit board by MAC-75, from the MAC-75/STM32-Synchronous-Buck-Converter repository on GitHub, published under the MIT licence. It is a 2-layer board of 100 × 70 mm with 31 parts on 18 nets, routed with 121 tracks and 26 vias.

It is built around the STM32G431RBT6, LM5109BSD and TPS7A1633DGN, with the CSD18540Q5B, BAS316 and SMBJ18A among its other parts. Its parts include 9 capacitors, 4 resistors, 4 ICs, 3 connectors and 2 diodes. It belongs with the power boards and the STM32 boards of this library.

Main components

6

README

README.md

STM32-Controlled Synchronous Buck Converter

MATLAB and Simulink models of a 12 V to 5 V synchronous buck converter. The project includes averaged and PWM switching power-stage models, a digital PI-controlled averaged model, and a reproducible load-transient test. The digital-control target is an STM32G431RB.

Project status: This is a design-only project validated with MATLAB, Simulink, and automated error-level KiCad ERC/DRC checks. No physical converter prototype has been built or hardware-tested. All waveforms, plots, and performance values in this repository are simulation results, not bench measurements.

Design values

ParameterValue
Input10 to 14 V
Nominal input12 V
Output5 V
Maximum current2 A
Switching frequency100 kHz
Inductor47 µH
Output capacitor100 µF
Output-capacitor ESR20 mΩ
Nominal duty cycle41.67%

At 12 V input with a 5 Ω load, the open-loop models settle close to 5 V and 1 A. The startup ringing is from the LC output filter.

Simulation results

Averaged model

Average model voltage

Average model current

PWM switching model

Switching model voltage

Switching model current

Three closed-loop switching cases were checked independently from the averaged model. Their steady-state inductor-current ranges are 0.5970-1.4357 A at 12 V/5 ohm, 1.7332-2.2652 A at 10 V/2.5 ohm, and 1.4900-2.5089 A at 14 V/2.5 ohm. The 2.5089 A value is the simulated worst-case peak. Exported waveforms are restricted to the common time support of every source signal; the validation rejects nonfinite data, extrapolation, or current magnitude of 10 A or more.

Closed-loop load transient

The averaged closed-loop model commands 5 Ω from 0–15 ms, 2.5 Ω from 15–35 ms, and 5 Ω from 35–50 ms. The settled operating points are approximately 5 V/1 A, 5 V/2 A, and 5 V/1 A. Maximum load current is 2.105 A.

Closed-loop load-transient response

Measured voltage response:

TransitionUndershootOvershoot1% settling timeSteady-state error
Load increase at 15 ms0.497 V0.263 V0.928 ms0.000000434 V
Load removal at 35 ms0.357 V0.541 V1.320 ms0.00000744 V

See Documentation/load_transient_validation.md for the measurement method and detailed results.

Control analysis

The averaged duty-to-output plant has a complex pole pair at −1739.849 ± j14526.197 rad/s and an ESR zero at −500000 rad/s. With the manual PI gains Kp = 0.02 and Ki = 60, the nominal averaged loop has 73.877° phase margin and a 2359.620 Hz gain crossover frequency.

Manual PI loop Bode plot

See Documentation/control_analysis.md for the derivation, limitations, and generated numerical data.

The manual averaged controller's deliberately severe line test produces a 1.144 V undershoot for 12 V to 10 V and a 2.597 V overshoot for 10 V to 14 V. Both responses remain finite and settle, but they show that line feedforward or a different large-signal control strategy would be needed for a hardware-oriented design.

KiCad validation

KiCad CLI 10.0.4 reports zero schematic ERC errors, zero PCB DRC errors, and zero PCB unconnected items. The full PCB report intentionally retains warning findings for missing courtyards, silkscreen over copper, installed-library comparison, and schematic/PCB field or flat-net-name parity. No DRC category is ignored. See Documentation/kicad_design_notes.md for exact counts and limitations.

Running the models

  1. Run MATLAB/buck_parameters.m.
  2. Open a model from the Simulink folder.
  3. Run the simulation and open the voltage and current scopes.

To reproduce the configured load profile and validate every Simulink model:

matlab
addpath('MATLAB')
run('MATLAB/buck_parameters.m')
configure_load_transient_model
report = validate_project(true);

validate_project(true) updates and simulates every .slx model, checks recorded signals for finite values, validates the three load operating points, measures both voltage transitions, and regenerates Results/load_transient_response.png. Simulink cache and code-generation files are redirected to the system temporary directory.

To run the complete project validation—including control analysis, every Simulink model, averaged and switching closed-loop operating cases, transient tests, and optimization-assisted PI tuning—start a clean MATLAB session and run:

matlab
addpath('MATLAB')
report = run_all_validations();

For one persistent, uninterrupted MATLAB R2025b record, run this command from the repository root in PowerShell:

powershell
& 'C:\Program Files\MATLAB\R2025b\bin\matlab.exe' -logfile 'Results\full_validation_log.txt' -batch "addpath('MATLAB'); report = run_all_validations();"

A successful run exits normally and ends the log with FULL_VALIDATION_PASS. The checked-in log is a software-validation record, not a hardware test log.

The models were made in MATLAB R2025b using Simulink and Simscape Electrical.

Repository files

  • MATLAB/buck_parameters.m: design calculations and workspace values
  • MATLAB/configure_load_transient_model.m: reproducible load-profile setup
  • MATLAB/control_analysis.m: averaged plant and manual-PI loop analysis
  • MATLAB/validate_project.m: all-model simulation and result generation
  • MATLAB/run_all_validations.m: one-command complete validation
  • MATLAB/run_switching_validations.m: switching cases and export sanity checks
  • Simulink/buck_average_open_loop.slx: averaged converter model
  • Simulink/buck_average_closed_loop.slx: PI-controlled averaged model
  • Simulink/buck_average_load_transient.slx: validated load-step model
  • Simulink/buck_switching_open_loop.slx: PWM switching model
  • Firmware: portable STM32G431RB control core and integration notes
  • KiCad: editable schematic/PCB, BOM, reports, and viewable exports
  • Documentation: specifications and test notes
  • Results: calculated values, CSV datasets, plots, and full validation log

Parts

31
QtyValueFootprintReferences
2100nFCapacitor_SMD:C_0603_1608MetricC4, C5
2100uF 25VBuck:CP_Elec_7.3x4.3C1, C8
21uF 25VCapacitor_SMD:C_1210_3225MetricC2, C9
2CSD18540Q5BPackage_SON:VSONP-8-1EP_5x6_P1.27mmQ1, Q2
110-14V INPUTTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalJ1
1100nF BOOTCapacitor_SMD:C_0603_1608MetricC7
110k BOOT0Resistor_SMD:R_0603_1608MetricR4
110k VFB BOTResistor_SMD:R_0603_1608MetricR2
110k VFB TOPResistor_SMD:R_0603_1608MetricR1
11uFCapacitor_SMD:C_0603_1608MetricC3
11uF DRIVERCapacitor_SMD:C_0805_2012MetricC6
120mR 2WResistor_SMD:R_2512_6332MetricR3
13A PTCFuse:Fuse_1812_4532MetricF1
147uH 4.4AInductor_SMD:L_Wuerth_HCI-7050L1
15V OUTPUTTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalJ2
1BAS316Diode_SMD:D_SOD-323D2
1INA180A1Package_TO_SOT_SMD:SOT-23-5U4
1ISENSEBuck:TestPoint_Loop_D2.60mm_Drill1.0mmTP5
1LM5109BPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU3
1SMBJ18ADiode_SMD:D_SMBD1
1STM32G431RBT6Package_QFP:LQFP-64_10x10mm_P0.5mmU1
1SWBuck:TestPoint_Loop_D2.60mm_Drill1.0mmTP2
1SWDBuck:ARM_JTAG_SWD_10J3
1TPS7A1633Package_SO:VSSOP-8_3x3mm_P0.65mmU2
1VFBBuck:TestPoint_Loop_D2.60mm_Drill1.0mmTP4
1VINBuck:TestPoint_Loop_D2.60mm_Drill1.0mmTP1
1VOUTBuck:TestPoint_Loop_D2.60mm_Drill1.0mmTP3

Similar boards

  • 4 layers58 × 50 mmBldc motor cntroller, the printed circuit board in 3D

    Bldc motor cntroller

    azmat-bilal/bldc_motor_controller_pcb

    A Brushless DC Motor controller board. The design is inspired and is compatible with Odrive project (https://github.com/madcowswe/ODriveHardware) except that this one has a single channel.

    146 parts112MIT
  • 6 layers48 × 52 mmKestrel esc, the printed circuit board in 3D

    Kestrel esc

    HeyPCB/kestrel-esc

    Kestrel 4in1: 6S 4-in-1 ESC running stock AM32 on four STM32G071s, with 24 CSD18540 FETs, LM5109B drivers and battery current sensing. 48 x 52 mm 6-layer KiCad 10 board, DRC clean, with gerbers, BOM, CPL and STEP.

    174 partsCERN-OHL-S-2.0
  • 2 layers164.6 × 57 mmVF MOTOR DRIVER, the printed circuit board in 3D

    VF MOTOR DRIVER

    virtual-fly/VF_MOTOR_DRIVER

    VF_Motor_Driver is an open hardware power distribution board, designed to be part of a larger modular system. This design is based in part on the OpenFFBoard TMC4671 driver board, licensed under the GNU General Public…

    234 partsGPL-3.0
  • 8 layers163.5 × 123.5 mmYeti, the printed circuit board in 3D

    Yeti

    PionixPublic/reference-hardware

    BelayBox reference hardware

    278 parts70CERN-OHL-P-2.0
  • 4 layers100 × 100 mmDeneme2, the printed circuit board in 3D

    Deneme2

    Gokasimov/STM32-FOC-Control

    A completely from-scratch, bare-metal implementation of Field-Oriented Control (FOC) tailored for ultra-low inductance (3 µH) drone motors (e.g., A2212).

    118 parts2MIT
  • 8 layers123.5 × 58 mmBLDC MC V1.0, the printed circuit board in 3D

    BLDC MC V1.0

    AhmedAbo-Eita/BLDC_Motor_Driver

    BLDC Motor Driver hardware and firmware project including power stage, gate driver, protection circuits, and control firmware for sensor-based and/or sensorless BLDC motors.

    234 parts1

Questions

How big is the STM32 Buck Converter PCB?

It measures 100 × 70 mm and has 2 copper layers, 1.6 mm thick.

What parts does the STM32 Buck Converter use?

31 parts, built around the STM32G431RBT6, LM5109BSD, TPS7A1633DGN and CSD18540Q5B. 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 Buck Converter KiCad files?

From the MAC-75/STM32-Synchronous-Buck-Converter repository on GitHub, at the commit this page was made from: the board is KiCad/STM32_Buck_Converter.kicad_pcb and its schematic KiCad/STM32_Buck_Converter.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the STM32 Buck Converter 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).