Skip to the content
2 layers86.5 × 42 mmFinal pcb, the printed circuit board in 3D

This repository contains the development steps for the making of a Bidirectional Buck DC-DC converter

Size
86.5 × 42 mm
Copper layers
2
Thickness
1.6 mm
Parts
42
Nets
145
Pads
280
Tracks, vias
392, 0
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
28 Aug 2025
Updated
17 Sep 2026

Overview

Final pcb is an open-source printed circuit board by aguscsc, from the aguscsc/Bidirectional-Buck-DC-DC-converter repository on GitHub, published under the MIT licence. It is a 2-layer board of 86.5 × 42 mm with 42 parts on 145 nets, routed with 392 tracks and 0 vias.

It is built around the PIC32MZ2048EFM144-I/PH, IR2184S and TPS560200DBV, with the LM7812, SG-8002CA-PCB and SS14 among its other parts. Its parts include 18 capacitors, 10 resistors, 4 ICs, 4 connectors and 2 transistors. It belongs with the power boards and the PIC boards of this library.

Main components

6

README

README.md

Bidirectional Buck DC-DC Converter

This repository documents the design and implementation of a bidirectional DC-DC converter.
The system can operate in both buck mode (step-down) and boost mode (step-up), enabling power flow in both directions.


Software used

  • Simulation

    Multisim, Ltspice and MATLAB/Simulink coil64

  • PCB

    Kicad

📐 Specifications

  • Switching frequency: 60 kHz
  • Maximum power: 5 W

Buck Mode

  • $V_{in, min} = 23V$
  • $V_{out, max} = 14V$

Boost Mode

  • $V_{in, min} = 12V$
  • $V_{out, max} = 27V$

🔌 Topology

The selected topology is based on a bidirectional synchronous buck/boost converter.
Diagram (preliminary):

Topology


📊 Design Parameters

Inductor

  • To be dimensioned based on:
    $L = \frac{V_L \cdot D}{\Delta I_L \cdot f_s}$ where:

    • ( $V_L$ ) = inductor voltage
    • ( $D$ ) = duty cycle
    • ( $\Delta I_L$ ) = current ripple (≈ $30$% of ( $I_{L,max}$ ))
    • ( $f_s$ ) = switching frequency

    $I_{sat} = \frac{B_{sat}\cdot l}{\mu_{0}\cdot \mu_{r}\cdot N}$ Where:

    • ($I_{sat}$) = Saturation current
    • ($B_{sat}$) = saturation flux density of the core material
    • ($l$) = effective magnetic path length of the core
    • ($\mu_{0}$) = permeability of a vacuum
    • ($\mu_{r}$) = relative permeability of the material
    • ($N$) = number of turns

Recommendation: use coil64 to check your calculations, research skin effect and how different AWG interact with the frequency you're using (https://en.wikipedia.org/wiki/Skin_effect).

Capacitor

  • To be dimensioned from capacitor current balance:

  • buck $C = \frac{\Delta I_L}{\Delta V \cdot f_s\cdot 8}$

  • boost $C = \frac{I_{out} \cdot D}{\Delta V \cdot f_s}$

    where:

    • ( $\Delta V$ ) = allowed voltage ripple

Schematic & PCB layout

schematic

PCB


Prototyping

This section breaks down the process of prototyping and testing, the pcb in the design directory contains all the measures necessary to ensure the converter is working properly (value of components can be adjusted to your needs).

BOM:

  • 2 electrolytic capacitors $6.8\mu F$ and $2.2\mu F$ 50V each.
  • 2 ceramic capacitors (100nF).
  • core T106-26 + 9m of AWG 26 wire (higher permeability would also work if the saturation stays sensible).
  • 2 IFRZ44N (great for prototyping and testing)
  • IR2184 driver (it can generate both MOSFET signals)
  • 2 10 ohm gate resistors 1W (it limits the gate current)
  • 2 10k ohm pull-down resistor 1W (drains the gate source capacitance) Prototype

Measurements and tests

