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

This repository contains the development steps for the making of a Bidirectional Buck DC-DC converter
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.
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.
Simulation
Multisim, Ltspice and MATLAB/Simulink coil64
PCB
Kicad
The selected topology is based on a bidirectional synchronous buck/boost converter.
Diagram (preliminary):

To be dimensioned based on:
$L = \frac{V_L \cdot D}{\Delta I_L \cdot f_s}$
where:
$I_{sat} = \frac{B_{sat}\cdot l}{\mu_{0}\cdot \mu_{r}\cdot N}$ Where:
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).
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:
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).

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.
Check the waveforms of the inductor current and output voltage, ideally you should be looking at two saw-like waves with minimal ripple.
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.
BUCK R = $39.8$
| Duty | $V_{in}$ | $I_{in}$ | $V_{out}$ | $P_{in}$ | $P_{out}$ | Efficiency |
|---|---|---|---|---|---|---|
| 35% | 23 V | 0.06 A | 7.26 V | 1.38 W | 1.32 W | 96.4 % |
| 45% | 23 V | 0.10 A | 9.45 V | 2.30 W | 2.24 W | 97.5 % |
| 55% | 23 V | 0.16 A | 11.6 V | 3.68 W | 3.38 W | 91.8 % |
| 65% | 23 V | 0.22 A | 13.78 V | 5.06 W | 4.77 W | 94.3 % |
BOOST R = $142.2$
| Duty | $V_{in}$ | $I_{in}$ | $V_{out}$ | $P_{in}$ | $P_{out}$ | Efficiency |
|---|---|---|---|---|---|---|
| 29.5% | 12 V | 0.16 A | 16.34 V | 1.92 W | 1.87 W | 97.7 % |
| 39.5% | 12 V | 0.21 A | 18.79 V | 2.52 W | 2.48 W | 98.5 % |
| 49.5% | 12 V | 0.30 A | 22.11 V | 3.60 W | 3.43 W | 95.4 % |
| 59.5% | 12 V | 0.46 A | 26.77 V | 5.52 W | 5.04 W | 91.3 % |
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.
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:
+-----------------------+ +-----------------------+ +-----------------------+ +-----------------------+
| 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.
To control the microcontroller used for the PWM signal, a graphical interface is designed, the criteria followed for the design were:
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.
In here you will find executables to run on your machine (Linux and Windows are currently supported).
1. Clone the repository
git clone https://github.com/aguscsc/Bidirectional-Buck-DC-DC-converter.git
cd Bidirectional-Buck-DC-DC-converter/microcontroller/graphic_interface2. Dependencies
pip install pyserial3. Run gui.py
python gui.pySpanish version
python es_gui.pyThe 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.

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.
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 Rail | Max Voltage | $R_1$ (Source) | $R_2$ (GND) | Divider Ratio | Max $V_{adc}$ |
|---|---|---|---|---|---|
| Buck Output | 14V | $47\text{k}\Omega$ | $10\text{k}\Omega$ | $0.175$ | $2.45\text{V}$ |
| Boost Output | 27V | $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.
We implemented the UDP (User Datagram Protocol) for data transmission:
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:
// --- 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 monitorAdditionally a pcb was desgined to use the telemetry ssitem as an add-on to the converter

| Qty | Value | Footprint | References |
|---|---|---|---|
| 11 | 100n | Capacitor_SMD:C_1210_3225Metric | C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13 |
| 3 | 10k | Resistor_SMD:R_1812_4532Metric | R1, R2, R7 |
| 3 | 10u | Capacitor_SMD:C_1210_3225Metric | C14, C16, C17 |
| 2 | 0.1u | Capacitor_SMD:C_1210_3225Metric | C15, C18 |
| 2 | 10 | Resistor_SMD:R_1812_4532Metric | R3, R4 |
| 2 | 5.1k | Resistor_SMD:R_1812_4532Metric | R5, R6 |
| 2 | NMOS | Package_TO_SOT_SMD:TO-252-2 | Q1, Q2 |
| 2 | Screw_Terminal_01x02 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_PTSM-0,5-2-2,5-V-SMD_1x02-1MP_P2.50mm_Vertical | J2, J3 |
| 1 | 0 | Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder | R10 |
| 1 | 1m | Inductor_SMD:L_Coilcraft_MSS1210-XXX | L1 |
| 1 | 2.2u | Capacitor_SMD:C_1210_3225Metric | C2 |
| 1 | 20k | Resistor_SMD:R_1812_4532Metric | R9 |
| 1 | 6.19k | Resistor_SMD:R_1812_4532Metric | R8 |
| 1 | 6.8u | Capacitor_SMD:C_1210_3225Metric | C1 |
| 1 | Conn_01x05_Pin | Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical_SMD_Pin1Left | J5 |
| 1 | IR2184 | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U1 |
| 1 | L | Inductor_SMD:L_1210_3225Metric | L2 |
| 1 | LM7812 | Package_TO_SOT_SMD:TO-263-3_TabPin2 | U3 |
| 1 | PIC32MZ2048EFM144-I/PH | Package_QFP:TQFP-144_16x16mm_P0.4mm | U2 |
| 1 | SG-8002CA | Oscillator:Oscillator_SMD_SeikoEpson_SG210-4Pin_2.5x2.0mm | Y1 |
| 1 | SS14 | Diode_SMD:D_SMA | D1 |
| 1 | TPS560200 | Package_TO_SOT_SMD:SOT-23-5 | U5 |
| 1 | USB_C_Receptacle_USB2.0_14P | Connector_USB:USB_C_Receptacle_GCT_USB4110 | J1 |

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

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

Vickyrrrrrr/ClassD_RF_PA_300W_13p56MHz
For hackerfab lithography machine RF plasma source.

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


Rithvik-Vadlamani/guadaloop-power-electronics
Selected Guadaloop power-board and levitation H-bridge designs and review packages




mbouyer/marine_chartplotter
Hardware and software for an opencpn-based chartplotter
It measures 86.5 × 42 mm and has 2 copper layers, 1.6 mm thick.
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.
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.
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).