LOLIN D32

Wemos ESP32 board with LiPo charger and USB - ideal for battery-powered projects and embedded apps.

Micro-USB
LOLIN D32 board
57 × 25.4 mm
ESP32
MCU
240MHz
clock
4MB
flash
520KB
SRAM
26· 16 ADC
GPIO
BLE 4.2+ WiFi
radio
On this page

LOLIN D32 Pinout

33 pins · 2.54 mm pitch
LOLIN D32 pinout diagram, high resolution: all 33 pins, with GPIO numbers, ADC channels and strapping pins
LOLIN D32 pinout, drawn by ESPboards from the ESP32 Series Datasheet v5.3.
PinGPIOLabelsStatusCapabilitiesNotes
1-3V33V3.3Vpower-3.3 V rail from the ME6211 regulator (JP1 pin 1)
2-RSTRESETcontrol-ESP32 chip enable (EN) - printed RS on the front, RESET on the back; 10k pull-up, 100 nF to GND and the RESET button to GND. Pull LOW to reset
336IO36GPIO36VPSENSOR_VPA0strappingadcADC1_CH0; input only, no internal pull-up/down
439IO39GPIO39VNSENSOR_VNA3strappingadcADC1_CH3; input only, no internal pull-up/down
534IO34GPIO34A6strappingadcADC1_CH6; input only, no internal pull-up/down
632IO32GPIO32A4T9safeadc · touch · pwmADC1_CH4; Touch 9
733IO33GPIO33A5T8safeadc · touch · pwmADC1_CH5; Touch 8
825IO25GPIO25DAC1A18safeadc · dac · pwmADC2_CH8 (unusable while Wi-Fi is on); DAC1
926IO26GPIO26DAC2A19safeadc · dac · pwmADC2_CH9 (unusable while Wi-Fi is on); DAC2
1027IO27GPIO27A17T7safeadc · touch · pwmADC2_CH7 (unusable while Wi-Fi is on); Touch 7
1114IO14GPIO14HSPI_CLKA16T6strappingadc · touch · spi · pwmJTAG MTMS; ADC2_CH6 (unusable while Wi-Fi is on); Touch 6
1212IO12GPIO12HSPI_MISOA15T5strappingadc · touch · spi · pwmstrapping pin (MTDI): HIGH at boot selects 1.8 V flash and stops a 3.3 V module booting - keep it LOW at reset; ADC2_CH5 (unusable while Wi-Fi is on); Touch 5
1313IO13GPIO13HSPI_MOSIA14T4strappingadc · touch · spi · pwmJTAG MTCK; ADC2_CH4 (unusable while Wi-Fi is on); Touch 4
14-LDO_ENENcontrol-Enable of the ME6211 3.3 V regulator, NOT the ESP32 EN: held high to VIN through R4 100k. Pull LOW to switch the 3.3 V rail off (and the whole board with it)
15-USBVBUS5Vpower-USB VBUS (5 V) straight from the micro-USB connector, before the B5819 diode; feeds the TP4054 charger
16-BATVBATpower-LiPo battery + - the same net as the PH-2 socket, charged by the TP4054 (500 mA max) and switched onto VIN by the CJ2301 when USB is absent
17-GNDground-Ground
1823IO23GPIO23MOSIsafespi · pwmVSPI MOSI
1922IO22GPIO22SCLsafei2c · pwmI2C SCL (Arduino default)
201IO1GPIO1TXTXD0uartuart · pwmUART0 TX to the USB-serial chip (boot log, uploads)
213IO3GPIO3RXRXD0uartuart · pwmUART0 RX from the USB-serial chip (uploads)
2221IO21GPIO21SDAsafei2c · pwmI2C SDA (Arduino default)
2319IO19GPIO19MISOsafespi · pwmVSPI MISO
2418IO18GPIO18SCKsafespi · pwmVSPI SCK
255IO5GPIO5SSLED_BUILTINstrappingspi · pwmOn-board user LED (LED2, active LOW: 3V3 - R9 2k - LED - IO5); VSPI SS; strapping pin: sets SDIO-slave timing with MTDO at reset, does not affect normal boot
2617IO17GPIO17TX2uartuart · pwmUART2 TX (Arduino core 2.x default)
2716IO16GPIO16RX2uartuart · pwmUART2 RX (Arduino core 2.x default)
284IO4GPIO4A10T0safeadc · touch · pwmADC2_CH0 (unusable while Wi-Fi is on); Touch 0
290IO0GPIO0A11T1strappingadc · touch · pwmstrapping pin: LOW at reset enters the ROM bootloader; the auto-flash transistors drive it from DTR/RTS; ADC2_CH1 (unusable while Wi-Fi is on); Touch 1
302IO2GPIO2A12T2strappingadc · touch · pwmstrapping pin: must be LOW or floating to enter the bootloader; ADC2_CH2 (unusable while Wi-Fi is on); Touch 2
3115IO15GPIO15HSPI_CSA13T3strappingadc · touch · spi · pwmstrapping pin (MTDO): LOW at boot silences the ROM boot log; ADC2_CH3 (unusable while Wi-Fi is on); Touch 3
32-GNDground-Ground
3335IO35GPIO35VBAT_SENSEA7strappingadcBattery voltage sense, not on a header: VBAT through a 100k / 100k divider (R12 / R17), so VBAT = 2 x the pin voltage; ADC1_CH7; input only, no internal pull-up/down
Download the LOLIN D32 pinout Free to use and share for non-commercial work, as long as you credit espboards.dev. License.
26 GPIOs broken out 13 free · 12 need care · 1 to avoid

