Component guide · Beginner · 4 min read
LM2596 buck converter

Pinout, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The LM2596 module steps a higher DC voltage down to any voltage between about 1.25 V and 35 V, for example 12 V down to 5 V. Turn the blue trimmer to set the output while measuring with a multimeter. It is rated 3 A but runs cool only up to about 2 A; input must be at least 1.5 to 2 V above the output.
Key specs at a glance
- Input
- 4.5 to 40 V DC
- Output
- 1.25 to 35 V, adjustable
- Current
- 3 A peak, about 2 A continuous without extra cooling
- Efficiency
- Up to about 90 percent
- Switching
- 150 kHz
- Dropout
- Input must be 1.5 to 2 V above output
What the LM2596 buck converter is
The LM2596 is a buck converter: instead of burning extra voltage as heat like a linear regulator, it switches quickly and stores energy in an inductor. Going from 12 V to 5 V at 2 A it wastes about 2 W, where a 7805 would waste 14 W.
It is the standard way to run Arduino, ESP32, sensors or servos from a 12 V adapter, a car battery or a LiPo pack.
LM2596 buck converter pinout
The pins on the LM2596 buck converter and what each one does.
| Pin | Function |
|---|---|
| IN+ | Input positive, 4.5 to 40 V |
| IN− | Input ground |
| OUT+ | Regulated output positive |
| OUT− | Output ground (same as IN−) |
| Trimmer | Multi-turn pot that sets the output voltage |
- IN+
- Input positive, 4.5 to 40 V
- IN−
- Input ground
- OUT+
- Regulated output positive
- OUT−
- Output ground (same as IN−)
- Trimmer
- Multi-turn pot that sets the output voltage
Wiring the LM2596 buck converter
Set the voltage before connecting the board. Feed 5.0 V into the 5V pin of an Uno or the 5V/VIN pin of an ESP32 dev board, or set 7 to 9 V and use the Uno barrel jack.
| LM2596 buck converter pin | Arduino Uno | ESP32 |
|---|---|---|
| IN+ / IN− | 12 V adapter + / − | 12 V adapter + / − |
| OUT+ | 5V pin (set to 5.0 V) | 5V / VIN pin (set to 5.0 V) |
| OUT− | GND | GND |
- IN+ / IN−
- Arduino Uno:
- 12 V adapter + / −
- ESP32:
- 12 V adapter + / −
- OUT+
- Arduino Uno:
- 5V pin (set to 5.0 V)
- ESP32:
- 5V / VIN pin (set to 5.0 V)
- OUT−
- Arduino Uno:
- GND
- ESP32:
- GND
Example code
There is nothing to program on the module itself. This sketch is a quick way to log the output while a load is connected.
// 10k from OUT+ to A0, 10k from A0 to GND: A0 sees half the output
void setup() { Serial.begin(9600); }
void loop() {
float v = analogRead(A0) * 5.0 / 1023.0 * 2.0;
Serial.print("Converter output: ");
Serial.print(v, 2);
Serial.println(" V");
delay(500);
}Setup and tuning
connect only the input and a multimeter on the output. Turn the trimmer anticlockwise to lower the voltage (many turns may be needed), then connect the load and recheck.
with 7 V in you can get about 5 V out, not 6.5 V.
above 2 A add a small heatsink or choose the XL4015.
the module has no protection; double-check + and − before switching on.
the buck converter calculator and power supply sizing help pick ratings.
What you need
Shop this list4 of 5 found in our store · ₹473
LM2596 adjustable buck converter module: the converter this guide coversLM2596 Adjustable Buck Converter Module₹59
DC power adapter (5.5x2.1 mm): a separate supply for the motorsDC Power Adapter (5.5x2.1mm)₹188
Digital multimeter: to set and check output voltageDigital Multimeter₹177- Uno R3 development board: the controller used in the wiring tableFind this part
Dupont jumper wires: for the signal connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
Try it: Buck converter design calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Connecting the load before setting the voltage, which can feed 12 V into a 5 V board.
- Reversing the input polarity.
- Expecting 3 A continuous without cooling.
- Using it when the input is only slightly above the needed output.
Frequently asked questions
How do I adjust the LM2596 output voltage?
Turn the trimmer while measuring the output with a multimeter. Anticlockwise usually lowers the voltage; it is a multi-turn pot, so keep turning.
Can I power a Raspberry Pi with it?
For a Pi 3 or Pi 4 at light load, yes if set to 5.1 V. For a Pi 5 under load, use a 5 A converter or official supply.
What is the minimum input voltage?
About 1.5 to 2 V above the output you want, and at least 4.5 V.
Why is the output voltage not changing?
The trimmer is multi-turn. Keep turning, and check the input is high enough above the target.
Does it have short-circuit protection?
The LM2596 has current limiting and thermal shutdown, but the module has no reverse polarity protection.
Can it charge a battery?
It has no current limit you can set. Use a charger module, or a buck converter with constant-current control such as the XL4015 CC/CV.
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.

