Component guide · Beginner · 3 min read
XL4015 buck converter

Pinout, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The XL4015 is a step-down converter rated 5 A that turns 8 to 36 V into an adjustable 1.25 to 32 V. It is the next size up from the LM2596, for loads such as LED strips, Raspberry Pi with peripherals or several servos. Set the output with the trimmer and a multimeter, or read it on the built-in voltmeter version.
Key specs at a glance
- Input
- 8 to 36 V DC
- Output
- 1.25 to 32 V, adjustable
- Current
- 5 A peak, about 3 to 4 A continuous with good airflow
- Efficiency
- Up to about 95 percent
- Switching
- 180 kHz
- Versions
- Plain module, or with an LED voltmeter display
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1XL4015 5A Buck Converter with Voltmeter₹304
Option 2XL4015 Adjustable Buck Converter 5A₹119
What the XL4015 buck converter is
The XL4015 works like the LM2596 but with a stronger switch and bigger inductor, so it handles more current with less heat. The voltmeter version has a small display and a button to switch between input and output voltage.
Use it when a build needs more than 2 A at 5 V or 12 V from a higher-voltage battery or supply.
XL4015 buck converter pinout
The pins on the XL4015 buck converter and what each one does.
| Pin | Function |
|---|---|
| IN+ / IN− | Input 8 to 36 V |
| OUT+ / OUT− | Adjustable output |
| Trimmer | Sets the output voltage |
| Display button | Voltmeter version: shows input or output voltage |
- IN+ / IN−
- Input 8 to 36 V
- OUT+ / OUT−
- Adjustable output
- Trimmer
- Sets the output voltage
- Display button
- Voltmeter version: shows input or output voltage
Wiring the XL4015 buck converter
Set the output before connecting the load. Use wires thick enough for the current, for example 0.75 mm2 for 5 A.
| XL4015 buck converter pin | Arduino Uno | ESP32 |
|---|---|---|
| IN+ / IN− | 24 V supply or 3S/4S battery | 24 V supply or 3S/4S battery |
| OUT+ | 5V pin (set to 5.0 V) | 5V pin (set to 5.0 V) |
| OUT− | GND | GND |
- IN+ / IN−
- Arduino Uno:
- 24 V supply or 3S/4S battery
- ESP32:
- 24 V supply or 3S/4S battery
- OUT+
- Arduino Uno:
- 5V pin (set to 5.0 V)
- ESP32:
- 5V pin (set to 5.0 V)
- OUT−
- Arduino Uno:
- GND
- ESP32:
- GND
Example code
The module needs no code. This sketch uses an INA219 to check the real load current, which tells you whether you are within the safe range.
#include <Adafruit_INA219.h> // INA219 between OUT+ and the load
Adafruit_INA219 ina;
void setup() {
Serial.begin(115200);
ina.begin();
}
void loop() {
Serial.print(ina.getBusVoltage_V(), 2); Serial.print(" V ");
Serial.print(ina.getCurrent_mA(), 0); Serial.println(" mA");
delay(500);
}Setup and tuning
above 3 A the chip and diode get hot. Add a heatsink and airflow, or derate.
keep the input at least 2 V above the output.
compare the display with a multimeter; cheap displays can be off by 0.1 to 0.2 V.
for 12 V strips from a 24 V supply, size the converter with the LED strip power calculator.
What you need
Shop this list5 of 5 found in our store · ₹1,106
XL4015 5A buck converter with voltmeter: built-in display versionXL4015 5A Buck Converter with Voltmeter₹304
XL4015 adjustable buck converter 5A: plain versionXL4015 Adjustable Buck Converter 5A₹119
Enclosed SMPS power supply: 12 V or 24 V supply for bigger loadsEnclosed SMPS Power Supply₹257
Digital multimeter: to set and check output voltageDigital Multimeter₹177
INA219 current and power monitor module: to measure the loadINA219 Current and Power Monitor Module₹249
Alternatives and when to choose them
- LM2596: smaller loads up to about 2 A.
- DC-DC converters guide: buck, boost and buck-boost modules compared.
- XL6009: to raise voltage instead.
Try it: Buck converter design calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Running 5 A continuously without cooling.
- Using thin jumper wires on the output.
- Setting the voltage after the load is connected.
- Feeding less than 8 V in.
Frequently asked questions
What is the difference between XL4015 and LM2596?
The XL4015 handles about twice the current with better efficiency. The LM2596 is smaller and fine up to about 2 A.
Can it power a Raspberry Pi 5?
Set to 5.1 V it can supply the current, but voltage at the Pi must stay above 5 V; use short thick wires.
Is there current limiting?
The standard module has internal over-current protection but no adjustable limit. CC/CV versions with two trimmers allow constant current.
How accurate is the voltmeter?
Typically within 0.1 to 0.2 V. Check with a multimeter for critical loads.
Can it run from a car battery?
Yes. 12 to 14.4 V input is in range for outputs up to about 10 V.
Why does the output drop under load?
The input supply cannot deliver enough current, or the input is too close to the output.
Parts for this guide
Calculators
Terms in this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.
