Skip to content

Voltage Regulator · Espressif ESP32 guide

Using MT3608 Boost Converter Module with Espressif ESP32

A tiny adjustable step-up converter that lifts one Li-ion cell or two AA cells to 5 V or more. Set it with a meter first, and budget the input current.

Updated November 25, 2026 Arduino C++None (ESP32 core ADC)Also forArduino Uno

What is the MT3608?

The MT3608 boost converter takes a low DC voltage and turns it into a higher one. Feed it a single 3.7 V lithium cell and get a steady 5 V for an ESP32 or Arduino; feed it 5 V from USB and get 9 V or 12 V for a small fan, LED strip or sensor that needs it. The module is about the size of a postage stamp, costs very little and has one adjustment: a small blue trimmer that sets the output voltage.

Three things decide whether an MT3608 project works: setting the trimmer before you connect anything, understanding that the input must supply more current than the output delivers, and knowing that the module is always on, even while your project sleeps. This page explains each one in plain language, shows how a boost converter works inside, and gives you the datasheet numbers. For complete builds, see the Arduino Uno guide and the ESP32 guide.

Specifications

Converter type
Boost (step-up), current-mode PWM
Input voltage
2 V to 24 V
Output voltage
Adjustable up to 28 V, always above the input
Switch current limit
4 A peak (internal switch); usable output is much lower, see below
Switch on-resistance
80 mΩ typical, 150 mΩ maximum
Switching frequency
1.2 MHz fixed
Maximum duty cycle
90 %
Feedback reference
0.6 V (0.588–0.612 V)
Efficiency
Up to 97 % (datasheet best case); about 80–90 % on typical modules
Chip supply current
100–200 µA idle, 1.6–2.2 mA while switching
Light-load mode
Automatic pulse-frequency modulation (PFM)
Enable pin
Tied to the input on the module: always on
Protection
Current limit, soft-start, thermal shutdown; no reverse-polarity protection
Chip package
SOT23-6
Module size
About 36 × 17 mm

Chip figures from the Aerosemi MT3608 datasheet (VIN = 5 V, 25 °C). Module quality varies: inductors, diodes and capacitors on cheap boards set the real limits, so treat ratings as upper bounds.

Pinout

PadNameWhat it does
1IN+ (VIN+)Input positive: battery or low-voltage supply, 2 to 24 V
2IN− (VIN−)Input ground
3OUT+ (VOUT+)Boosted output. Set it with a meter before connecting a load
4OUT− (VOUT−)Output ground, joined to IN− on the board
—TrimmerMulti-turn potentiometer that sets the output voltage

IN− and OUT− are the same ground. Reversing the input polarity usually destroys the chip, because there is no protection.

Wiring & code

Setting up MT3608 with Espressif ESP32

Library

None (ESP32 core ADC) by Espressif

No library needed; analogReadMilliVolts() is part of the ESP32 Arduino core

This guide powers an ESP32 DevKit from a single Li-ion cell through an MT3608, reads the cell's voltage on an ADC pin, and builds a deep-sleep battery logger. It also answers the question every ESP32 battery project eventually asks: is a boost converter even the right choice? For long sleep times, often it is not. Background on current limits and idle drain is on the MT3608 overview.

What you need

QtyPartNotes
1ESP32 DevKitPowered through its 5V / VIN pin
1MT3608 moduleSet to 5.0 to 5.2 V before connecting
118650 Li-ion cell (protected) and holderWi-Fi bursts need a cell that can deliver 1 A or more
2100 kΩ resistorsDivider for the battery-sense line
1100 nF capacitorAcross the ADC pin and GND, steadies the reading
1MultimeterEssential for setting the output

Wiring: Li-ion → MT3608 → ESP32

FromToNotes
Battery +Switch → MT3608 IN+Fuse or polyfuse if the cell is unprotected
Battery −MT3608 IN− and ESP32 GNDCommon ground
MT3608 OUT+ESP32 5V / VINFeeds the board's 3.3 V regulator; set 5.0 to 5.2 V first
MT3608 OUT−ESP32 GND
Battery + → 100 kΩ → GPIO34 → 100 kΩ → GNDGPIO34 (ADC1)Halves 4.2 V to 2.1 V; ADC1 pins keep working with Wi-Fi on

