Getting started with the WeMos D1 ESP8266 WiFi Board

🕒 4 min read

The WeMos D1 is a ESP8266 WiFi based board that uses the Arduino layout with a operating voltage of 3.3V. As the documentation of this board online can be a little confusing, the purpose of this tutorial is to combine and simplify the steps needed to setup this board for development. With that, let’s proceed on with the specifications of the board.

Note: This is NOT an Arduino board, it only uses the Arduino Uno layout for the board design!


Here are the specification of the board:

Microcontroller ESP-8266EX
Operating Voltage 3.3V
Digital I/O Pins 11
Analog Input Pins 1
Clock Speed 80MHz/160MHz
Flash 4M bytes
Length 68.6mm
Width 53.4mm
Weight 25g

In summary, the board is controlled by the ESP8266 chip (a 32-Bit processor) and has a larger flash memory compared to an Arduino Uno. It consists of 11 digital I/O pins and 1 analogue (input) pin. the board can be connected using a Micro-B type USB cable. (Aka “Android Cable”)


All the I/O pins:

  • Runs at 3.3V
  • Have interrupt/PWM/I2C/one-wire support except D0
Pin Function ESP-8266 Pin
A0 Analog input, max 3.3V input A0
D3 IO, 10k Pull-up GPIO0
D4 IO, 10k Pull-up, BUILTIN_LED GPIO2
D8 IO, 10k Pull-down, SS GPIO15
G Ground GND
5V 5V
3V3 3.3V 3.3V


There are 2 IDE that can be used to program the ESP8266:

  • The Arduino IDE
  • The NodeMCU IDE

In this tutorial, we’ll be looking at how to setup the board with the Arduino IDE on Windows. (For installation on a Linux-based system, you can visit this website, though the installation instructions are very similar:

Software Requirements


Create a new folder esp8266com/esp8266 in your Arduino sketch directory. (The Arduino sketch location should be located in “My Documents > Arduino” by default).

Next, download the library/driver file (as zip) from Github:

After the download has completed, copy the zip file over to the [Arduino sketch]/hardware/esp8266com/esp8266 directory & extract the contents. A Arduino-Master folder will be created.

Next, enter the directory and drag all the content into the main directory. Finally, remove both the and the Arduino-master folder. Your directory now should look like this:

Open the terminal and enter the esp8266/tools folder. (e.g. [Arduino sketch]/hardware/esp8266com/esp8266/tools) After that, exceute the script via the python command.

C:\Users\[username]\My Documents\Arduino\hardware\esp8266com\esp8266\tools> python

This will download the Binary Tools required to program the board. Once the installation has completed, it should look like that:

With that, you are ready to test out your WeMos D1 board!



To test out whether the hardware library/driver is properly installed, we’ll be testing out the sample program Blink, an equivalent to the Hello World! example in the Hardware environment. To do so, start the Arduino IDE and open the sketch at the following location:


If you are lazy, just copy the code below:

 ESP8266 Blink by Simon Peter
 Blink the blue LED on the ESP-01 module
 This example code is in the public domain
 The blue LED on the ESP-01 module is connected to GPIO1 
 (which is also the TXD pin; so we cannot use Serial.print() at the same time)
 Note that this sketch uses LED_BUILTIN to find the pin with the internal LED

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
                                    // but actually the LED is on; this is because 
                                    // it is active low on the ESP-01)
  delay(1000);                      // Wait for a second
  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)

After opening the sketch file, go to Tools > Board and select the “WeMos D1 R2 & Mini” option. Connect the WeMos Board & upload the code. The LED on the ESP8266 will start to blink. (If the LED on the ESP8266 is blinking when a USB is plugged, you can try modifying the “delay” values to see whether it updates accordingly.)


Checking out the Chip ID

To check the ID of the chip, copy the code below & upload into the WeMos D1 board.

 *  Get Chip ID

void setup() {

void loop() {
  Serial.println("Check ID in:");
  Serial.printf("Chip ID = %08Xn", ESP.getChipId());

After the code has been uploaded, open up the Serial Monitor and set the baudrate to 115200. The ID should be printed in the monitor.


Running a Simple Web Server

For this section, the ESP8266 will be ran as a simple server in a local network, hosting a simple HTML file at port 80. Go to the following directory & open up HelloServer.ino.


Alternatively, you can copy the code below:

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

const char* ssid = "........";
const char* password = "........";

ESP8266WebServer server(80);

const int led = 13;

void handleRoot() {
digitalWrite(led, 1);
server.send(200, "text/plain", "Hello from esp8266!");
digitalWrite(led, 0);

void handleNotFound(){
digitalWrite(led, 1);
String message = "File Not Foundnn";
message += "URI: ";
message += server.uri();
message += "nMethod: ";
message += (server.method() == HTTP_GET)?"GET":"POST";
message += "nArguments: ";
message += server.args();
message += "n";
for (uint8_t i=0; i<server.args(); i++){
message += " " + server.argName(i) + ": " + server.arg(i) + "n";
server.send(404, "text/plain", message);
digitalWrite(led, 0);

void setup(void){
pinMode(led, OUTPUT);
digitalWrite(led, 0);
WiFi.begin(ssid, password);

// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
Serial.print("Connected to ");
Serial.print("IP address: ");

if (MDNS.begin("esp8266")) {
Serial.println("MDNS responder started");

server.on("/", handleRoot);

server.on("/inline", [](){
server.send(200, "text/plain", "this works as well");


Serial.println("HTTP server started");

void loop(void){

Before uploading the code, you have to change 2 variable value: ssid and password. Replace them with your router’s ssid (or connection name) and the password accordingly. For example, if the router name is “router-17” and password “1234”, the variables would look something like this:

const char* ssid = "router-17";
const char* password = "1234";

After changing the variable values, upload the code and open up the Serial Monitor. (Set the baud rate to 115200) If the board is connected to the network, it will display it’s IP address. Assuming that your computer is connected to the same network, copy the IP address of the server and paste it over at your preferred web browser. The webpage would display a simple “Hello from esp8266!” webpage.



Share your love


    • Hi, the GPIO pins on the board could be used, but take note that it only accepts and outputs a maximum of only 3.3V.

  1. Excellent instructions. Thank You. This was the fastest I ever got a board working like it should and some positive results to boot.

  2. Many thanks for the great articles. Been viewing with my son as i teach him basics of microcontollers.

  3. “C:\Users\[username]\My Documents\Arduino\hardware\esp8266com\esp8266\tools> python” no longer works since the “python” was renamed to “”. You can either run the command in cmd “C:\Users\[username]\My Documents\Arduino\hardware\esp8266com\esp8266\tools>” or run the “” manually from “Documents\Arduino\esp8266com\esp8266\tools” folder.

  4. Thanks for helping me get my board up and running. Although in the web server example code there are a bunch of empty #includes. What exactly are we including here?

    • Hi Brett, the include section was to import the libraries which was not showing up, have rectified the issue and should be showing now.

  5. Thanks for this tutorial, but unfortunately I have failed 🙁
    I am trying to get this to work, but I cannot find the board in the list. I have looked to install more boards via the board Manager, but cannot find the “WeMos D1 R2 & Mini” board listed. The closest I can find is the “WeMOS D1 Mini ESP32”. When I use that I get (expectedly) an error: “A fatal error occurred: This chip is ESP8266 not ESP32. Wrong –chip argument?”
    How do I get the board option you mention?

Leave a Reply

Your email address will not be published. Required fields are marked *