Home / Tutorials / ESP8266 Tutorial / WeMos D1 Mini Pinout and Getting Started Guide
pcbway
WeMos D1 Mini Pinout
ESP8266 Tutorial

WeMos D1 Mini Pinout and Getting Started Guide

The WeMos D1 Mini is a compact ESP8266 development board with 11 digital I/O pins, one analog input, and built-in WiFi. This guide covers the complete WeMos D1 Mini pinout, including the D0–D8 to ESP8266 GPIO mapping, I2C, SPI, UART, ADC, power and boot pins. After the pinout reference, we'll also set up the board in the Arduino IDE and upload a simple example sketch.

The WeMos D1 Mini is part of the WeMos D1 family of development boards that feature the popular ESP8266 WiFi chip. If you have just purchased this board, then you’re on the right page. This WeMos D1 Mini tutorial will show how to start programming with this device.

WeMos D1 Mini

WeMos D1 Mini Pinout

As far as pinout goes, the WeMos D1 Mini is very much like the NodeMCU, albeit smaller.

WeMos D1 Mini Pinout

D1 Mini Pin ESP8266 GPIO Main Function Important Note
D0 GPIO16 GPIO, deep sleep Limited interrupt support
D1 GPIO5 GPIO, I2C SCL Good general-purpose pin
D2 GPIO4 GPIO, I2C SDA Good general-purpose pin
D3 GPIO0 GPIO, boot 10 kΩ pull-up
D4 GPIO2 GPIO, onboard LED 10 kΩ pull-up
D5 GPIO14 GPIO, SPI SCK SPI clock
D6 GPIO12 GPIO, SPI MISO SPI input
D7 GPIO13 GPIO, SPI MOSI SPI output
D8 GPIO15 GPIO, SPI SS 10 kΩ pull-down
RX GPIO3 UART RX Serial receive
TX GPIO1 UART TX Serial transmit
A0 ADC0 Analog input 3.2 V max on D1 Mini
3V3 — 3.3 V power —
5V — 5 V power USB/VBUS rail
G — Ground —
RST — Reset Active-low reset

It has sixteen pins as shown and follows the same naming scheme as the NodeMCU. However, unlike the NodeMCU, it has one pin that can produce 5V. Moreover, each of the I/O pins run at 3.3V so if you want to use it with 5V devices, you need a level shifter.

Setting Up the Arduino IDE for the WeMos D1 Mini

To program this board, we must make the Arduino IDE recognize it. Download the latest Arduino IDE and install it on your computer. Once installed, fire up the IDE and go to File > Preferences.

Step 1: Setup additional board managers URL_a

This will bring up the Preferences window. On the Additional Boards Manager URLs field, paste this:

https://arduino.esp8266.com/stable/package_esp8266com_index.json

Press OK to close the window.


The json file will give the IDE information about the WeMos D1 Mini and other ESP8266-based boards.

Next, go to Tools > Board > Boards Manager.. to open up the Board Manager window.


On the search field, type ESP8266 and one result should appear. Click the install button on the lower right.

Wait for the download to finish. After that, you can now use the Arduino IDE to program the WeMos D1 Mini.

Connecting the WeMos D1 Mini

With a microUSB cable, connect the WeMos D1 Mini to your computer then select the correct board on Tools > Board:

Also, make sure you select the correct COM Port:


We may not have the same COM port designation. If there’s nothing else connected to your computer, then only one COM port should appear if you connect the board to a USB port.

If your computer fails to detect your board, you might need to install the CH340 driver.

 

An Example Sketch

We will use a program that flashes the on-board LED to test if the board works,. This is the same blink program included in the IDE so you might as well go to File > Examples > 01. Basics > Blink.

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Upload the sketch then watch the blue LED blink!

Since this board is very similar to the NodeMCU, you can try out the sketches in my other tutorials featuring the NodeMCU. I have also a tutorial on creating a WiFi server with the WeMos D1 Mini.

What projects will you create using this WiFi board? If you find this WeMos D1 Mini tutorial helpful, kindly drop a comment below!

0 0 votes
Article Rating
Subscribe
Notify of
guest
4 Comments
Oldest
Newest Most Voted
Kaleb
6 years ago

good job thank you very much

Hans
Hans
5 years ago

Finally a clear description for a noob like me. Thank you very much.

ben
ben
4 years ago

Very clear and price guide. Thank you.

ben
ben
4 years ago

* precise guide