Warning

Disconnect the battery before plugging in USB, unless your DevKit has a diode between USB 5 V and the 5V pin (many do, some clones do not). Never connect the MT3608's output to the 3V3 pin: 5 V there destroys the ESP32.

Why 5V / VIN and not 3V3? Boosting a 3.7 V cell to 5 V and then regulating it down to 3.3 V wastes energy twice, but the DevKit's regulator gives a clean, stable 3.3 V whatever the cell is doing. Boosting straight to 3.3 V would not work for long: a full cell (4.2 V) is above 3.3 V, and a boost converter cannot step down. Feeding 5V/VIN is the simple, robust route for an always-on ESP32.

Wi-Fi peaks. The ESP32 draws short bursts of 300 to 500 mA when transmitting. Through the converter that is up to about 1 A from the cell; a tired or unprotected cell, thin wires or a weak holder causes brownout resets right when Wi-Fi starts.

Sketch 1 - Battery voltage and percentage

sketch.ino
const int BATT_PIN = 34;          // ADC1 channel, through the 100k / 100k divider
const float DIVIDER = 2.0;        // (100k + 100k) / 100k

// Rough Li-ion state of charge from resting voltage (light load)
const float V_PTS[] = {3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.10, 4.20};
const int   P_PTS[] = {   0,    2,    5,   10,   22,   38,   52,   65,   78,   90,  100};

int percentFromVolts(float v) {
  if (v <= V_PTS[0])  return 0;
  if (v >= V_PTS[10]) return 100;
  for (int i = 1; i < 11; i++) {
    if (v < V_PTS[i]) {
      float f = (v - V_PTS[i - 1]) / (V_PTS[i] - V_PTS[i - 1]);
      return P_PTS[i - 1] + f * (P_PTS[i] - P_PTS[i - 1]);
    }
  }
  return 100;
}

float readBattery() {
  uint32_t mv = 0;
  for (int i = 0; i < 16; i++) mv += analogReadMilliVolts(BATT_PIN);  // factory-calibrated
  return (mv / 16.0) * DIVIDER / 1000.0;
}

void setup() {
  Serial.begin(115200);
  analogSetPinAttenuation(BATT_PIN, ADC_11db);   // measure up to about 3.1 V at the pin
}

void loop() {
  float v = readBattery();
  Serial.printf("Battery: %.2f V  ~%d %%\n", v, percentFromVolts(v));
  delay(2000);
}

analogReadMilliVolts() uses the calibration burned into each ESP32 at the factory, which is far more accurate than scaling a raw analogRead() by 3.3 / 4095. Compare once with a multimeter on the battery: if it is consistently off by a few percent, correct DIVIDER (resistor tolerance is the usual cause).

Sketch 2 - Deep-sleep battery logger

A sensor that wakes, reports and sleeps is the typical battery ESP32. This sketch wakes every 15 minutes, reads the cell, prints it (replace that with your MQTT or HTTP post), and goes back to sleep. When the cell reaches 3.3 V it stops waking up altogether, so the ESP32 itself no longer drains it.

sketch.ino
const int   BATT_PIN      = 34;
const float DIVIDER       = 2.0;
const float STOP_V        = 3.30;        // stop waking below this
const uint64_t SLEEP_MIN  = 15;

RTC_DATA_ATTR int wakeCount = 0;         // survives deep sleep

float readBattery() {
  uint32_t mv = 0;
  for (int i = 0; i < 16; i++) mv += analogReadMilliVolts(BATT_PIN);
  return (mv / 16.0) * DIVIDER / 1000.0;
}