Start with these

13 pins with no boot or system involvement
IO32IO33IO25IO26IO27IO23IO22IO21IO19IO18IO17IO16IO4

Freely assignable - no strapping, flash, USB or JTAG duties. Ideal first picks for buttons, sensors and LEDs.

Fine - with a little care

12 pins · 12 things to know
IO36 Input-only GPIO (no output); ADC1 channel 0, Hall sensor VP. Other

Cannot be used as output; only suitable for input (e.g., analog read).

IO39 Input-only GPIO (no output); ADC1 channel 3, Hall sensor VN. Other

Cannot be used as output; only suitable for input.

IO34 Input-only GPIO (no output driver); ADC1 channel 6. Other

Cannot be used as output (no drive capability); only suitable for analog/digital input.

IO14 JTAG mode select pin (TMS); also HSPI CLK and PWM-capable GPIO. JTAG

Used for JTAG debugging (TMS); driving it as GPIO may interfere with JTAG or produce spurious signals at boot.

IO12 Bootstrapping pin; JTAG TDI; sets flash voltage (VDD_SDIO); also HSPIQ (flash data line). Strapping

Keep LOW during boot (internal PD); pulling HIGH at reset selects 1.8V flash mode, causing flash brownout if 3.3V flash is used.

IO13 JTAG clock pin (TCK); also ADC2 channel 4 / Touch4 input. JTAG

Used for JTAG debugging (TCK); avoid using as GPIO if JTAG is needed.

IO1 Default UART0 TX pin for USB-serial programming and console. UART

Connected to on-board USB-UART for uploading and logs; drives serial output at boot, so using as GPIO can disrupt programming or console.

IO3 Default UART0 RX pin for USB-serial programming (console input). UART

Used for receiving data from USB-UART (programming); also pulled HIGH at boot for console communication, so using as GPIO can disrupt uploads.

IO5 Bootstrapping pin; internal pull-up; VSPI CS0 (default SPI chip-select); acts as FSPIWP (flash write-protect) on internal-flash variants. Strapping

Must be HIGH during boot; if pulled LOW at reset, alters SDIO slave timing and may prevent normal boot.

IO0 Bootstrapping pin (enter bootloader when low); internal pull-up. Strapping

Must be HIGH during boot for normal startup; if held LOW on reset, forces flash programming mode.

IO2 Bootstrapping pin (must be low or floating at reset); internal pull-down. Strapping

If driven HIGH on reset (while IO0 is LOW), selects an unsupported SDIO boot mode, causing boot failure.

IO15 Bootstrapping pin; JTAG TDO; controls UART0 boot log output; also HSPICS0 (secondary SPI CS). Strapping

Keep HIGH during boot (internal PU); if LOW on reset, bootloader log is silenced and boot mode may change.

Only if you know the tricks

1 pins · 1 thing to know
IO35 Battery voltage sense, not on a header: VBAT through a 100k / 100k divider (R12 / R17), so VBAT = 2 x the pin voltage; ADC1_CH7; input only, no internal pull-up/down onboard hardware

Wired to the battery voltage divider on this board, which is soldered down. Driving it from your own code breaks that function.

These are recommendations, not hard rules - with the right pull-ups, timing and boot-state awareness most pins can be made to work. When in doubt, start green.

The LOLIN D32 pinout brings out 33 pins at a 2.54 mm pitch - 26 usable GPIO alongside the 3V3, USB, BAT and GND power rails.

Peripheral wiring is straightforward: I²C is mapped to SDA on GPIO21 and SCL on GPIO22; the SPI bus (MOSI, MISO, SCK, SS) is broken out in full; TX/RX on GPIO1 and GPIO3 cover serial logging and flashing.

Beyond plain digital I/O you get 16 ADC-capable pins for sensors and battery monitoring, PWM on 22 pins, 10 capacitive-touch inputs and 2 true DAC outputs.

12 of the exposed pins carry boot-time or system duties on the ESP32 (IO36, IO39, IO34 and 9 more) - check the guidance above before wiring anything to them. IO32, IO33, IO25, IO26 and 9 more are free of any such role - the safest first picks.

Getting started