switching

First, you ought to make sure the MOSFET are switching correctly. For this, turn on the pwm signal and your VCC source, then measure the gate-source pins of each MOSFET with an oscilloscope and make sure the signals are the complement of each other and respond to the change in duty. Aditionally, you should measure the gate current to ensure it is not exceeding the drivers capacity.

switching

Powering the circuit

Check the waveforms of the inductor current and output voltage, ideally you should be looking at two saw-like waves with minimal ripple. testing Once you have ensured the inductor current and the output voltage have satisfied your needs you can proceed to measure the converters effiency for each mode.

Note: if you struggle achieving the voltage ripple required, considering soldering ceramic capacitors parallel to your current ones.

Efficiency

BUCK R = $39.8$

Duty$V_{in}$$I_{in}$$V_{out}$$P_{in}$$P_{out}$Efficiency
35%23 V0.06 A7.26 V1.38 W1.32 W96.4 %
45%23 V0.10 A9.45 V2.30 W2.24 W97.5 %
55%23 V0.16 A11.6 V3.68 W3.38 W91.8 %
65%23 V0.22 A13.78 V5.06 W4.77 W94.3 %

BOOST R = $142.2$

Duty$V_{in}$$I_{in}$$V_{out}$$P_{in}$$P_{out}$Efficiency
29.5%12 V0.16 A16.34 V1.92 W1.87 W97.7 %
39.5%12 V0.21 A18.79 V2.52 W2.48 W98.5 %
49.5%12 V0.30 A22.11 V3.60 W3.43 W95.4 %
59.5%12 V0.46 A26.77 V5.52 W5.04 W91.3 %

PWM control

Previously, the pwm signal was generated with a waveform generator, for real applications this has to be implemented with a microcontroller, in this case we'll use a PIC32 to generate the pwm signal. This section will cover the programming and testing of the control system and its integration with the power circuit.

Prototyping

First the Curiosity PIC32MZEF2 board was used to program and debug the pic32, this board comes equipped with a PICKit on board 4 to program and the debug the microcontroller using MPLABX.

To ensure the correct operation of the microcontroller, first it was configured to control the PWM signal via the analog to digital converter, mapping its input to duty cycle levels. The steps followed were:

text
+-----------------------+      +-----------------------+      +-----------------------+      +-----------------------+
|     Start: Create     |      |     Config Output     |----->|      Config Timer     |      |     End: Compile &    |
|  PWM Generation Code  |      |    Compare I/O Pins   |      |        Registers      |      |   Load Code to PIC32  |
+-----------------------+      +-----------------------+      +-----------------------+      +-----------------------+
            |                              ^                              |                              ^
            |                              |                              |                              |
            v                              |                              v                              |
+-----------------------+      +-----------------------+      +-----------------------+      +-----------------------+
|   Config Oscillator   |----->|     Config Output     |      |       Config the      |----->|     Init Remaining    |
|         & PLL         |      |     Compare Module    |      |           ADC         |      |    I/O & Peripherals  |
+-----------------------+      +-----------------------+      +-----------------------+      +-----------------------+

First, it is necessary to generate the system clock, to do this the POSC (primary Oscillator) was set to EC mode, generating a 12Mhz signal which was scaled using the PLL data_sheets, then feeding a voltage signal controlled with a potentiometer to the ADC the pwm signal was generated.

Once peripherals were working as expected, a graphic interface was integrated to replace the potentiometer, allowing for control over the mode, duty and frequency at which the converter operated.

Graphical Interface

To control the microcontroller used for the PWM signal, a graphical interface is designed, the criteria followed for the design were:

  • Intuitive
  • Easy to switch between modes
  • Secure, it must limit human error as much as possible without harming the user's experience
  • Use of non distracting colors
  • It must have a visual representation of the signal and voltage output

To develop such interface the language chosen is Python, due to the presence of the library Tkinter, which made the process a lot easier.

Here you can see the interface next to an example of a warning popup when going above the suggested operation point.

gui

