WeMos D1 Mini Pinout Reference

When it comes to ESP8266 boards, the WeMos D1 Mini stands out as a great choice for those just getting started with IoT. It’s small, well-supported, and ridiculously cheap, with prices as low as $3 USD per unit. This affordability has made it a favored option among both hobbyists and professionals alike.

In this article, we will look at the WeMos D1 Mini pinout in detail.

WeMos D1 Mini Pinout

The D1 Mini has 16 pins in total. The pinout is as follows:

wemos d1 mini pinout

Let’s take a closer look at the WeMos D1 Mini pins and their functions one by one.

WeMos D1 Mini GPIO Pins

The D1 Mini has 11 GPIO pins that can be programmed to perform a variety of functions. Each GPIO can be configured with an internal pull-up or pull-down resistor, or it can be set to high impedance.

wemos d1 mini gpio pins

Keep in mind that all pins are 3.3V logic level; exceeding this voltage will cause damage to the board.

Which GPIOs are safe to use?

Although the D1 Mini has a lot of pins with various functions, some of them may not be suitable for your projects. The table below shows which pins are safe to use and which pins should be used with caution.

  • – Your top priority pins. They are perfectly safe to use.
  • – Pay close attention because their behavior, particularly during boot, can be unpredictable. Use them only when absolutely necessary.
  • – It is recommended that you avoid using these pins.
  Label    GPIO    Safe to use?  Reason
D0GPIO16HIGH at boot, used to wake up from deep sleep
D1GPIO5
D2GPIO4
D3GPIO0connected to FLASH button, boot fails if pulled LOW
D4GPIO2HIGH at boot, boot fails if pulled LOW
D5GPIO14
D6GPIO12
D7GPIO13
D8GPIO15Required for boot, boot fails if pulled HIGH
RXGPIO3Rx pin, used for flashing and debugging
TXGPIO1Tx pin, used for flashing and debugging
A0ADC0Analog input pin, cannot be configured as output

The image below shows which GPIO pins can be used safely.

wemos d1 mini safe gpio pins

WeMos D1 Mini ADC Pins

The D1 Mini has a single analog input, A0. This analog input pin can measure voltages from 0 to 3.3V.

wemos d1 mini adc pin

It’s connected to a built-in SAR ADC with a resolution of 10-bits, which means it can differentiate 1024 (2^10) different voltage levels. In other words, it can convert input voltages ranging from 0 to 3.3V (operating voltage) into integer values ranging from 0 to 1024. This results in a resolution of 3.3 volts / 1024 units, or 0.0032 volts (3.2 mV) per unit.

WeMos D1 Mini SPI Pins

The D1 Mini has one hardware SPI interface (HSPI). It supports the general-purpose SPI features listed below:

  • Full-duplex SPI communication
  • 4 timing modes of the SPI format transfer
  • Clock frequency is 20 MHz at maximum
  • Up to 64-Byte FIFO
wemos d1 mini spi pins

It’s worth noting that while there is only one SPI bus, software SPI (also known as bit-banging) can be implemented on any GPIO pins if additional SPI buses are required, but at the expense of speed and possibly increased CPU usage.

WeMos D1 Mini I2C Pins

The D1 Mini has a single I2C interface which is realized via software programming (‘bit-banging’), meaning any GPIO pin can be defined to act as SCL and SDA. It works quite well, and the ESP8266 is fast enough to match ‘Arduino level’ speed (clock frequency is 100 kHz at maximum).

By default, GPIO4 (SDA) and GPIO5 (SCL) are used for I2C communication and are the default I2C pins for many libraries and examples you will find.

wemos d1 mini i2c pins

WeMos D1 Mini UART Pins

The D1 Mini has a single usable UART (Universal Asynchronous Receiver/Transmitter) interface, which is used for programming as well as general serial communication (e.g., sending or receiving data to and from a computer or a serial interface sensor).

wemos d1 mini uart pins

These pins are connected through to the CH340 USB-to-Serial converter so they should not be connected to or used unless you are absolutely certain you want to because you will also be getting USB traffic on these!

WeMos D1 Mini PWM Pins

Almost all digital pins (except D0) can produce a Pulse Width Modulation (PWM) signal. This is useful for controlling the speed of motors, dimming LEDs, and more.

wemos d1 mini pwm pins

Note that the PWM signal has a 10-bit resolution, and the PWM frequency range is adjustable between 1000 μs and 10000 μs, i.e., between 100 Hz and 1 kHz.

WeMos D1 Mini Power Pins

The WeMos D1 Mini has several pins dedicated to power:

wemos d1 mini power pins

5V pin: When connected via USB, this pin outputs a 5V supply drawn directly from the USB port. It can also be used to power the board when using an external power source.

3V3 pin: This pin provides a 3.3V output which can be used to power external components. The power is drawn from the on-board voltage regulator and has a limited supply current; you can get up to 600mA from it.

GND: is the ground pin.

WeMos D1 Mini Interrupt Pins

All GPIOs (except GPIO16) can be configured to trigger an interrupt on a rising, falling, or a change of state. This is essential for event-driven tasks like responding to a button press or a sensor signal.

WeMos D1 Mini Control Pins

wemos d1 mini control pins

The RST pin is the reset pin. Pulling this pin low resets the microcontroller, which is the same as pressing the reset button on the board.

The FLASH pin is used by the D1 Mini to determine when to boot into the bootloader. By pulling this pin low during power-up, you can put the D1 Mini into flashing mode, which is necessary for programming the board with new firmware.

The WAKE pin is used to wake the D1 Mini from deep sleep.