void setup() {
  Serial.begin(115200);
  analogSetPinAttenuation(BATT_PIN, ADC_11db);
  float v = readBattery();
  wakeCount++;
  Serial.printf("Wake %d: battery %.2f V\n", wakeCount, v);

  // ... read sensors and send data here ...

  Serial.flush();
  if (v < STOP_V) {
    Serial.println("Battery low: sleeping until reset");
    esp_deep_sleep_start();               // no wake-up source: sleeps until reset
  }
  esp_sleep_enable_timer_wakeup(SLEEP_MIN * 60ULL * 1000000ULL);
  esp_deep_sleep_start();
}

void loop() {}   // never reached

Where the sleep current goes (typical figures)

  • ESP32 chip in deep sleep

    Sleep current
    About 10 µA
    Notes
    The datasheet figure everyone quotes
  • MT3608 idle

    Sleep current
    About 100 to 200 µA
    Notes
    Always on: it has no enable pin on the module
  • DevKit 3.3 V regulator (AMS1117)

    Sleep current
    About 5 mA
    Notes
    High quiescent current
  • DevKit USB-serial chip and power LED

    Sleep current
    About 1 to 10 mA
    Notes
    Varies by board
  • Battery divider (100k + 100k)

    Sleep current
    About 20 µA
    Notes
    Larger resistors draw less but make readings noisier

Order-of-magnitude figures: measure your own board. With a 2,500 mAh cell, a DevKit at about 6 mA sleeps for roughly 17 days; a bare module with a low-Iq LDO at about 30 µA, for years.

When to skip the boost converter

The table shows the uncomfortable truth: on a DevKit, the board itself wastes far more than the ESP32 sleeps on, and the MT3608 adds another 0.1 to 0.2 mA it can never switch off. For a node that sleeps most of the time:

  • Use a low-quiescent 3.3 V LDO straight from the cell (HT7333, MCP1700 or similar, a few µA of idle current). A Li-ion cell stays above about 3.4 V for most of its capacity, so the LDO holds 3.3 V almost to the end.
  • Use a bare ESP32 module or a low-power board without a USB-serial chip and power LED.
  • Keep the MT3608 for always-on projects, for 5 V peripherals (some displays, relays, LED strips), or when you need a stable 5 V from a cell.

The ESP32 deep sleep battery life guide shows how to measure and estimate the whole budget.

Troubleshooting on the ESP32

  • Brownout resets when Wi-Fi starts

    Likely cause
    The cell cannot deliver the input current peaks
    Fix
    Healthy protected cell, thicker wires, 470 µF on the MT3608 output
  • Battery reading stuck near 3.1 V or above

    Likely cause
    Divider missing, so the pin saturates
    Fix
    Check the 100k / 100k divider; the pin must stay under about 3.1 V
  • Battery reading jumps around

    Likely cause
    High-impedance divider picks up noise
    Fix
    Add 100 nF from GPIO34 to GND and average more samples
  • Readings wrong only with Wi-Fi on

    Likely cause
    Using an ADC2 pin
    Fix
    Use ADC1 pins (GPIO32 to 39); ADC2 is unavailable while Wi-Fi runs
  • Battery flat after a week of 'deep sleep'

    Likely cause
    DevKit regulator, USB chip and MT3608 idle current
    Fix
    See the sleep table; use a low-Iq LDO and a bare module for long life

ESP32 FAQ

Can the MT3608 output 3.3 V for the ESP32's 3V3 pin? Not reliably from a Li-ion cell: a boost converter cannot go below its input, and a charged cell is at 4.2 V. Use 5V/VIN, or a low-dropout regulator to 3.3 V.

Can I charge the cell while the ESP32 runs? The MT3608 does not charge anything. Add a charger with load sharing, or a TP4056-style module with protection, and read its CHRG pin if you want to show the charging state.

What about solar? A small panel with a charger module keeps the cell topped up; the MT3608 then boosts the cell to 5 V as before. Size the panel for the daily energy the node really uses, measured with an INA219.

Where next? Compare with the MT3608 Uno guide, or step a 12 V supply down instead with the LM2596 buck converter.

Keep learning

Related guides & projects