LM-2596 Module With LED
Details
Summary
The LM-2596 Buck Converter Module (with LED/Voltmeter) is an adjustable step-down regulator featuring an on-board digital voltmeter display (and status LED on many variants). Set the output voltage with the trimmer and verify instantly on the display—ideal for powering 5 V or 3.3 V devices from 12 V/battery sources.
Note: Some boards include a small button to toggle display input/output reading. Always verify with a multimeter before connecting sensitive loads.
Terminals & Controls›
- VIN+ / VIN−: DC input (observe polarity)
- VOUT+ / VOUT−: Regulated DC output
- ADJ: Multi-turn potentiometer for setting VOUT
- DISPLAY BTN (if present): Toggle to show VIN or VOUT
- EN (if present): Enable pin (often active-low)
- Common Ground: VIN− and VOUT− typically shared
Tip: Tune VOUT with no load first, then re-check under load to account for sag.
Wiring Diagram›
Basic hookup showing higher-voltage input on VIN and regulated output on VOUT to your device.
Arduino Code›
Use a voltage divider to monitor VOUT, and optionally control EN if exposed.
Measure VOUT on A0 (with divider)
// Monitor LM2596 output via divider to A0
const byte PIN_SENSE = A0;
const float VREF = 5.0;
const float R1 = 100000.0; // to Vout
const float R2 = 33000.0; // to GND
void setup(){ Serial.begin(115200); }
void loop(){
int raw = analogRead(PIN_SENSE);
float va0 = raw * (VREF / 1023.0);
float vout = va0 * ((R1 + R2) / R2);
Serial.print("Vout: "); Serial.print(vout, 2); Serial.println(" V");
delay(300);
}
Toggle Enable (if available)
// Example EN control (active-low typical—verify your board)
const byte PIN_EN = 7;
void setup(){ pinMode(PIN_EN, OUTPUT); digitalWrite(PIN_EN, LOW); } // enable
void loop(){ delay(2000); digitalWrite(PIN_EN, HIGH); delay(1000); digitalWrite(PIN_EN, LOW); }
Raspberry Pi›
Pi lacks native ADC—use MCP3008 or similar to read VOUT. Some boards show VIN/VOUT on the on-board display.
Python + MCP3008: Read VOUT
# pip install adafruit-circuitpython-mcp3xxx
import time
import board, busio
from digitalio import DigitalInOut
from adafruit_mcp3xxx.mcp3008 import MCP3008
from adafruit_mcp3xxx.analog_in import AnalogIn
spi = busio.SPI(clock=board.SCK, MISO=board.MISO, MOSI=board.MOSI)
cs = DigitalInOut(board.CE0)
mcp = MCP3008(spi, cs)
chan = AnalogIn(mcp, MCP3008.P0)
R1, R2 = 100000.0, 33000.0
while True:
va0 = chan.voltage
vout = va0 * ((R1 + R2) / R2)
print(f"Vout: {vout:.2f} V")
time.sleep(0.5)
ESP Coding›
ESP32/ESP8266: Read LM2596 VOUT through a divider into an ADC pin (max 3.3 V at the GPIO). If your module exposes EN, you can switch the buck on/off from a GPIO (mind active level).
ESP32 (Arduino core): ADC + optional EN
// Divider from Vout -> ADC pin; choose values to keep ADC <= 3.3 V
const int PIN_ADC = 34; // input-only ADC on ESP32
const float R1 = 100000.0; // to Vout
const float R2 = 33000.0; // to GND
const int PIN_EN = 23; // optional EN control (verify level)
void setup(){
Serial.begin(115200);
analogReadResolution(12); // 0..4095
pinMode(PIN_EN, OUTPUT); digitalWrite(PIN_EN, LOW); // LOW=enable (typ). Change if active-high.
}
void loop(){
int raw = analogRead(PIN_ADC);
float vadc = (raw / 4095.0) * 3.3;
float vout = vadc * ((R1 + R2) / R2);
Serial.printf("ADC:%d Vadc:%.3f V Vout:%.2f V\n", raw, vadc, vout);
delay(300);
}
ESP8266 (Arduino core): ADC read
// Many ESP8266 dev boards have a built-in divider to 1.0 V ADC ref (A0).
// Check your board's scaling and adjust R1/R2 accordingly if using external divider.
void setup(){ Serial.begin(115200); }
void loop(){
int raw = analogRead(A0); // 0..1023 maps to ~0..1.0 V (board dependent)
float vadc = raw * (1.0 / 1023.0); // if 1.0 V ref; use 3.3 if your board routes to 3.3 V ref
// back-calc Vout using your divider ratio:
const float R1 = 100000.0, R2 = 33000.0;
float vout = vadc * ((R1 + R2) / R2);
Serial.printf("ADC:%d Vout:%.2f V\n", raw, vout);
delay(300);
}
ESP-IDF (C): ADC read (ESP32)
#include "driver/adc.h"
#include "esp_adc_cal.h"
void app_main(void){
adc1_config_width(ADC_WIDTH_BIT_12);
adc1_config_channel_atten(ADC1_CHANNEL_6, ADC_ATTEN_DB_11); // GPIO34, ~0..3.3 V range
esp_adc_cal_characteristics_t cal;
esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_11, ADC_WIDTH_BIT_12, 1100, &cal);
while (1) {
uint32_t raw = adc1_get_raw(ADC1_CHANNEL_6);
uint32_t mv = esp_adc_cal_raw_to_voltage(raw, &cal); // millivolts at ADC pin
const float R1=100000.0f, R2=33000.0f;
float vout = (mv/1000.0f) * ((R1 + R2) / R2);
printf("raw:%" PRIu32 " Vout:%.2f V\n", raw, vout);
vTaskDelay(pdMS_TO_TICKS(300));
}
}
Safety: never exceed the ADC pin’s max input (typically 3.3 V). Choose divider values to keep Vadc ≤ 3.3 V at worst-case Vout.
Drivers›
Module itself needs no drivers. If using a USB-serial bridge for logging/control, install the correct driver:
Resources›
Arduino
Raspberry Pi
Espressif
- ESP-IDF Programming Guide (Official)
- ESP-IDF “Get Started”
- Espressif Technical Docs / Datasheets / Design Guidelines
- Espressif Docs (ReadTheDocs mirror)
- ESP-IDF GitHub Repository
- ESP-IDF Examples (Resources)
- ESP8266 RTOS SDK Documentation (Legacy)
- ESP8266 RTOS SDK (GitHub)
- Espressif Matter (Docs)
- Espressif Matter (GitHub)
- PlatformIO + ESP-IDF
- Arduino Core for ESP32 (GitHub)
Drivers / Other
Specifications›
| Regulator IC | LM2596 (switch-mode buck) |
|---|---|
| Input Voltage | 4–40 V DC (typical) |
| Output Voltage | 1.25–35 V adjustable |
| Max Output Current | ~2 A continuous (3 A peak, with cooling) |
| Switching Frequency | ~150 kHz |
| Display | On-board 3-digit LED voltmeter (varies by board) |
| Efficiency | Up to ~90% (load & ΔV dependent) |
| Adjustment | Multi-turn potentiometer |
| Dimensions | Module-dependent (e.g., ≈60 × 34 mm) |
Note: Exact features (EN pin, display button, LED) vary by vendor—check your PCB silkscreen.
FAQ›
Voltmeter shows the wrong value ›
Overheating at higher loads ›
Safe for powering microcontrollers? ›
Safety & Compliance›
Important Notice: For educational, prototype, experimental, laboratory and R&D use only. (non-RoHS).
WEEE
Not subject to WEEE marking; obligations apply to final equipment.
Manufacturer
Little Muffins Things Limited
166 River Heights, 90 High Street
London E15 2GQ
littlemuffinsthings.com
EU Responsible Person
eucomply OU
Parnu mnt. 139b–141
13117 Tallinn, Estonia
hello@eucompliancepartner.com