flash your first firmware in ~2 minutes
Tool:
1
Connect over USB
Install your USB-serial driver (CH340 / CP210x) if no port appears. Not detected? Hold BOOT while plugging in.
2
Match & flash
Set the Tools options shown, then click Upload.
3
Verify it runs
GPIO32 toggles - wire an LED and resistor to it, or change the pin to your board's own LED.
Set these in Tools · leave everything else at default
Arduino IDE 2.x - Tools Copy
Board: "ESP32 Dev Module"▸
Flash Size: "4MB (32Mb)"▸
Flash Mode: "DIO"▸
Partition Scheme: "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)" (default)▸
Upload Speed: "921600"▸
▸ every other Tools option - leave at default
Board: ESP32 Dev Module
Flash Size: 4MB (32Mb)
Flash Mode: DIO
Partition Scheme: Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
Upload Speed: 921600
Find it: Tools ▸ Board ▸ ESP32 Arduino ▸ ESP32 Dev Module
blink.ino Copy
// toggle GPIO32 - wire an LED and resistor to it
void setup() {
  pinMode(32, OUTPUT);
}
void loop() {
  digitalWrite(32, HIGH); delay(500);
  digitalWrite(32, LOW);  delay(500);
}
board to selectesp32dev⧉ copy
platformio.ini Copy
[env:d32]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921600
Find it: PlatformIO Home ▸ Boards, search esp32dev - or type it after board =.
board to selectesp32dev⧉ copy
device.yaml Copy
esp32:
  board: esp32dev
  variant: esp32
  framework:
    type: esp-idf

# blink - GPIO32
output:
  - platform: gpio
    pin: 32
    id: led_out
light:
  - platform: binary
    name: "LED"
    output: led_out
Find it: search ESPHome's board list for esp32dev (same ids as PlatformIO).
esptool doesn't pick board settings - a prebuilt .bin already has them baked in. This is just the raw flash command.
terminal Copy
esptool.py --chip esp32 --port /dev/ttyACM0 \
  --baud 921600 write_flash 0x1000 firmware.bin
--port = your /dev/tty* (macOS/Linux) or COMx (Windows).
Build details: sketch space 1310720 B · data 327680 B · DIO

Downloads

Free for non-commercial use, credit espboards.dev · License
LOLIN D32 board illustration, front

Board illustration

The bare LOLIN D32 board drawn to scale at 57 × 25.4 mm, with no pin labels on it. Made for slide decks, wiring diagrams and project write-ups where a photo is too busy. Take the scalable SVG for print or editing, the high-resolution PNG to drop straight in, or the transparent PNG when you need it with no background behind it.

LOLIN D32 pinout diagram

Pinout diagram

Every pin on both sides of the board with its functions, drawn by ESPboards from the ESP32 Series Datasheet v5.3 - the same sheet shown at the top of this page. The PNG is a high-resolution image for screens, the SVG is vector so it stays sharp at any size, and the PDF is laid out to print on A4 or Letter.

Free for non-commercial use, with the credit line kept.

Embed the LOLIN D32 pinout

Paste this where you want the diagram. Keep the credit line - it is what the licence asks for, and it is the only thing we want in return.

<figure>
  <img src="https://cdn.espboards.net/boards/d32/diagram-1600.png"
       alt="LOLIN D32 pinout diagram" width="1600" loading="lazy">
  <figcaption>
    LOLIN D32 pinout by
    <a href="https://www.espboards.dev/esp32/d32/">ESPboards</a>,
    <a href="https://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC 4.0</a>
  </figcaption>
</figure>

Using it commercially? Ask us first - it takes one email.

Yours to use, share and adapt for non-commercial work, as long as you credit espboards.dev - the full terms and ready-made credit lines are here.

Specifications

ESP32 · 57 × 25.4 mm · vs other ESP32 chips →
Compute
MCU
ESP32
Clock
240 MHz
SRAM · Flash
520 KB · 4MB
Radio
Wi-Fi
802.11 b/g/n
Bluetooth
4.2 LE
Antenna
PCB
I/O
GPIO · ADC
26 · 16
UART · I²C · SPI
3 · 2 · 2
PWM
16 channels
Power
USB
Micro-USB
Serial
CH340C
Boot address
0x1000
Electrical
Input
5V USB · 3.7V LiPo
Consumption
-
Regulator
ME6211
Flashing
Upload · OTA
esptool_py · esp_ota
Flash · Boot mode
DIO · DIO
Sketch · Data
1.25 MB · 320 KB

Dimensions

LOLIN D32 board, drawn to scale
25.4 mm57 mm
57 × 25.4 mm · pin pitch 2.54 mm
The LOLIN D32 uses esptool_py for firmware uploads, esp_ota for over-the-air (OTA) updates. Flash mode is DIO with DIO boot mode. The maximum sketch size is 1.25 MB with 320 KB available for data.

About this board

Inside sits the ESP32 - a dual-core Xtensa with both Bluetooth Classic and BLE.

At $6.50 it's cheaper than most ESP32 boards, which usually run around $20.

Around the module: battery charging (TP4054) via JST-PH 2.0, status LEDs (User (GPIO5), Charge) and Reset buttons.

Where to buy

prices are typical street prices
LOLIN D32
LOLIN D32
$6.50per unit, typical

Resources

Similar boards