gui_warn

How to use

Executable

In here you will find executables to run on your machine (Linux and Windows are currently supported).

Manual

1. Clone the repository

text
git clone https://github.com/aguscsc/Bidirectional-Buck-DC-DC-converter.git
cd Bidirectional-Buck-DC-DC-converter/microcontroller/graphic_interface

2. Dependencies

text
pip install pyserial

3. Run gui.py

text
python gui.py

Spanish version

text
python es_gui.py

Final PCB

The final PCB design consolidates all previously discussed subsystems into a single, compact board. It integrates the custom power stage, two voltage regulators to supply the gate driver and the PIC32 microcontroller, and a USB-C port to interface with the graphical control software.

FINAL pcb

ESP32 Telemetry & Sensing

To enable real-time monitoring, an ESP32 module acts as a wireless telemetry unit. It senses input/output voltages and transmits data back to the Graphical Interface via Wi-Fi, allowing for remote performance tracking without physical probes.

⚡ Signal Conditioning (Voltage Divider)

The ESP32 GPIOs are not 5V tolerant and operate at a 3.3V logic level. Since the converter handles up to 27V, voltage dividers are mandatory to scale the signals into the ADC's linear range ($100\text{mV}$ to $2.45\text{V}$ at $12\text{dB}$ attenuation).

The scaling follows the voltage divider formula:

$$V_{adc} = V_{out} \cdot \left( \frac{R_2}{R_1 + R_2} \right)$$

Recommended Resistor Values:

Target RailMax Voltage$R_1$ (Source)$R_2$ (GND)Divider RatioMax $V_{adc}$
Buck Output14V$47\text{k}\Omega$$10\text{k}\Omega$$0.175$$2.45\text{V}$
Boost Output27V$100\text{k}\Omega$$10\text{k}\Omega$$0.091$$2.45\text{V}$

[!WARNING] Always verify the divider output with a multimeter before connecting to the ESP32. Overvoltage will permanently damage the SoC.

🌐 Wireless Protocol: UDP

We implemented the UDP (User Datagram Protocol) for data transmission:

  • Low Latency: Unlike TCP, UDP does not require a handshake, making it ideal for high-frequency telemetry updates.
  • Efficiency: Smaller packet overhead reduces the power consumption and processing time of the ESP32.

🛠️ Software Configuration (ESP-IDF)

The firmware is built using the ESP-IDF v5.x framework. To integrate it with your local network, modify the constants in main/main.c:

c
// --- USER CONFIGURATION ---
#define WIFI_SSID      "Your_SSID"
#define WIFI_PASS      "Your_Password"
#define PC_IP_ADDR     "192.168.1.XX" // Your PC's local IP
#define PORT           3333           // Must match GUI port
---

**Deployment:**

1. Connect the ESP32 via USB.
2. Initialize the environment: `. $HOME/esp/esp-idf/export.sh`
3. Build and flash:
```bash
idf.py build flash monitor

ESP32 PCB

Additionally a pcb was desgined to use the telemetry ssitem as an add-on to the converter

esp pcb


👥 Collaborators


📚 References

  • Mohan – Power Electronics, Cap. 7
  • Erickson – Fundamentals of Power Electronics, Cap. 3
  • Power Electronics: Converters, Applications, and Design” – Ned Mohan
  • Electronica de Potencia, 1era edicion - Daniel W.Hart

Parts

42
QtyValueFootprintReferences
11100nCapacitor_SMD:C_1210_3225MetricC3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13
310kResistor_SMD:R_1812_4532MetricR1, R2, R7
310uCapacitor_SMD:C_1210_3225MetricC14, C16, C17
20.1uCapacitor_SMD:C_1210_3225MetricC15, C18
210Resistor_SMD:R_1812_4532MetricR3, R4
25.1kResistor_SMD:R_1812_4532MetricR5, R6
2NMOSPackage_TO_SOT_SMD:TO-252-2Q1, Q2
2Screw_Terminal_01x02TerminalBlock_Phoenix:TerminalBlock_Phoenix_PTSM-0,5-2-2,5-V-SMD_1x02-1MP_P2.50mm_VerticalJ2, J3
10Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR10
11mInductor_SMD:L_Coilcraft_MSS1210-XXXL1
12.2uCapacitor_SMD:C_1210_3225MetricC2
120kResistor_SMD:R_1812_4532MetricR9
16.19kResistor_SMD:R_1812_4532MetricR8
16.8uCapacitor_SMD:C_1210_3225MetricC1
1Conn_01x05_PinConnector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical_SMD_Pin1LeftJ5
1IR2184Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU1
1LInductor_SMD:L_1210_3225MetricL2
1LM7812Package_TO_SOT_SMD:TO-263-3_TabPin2U3
1PIC32MZ2048EFM144-I/PHPackage_QFP:TQFP-144_16x16mm_P0.4mmU2
1SG-8002CAOscillator:Oscillator_SMD_SeikoEpson_SG210-4Pin_2.5x2.0mmY1
1SS14Diode_SMD:D_SMAD1
1TPS560200Package_TO_SOT_SMD:SOT-23-5U5
1USB_C_Receptacle_USB2.0_14PConnector_USB:USB_C_Receptacle_GCT_USB4110J1

More from aguscsc/Bidirectional-Buck-DC-DC-converter

2
  • 2 layers85 × 60 mmBuck bidireccional, the printed circuit board in 3D

    Buck bidireccional

    aguscsc/Bidirectional-Buck-DC-DC-converter

    This repository contains the development steps for the making of a Bidirectional Buck DC-DC converter

    20 parts5MIT
  • 2 layers62 × 28.5 mmEsp32, the printed circuit board in 3D

    Esp32

    aguscsc/Bidirectional-Buck-DC-DC-converter

    This repository contains the development steps for the making of a Bidirectional Buck DC-DC converter

    19 parts5MIT

Similar boards

  • 2 layers79 × 27.4 mmBuck converter, the printed circuit board in 3D

    Buck converter

    luke-ting/buck-converter

    Custom 12 V to 5-9 V, 2 A synchronous buck converter PCB designed in KiCad

    24 parts
  • 2 layers180 × 133.3 mmClassd amp, the printed circuit board in 3D

    Classd amp

    prydin/classd-amp

    Class D Amplifier (work in progress)

    176 parts
  • 4 layers146 × 96 mmPoc lev, the printed circuit board in 3D

    Poc lev

    Rithvik-Vadlamani/guadaloop-power-electronics

    Selected Guadaloop power-board and levitation H-bridge designs and review packages

    74 parts
  • 4 layers99.8 × 74.9 mmTo220 powerstage, the printed circuit board in 3D

    To220 powerstage

    rene-dev/stmbl

    AC Servo Driver for STM32F4

    134 parts990GPL-3.0
  • 4 layers174 × 104 mmTd deflect, the printed circuit board in 3D

    Td deflect

    tdaede/td-crt

    tubes

    175 parts373
  • 4 layers99 × 91.7 mmEPSM Famicom, the printed circuit board in 3D

    EPSM Famicom

    Perkka2/EPSM

    NES Expansion Port Sound Generator

    60 parts76
  • 2 layers160 × 100 mmMarine gps, the printed circuit board in 3D

    Marine gps

    mbouyer/marine_chartplotter

    Hardware and software for an opencpn-based chartplotter

    115 parts6BSD-2-Clause

Questions

How big is the Final pcb PCB?

It measures 86.5 × 42 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Final pcb use?

42 parts, built around the PIC32MZ2048EFM144-I/PH, IR2184S, TPS560200DBV and LM7812. 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 Final pcb KiCad files?

From the aguscsc/Bidirectional-Buck-DC-DC-converter repository on GitHub, at the commit this page was made from: the board is Design/pcb/final_pcb/final_pcb.kicad_pcb and its schematic Design/pcb/buck_bidireccional/buck_bidireccional.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Final pcb 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).