📋 Overview
The WeMos D1 R2 is a WiFi-enabled development board based on the ESP8266 ESP-12F module, designed in the familiar Arduino UNO R3 form factor. If you've used an Arduino UNO before, you'll feel right at home — the board layout, pin headers, and USB programming workflow are very similar. The big difference is that this board has built-in WiFi, making it ideal for Internet of Things (IoT) projects, home automation, web servers, and any application where you need wireless connectivity.
The board uses the CH340 USB-to-serial chip for programming and serial communication, and is fully compatible with the Arduino IDE once you install the ESP8266 board package. It features 11 digital GPIO pins, 1 analog input, an on-board 5V switching power supply, and a 3.3V LDO regulator that powers the ESP8266 module.
⚠️ Important: This is a 3.3V logic level board. All GPIO pins operate at 3.3V. Applying 5V to any GPIO pin can permanently damage the ESP8266 chip. If you're connecting 5V sensors or modules, you must use a level shifter. The analog input (A0) has a maximum input voltage of 3.2V.
⭐ Key Features
- Built-In WiFi: ESP8266 ESP-12F module with 802.11 b/g/n WiFi (2.4 GHz)
- Arduino UNO R3 Form Factor: Same board layout and header spacing as the Arduino UNO — compatible with many UNO shields (with voltage considerations)
- Arduino IDE Compatible: Program using the familiar Arduino IDE with the ESP8266 board package
- 11 Digital GPIO Pins: All support interrupt, PWM, I²C, and one-wire (except D0)
- 1 Analog Input: 10-bit ADC on pin A0 (3.2V max input)
- CH340 USB-to-Serial: Reliable USB programming and serial communication via Micro USB
- Flexible Power Options: Power via Micro USB (5V), DC barrel jack (9–24V), or 5V pin
- On-Board Voltage Regulation: 5V switching power supply (1A) plus 3.3V LDO for the ESP8266 and 3.3V output pin
- 80 MHz Processor: ESP8266 running at 80 MHz with 4MB flash memory
- FCC Certified: ESP8266-12F module is FCC certified
📊 Specifications
| Parameter | Value |
|---|---|
| Microcontroller | ESP8266 (Tensilica L106 32-bit) |
| WiFi Module | ESP-12F (802.11 b/g/n, 2.4 GHz) |
| Clock Speed | 80 MHz (can be set to 160 MHz) |
| Flash Memory | 4 MB |
| SRAM | 64 KB instruction / 96 KB data |
| Digital I/O Pins | 11 (GPIO with interrupt/PWM/I²C/one-wire, except D0) |
| Analog Input Pins | 1 (A0, 10-bit ADC, 3.2V max) |
| PWM Resolution | 10-bit (1 MHz frequency) |
| Operating Voltage (Logic) | 3.3V |
| USB Power Input | 5V via Micro USB |
| DC Jack Power Input | 9V – 24V DC |
| On-Board Regulator | 5V switching (1A) + 3.3V LDO |
| USB-to-Serial Chip | CH340 |
| Upload Speed | 115200 baud (default) |
| Board Dimensions | Approx. 69 × 54 mm (2.7 x 2.1 inches) L × W |
📌 Pinout
The WeMos D1 R2 uses Arduino-style pin labels (D0–D8, A0) printed on the board, but these map to different ESP8266 GPIO numbers internally. This is important when using libraries or code that references GPIO numbers directly.
| Board Pin | ESP8266 GPIO | Function | Notes |
|---|---|---|---|
| D0 | GPIO16 | Digital I/O | No interrupt, no PWM, no I²C. Used for deep sleep wake. |
| D1 | GPIO5 | Digital I/O, SCL | Default I²C clock line. Safe for general use. |
| D2 | GPIO4 | Digital I/O, SDA | Default I²C data line. Safe for general use. |
| D3 | GPIO0 | Digital I/O | Pulled HIGH at boot. LOW = flash mode. Avoid pulling low at startup. |
| D4 | GPIO2 | Digital I/O, Built-in LED | Pulled HIGH at boot. Connected to on-board LED (active LOW). |
| D5 | GPIO14 | Digital I/O, SCLK | SPI clock. Safe for general use. |
| D6 | GPIO12 | Digital I/O, MISO | SPI MISO. Safe for general use. |
| D7 | GPIO13 | Digital I/O, MOSI | SPI MOSI. Safe for general use. |
| D8 | GPIO15 | Digital I/O, CS | Pulled LOW at boot. Must be LOW during boot or board won't start. |
| TX | GPIO1 | UART TX | Serial transmit. Used during upload — avoid connecting peripherals here. |
| RX | GPIO3 | UART RX | Serial receive. Used during upload — avoid connecting peripherals here. |
| A0 | ADC0 | Analog Input | 10-bit ADC. Maximum input voltage: 3.2V. |
Tip — Safest Pins for General Use: D1 (GPIO5), D2 (GPIO4), D5 (GPIO14), D6 (GPIO12), and D7 (GPIO13) are the safest pins for connecting sensors, LEDs, relays, and other peripherals. They have no boot-mode restrictions and won't interfere with startup or programming.
Pins to Use with Caution
- D0 (GPIO16): Does not support interrupt, PWM, or I²C. Used for deep sleep wake — connect D0 to RST for deep sleep wake-up.
- D3 (GPIO0): Must be HIGH during boot. If pulled LOW at startup, the board enters flash/programming mode and won't run your sketch.
- D4 (GPIO2): Must be HIGH during boot. Connected to the on-board LED (active LOW). Can be used for output after boot, but avoid pulling LOW at startup.
- D8 (GPIO15): Must be LOW during boot. Has an internal pull-down. Connecting a pull-up resistor or driving HIGH at startup will prevent the board from booting.
- TX/RX (GPIO1/GPIO3): Used for serial communication and sketch upload. Connecting peripherals to these pins can interfere with programming and Serial Monitor output.
🔋 Power
The WeMos D1 R2 can be powered in three ways:
| Method | Voltage | Notes |
|---|---|---|
| Micro USB | 5V | From your computer or a USB power adapter. Also provides serial communication for programming. |
| DC Barrel Jack | 9V – 24V DC | On-board switching regulator steps down to 5V (1A max), then 3.3V LDO for the ESP8266. |
| 5V Pin | 5V (regulated) | You can supply regulated 5V directly to the 5V header pin. Do not exceed 5V on this pin. |
Note: The 3.3V output pin on the board is powered by the on-board LDO regulator. You can use it to power low-current 3.3V sensors and modules, but do not draw more than a few hundred milliamps from it. Do not apply external voltage to the 3.3V pin — this could damage the regulator or the ESP8266.
💻 Software Setup
The WeMos D1 R2 is programmed using the Arduino IDE. Before you can upload your first sketch, you need to install the CH340 USB driver and the ESP8266 board package.
Step 1: Install the CH340 USB Driver
The board uses the CH340 chip for USB-to-serial communication. Most modern operating systems (Windows 10/11, macOS, Linux) include CH340 drivers automatically. If your computer doesn't recognize the board when you plug it in:
-
Windows: Download the CH340 driver from the WCH official website
For step-by-step instructions for installing the CH340 driver in Windows, - see Appendix A below.
- macOS: Download from the same WCH website.
- Linux: The CH340 driver is typically built into the kernel. No installation needed.
After installing the CH340 driver:
- Restart your computer
- Then connect the board
⚠️ Warning: If you skip this step, your board will not appear in the Arduino IDE.
Step 2: Install the ESP8266 Board Package
- Open the Arduino IDE
- Go to File > Preferences
- In the Additional Board Manager URLs field, paste this URL:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
(If you already have other URLs there, separate them with commas) - Click OK
- Go to Tools > Board > Boards Manager
- Search for esp8266
- Install the esp8266 by ESP8266 Community package
- Close the Boards Manager
Step 3: Configure the Arduino IDE
After installing the board package, set the following under the Tools menu:
| Setting | Value |
|---|---|
| Board | "LOLIN (WEMOS) D1 R2 & mini" |
| Upload Speed | 115200 |
| CPU Frequency | 80 MHz |
| Flash Size | 4MB (FS:2MB OTA:~1019KB) |
| Port | Select the COM port that appears when you plug in the board |
Tip: If you don't see a COM port after plugging in the board, the CH340 driver is likely not installed. Go back to Step 1. On Windows, check Device Manager for an unrecognized device under "Ports (COM & LPT)" or "Other devices."
🚀 Step 1: Blink the Built-In LED
This is the classic "Hello World" of microcontrollers. The WeMos D1 R2 has a built-in LED connected to pin D4 (GPIO2). This sketch blinks it on and off every second to confirm your board, driver, and IDE setup are all working correctly.
/*
* Blink Built-In LED
* Envistia Mall - Product Support
*
* Blinks the on-board LED on the WeMos D1 R2.
* The built-in LED is on GPIO2 (D4) and is active LOW.
*
* No external wiring required.
*/
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, LOW); // LED ON (active LOW)
delay(1000);
digitalWrite(LED_BUILTIN, HIGH); // LED OFF
delay(1000);
}
How to Use:
- Connect the WeMos D1 R2 to your computer via Micro USB
- In the Arduino IDE, select Tools > Board > "LOLIN (WEMOS) D1 R2 & mini"
- Select the correct COM port under Tools > Port
- Click Upload (the right-arrow button)
- After uploading, the on-board LED should blink on and off every second
Note: The built-in LED on the WeMos D1 R2 is active LOW — writing
LOWturns it ON, and writingHIGHturns it OFF. This is the opposite of most Arduino boards and catches many people off guard.
🚀 Step 2: Connect to WiFi and Start a Web Server
This sketch connects the WeMos D1 R2 to your WiFi network and starts a simple web server. You can then open a browser on any device on the same network and see a web page served by the board. This demonstrates the core WiFi capability that makes the ESP8266 so popular for IoT projects.
/*
* Simple WiFi Web Server
* Envistia Mall - Product Support
*
* Connects to WiFi and serves a simple web page
* showing the board's IP address and uptime.
*
* Replace YOUR_SSID and YOUR_PASSWORD with your
* WiFi network credentials.
*/
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASSWORD";
ESP8266WebServer server(80);
void handleRoot() {
unsigned long uptime = millis() / 1000;
String html = "<html><body>";
html += "<h1>WeMos D1 R2 Web Server</h1>";
html += "<p>WiFi Connected!</p>";
html += "<p>IP Address: " + WiFi.localIP().toString() + "</p>";
html += "<p>Uptime: " + String(uptime) + " seconds</p>";
html += "</body></html>";
server.send(200, "text/html", html);
}
void setup() {
Serial.begin(115200);
delay(100);
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.println("WiFi connected!");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
server.on("/", handleRoot);
server.begin();
Serial.println("Web server started.");
}
void loop() {
server.handleClient();
}
How to Use:
- Replace
YOUR_SSIDandYOUR_PASSWORDwith your WiFi network name and password - Upload the sketch to the board
- Open the Serial Monitor at 115200 baud
- Wait for the board to connect — it will print its IP address (e.g.,
192.168.1.105) - Open a web browser on any device on the same WiFi network and navigate to that IP address
- You should see a web page showing the board's IP and uptime
🛠️ Troubleshooting
| Symptom | Possible Cause | Solution |
|---|---|---|
| Board not recognized by computer | CH340 driver not installed | Install the CH340 driver from the WCH website (see Software Setup above) |
| No COM port appears | Bad USB cable (charge-only) | Try a different Micro USB cable — make sure it's a data cable, not a charge-only cable |
| Upload fails with "espcomm" error | Wrong board selected | Verify Tools > Board is set to "LOLIN (WEMOS) D1 R2 & mini" |
| Upload fails with timeout | Wrong COM port | Check Tools > Port and select the correct port. Unplug and replug the USB cable. |
| Board boots into flash mode | D3 (GPIO0) pulled LOW at boot | Disconnect anything connected to D3 and reset the board |
| Board won't boot at all | D8 (GPIO15) pulled HIGH at boot | Disconnect anything connected to D8 and reset the board |
| WiFi won't connect | Wrong SSID or password | Double-check your WiFi credentials. The ESP8266 only supports 2.4 GHz networks — it cannot connect to 5 GHz. |
| Analog readings are wrong | Input voltage exceeds 3.2V | Use a voltage divider to bring the signal below 3.2V before connecting to A0 |
| Erratic behavior or random resets | Insufficient power | The ESP8266 draws significant current during WiFi transmission (up to ~300 mA peaks). Use a quality USB cable and power source. |
| 5V sensor not working | Logic level mismatch | This is a 3.3V board. Use a logic level shifter between 5V sensors/modules and the GPIO pins. |
💡 Tips & Best Practices
- 3.3V Logic — Always: Every GPIO pin on this board operates at 3.3V. Never connect a 5V signal directly to any GPIO pin. Use a level shifter or voltage divider when interfacing with 5V devices.
- Use the Safe Pins: For general-purpose I/O, stick to D1, D2, D5, D6, and D7. These have no boot-mode restrictions and are the most reliable for sensors, LEDs, and other peripherals.
- WiFi is 2.4 GHz Only: The ESP8266 does not support 5 GHz WiFi networks. Make sure your router has a 2.4 GHz band enabled.
- Deep Sleep: For battery-powered projects, use the ESP8266's deep sleep mode to dramatically reduce power consumption. Connect D0 (GPIO16) to RST with a jumper wire to enable wake-up from deep sleep.
- Use a Data USB Cable: Many Micro USB cables are charge-only and don't have data lines. If your computer doesn't recognize the board, try a different cable before troubleshooting drivers.
- Arduino UNO Shields: While the board has the same form factor as the Arduino UNO, not all UNO shields are compatible. Shields that use 5V logic, SPI on pins 10–13, or the UNO's specific pin mapping may not work correctly. Always check voltage compatibility.
- OTA Updates: The ESP8266 supports Over-The-Air (OTA) firmware updates via WiFi, so you don't need a USB cable after the initial upload. Search for "ESP8266 ArduinoOTA" for setup instructions.
- Serial Monitor Baud Rate: The default boot messages from the ESP8266 are sent at 74880 baud. If you see garbled text at startup, that's normal — your sketch's Serial output will appear at whatever baud rate you set (typically 115200).
⚠️ Important Notes
- 3.3V Logic Level: All GPIO pins are 3.3V. Applying 5V to any pin will damage the ESP8266 chip. This is the most common cause of board failure.
- Analog Input Limit: The maximum input voltage on A0 is 3.2V. Exceeding this can damage the ADC.
- DC Jack Voltage: The DC barrel jack accepts 9V–24V. Do not exceed 24V or the on-board switching regulator may be damaged.
- Boot Pin Restrictions: D3 (GPIO0), D4 (GPIO2), and D8 (GPIO15) have specific state requirements during boot. Connecting peripherals that pull these pins to the wrong state will prevent the board from starting. See the Pinout section for details.
- Current Limits: Each GPIO pin can source or sink approximately 12 mA. The absolute maximum is 20 mA per pin. For higher-current loads (LEDs, relays, motors), use a transistor or MOSFET driver.
- WiFi Power Draw: The ESP8266 can draw up to 300 mA during WiFi transmission bursts. Use a power supply that can handle these peaks. Thin or long USB cables may cause voltage drops that lead to instability.
- Not 100% Arduino UNO Compatible: Despite the UNO form factor, the pin mapping, voltage levels, and available peripherals differ from a genuine Arduino UNO. Code written for the UNO may need modifications — especially pin numbers and any 5V-dependent logic.
🏪 Where to Buy
The WeMos D1 R2 ESP8266 WiFi Development Board is available from Envistia Mall:
Buy the WeMos D1 R2 ESP8266 WiFi Development Board →
- 📦 Fast Free US Shipping
- 🔄 Hassle-Free Returns
- 📧 Responsive Customer Support
📚 Additional Resources
- CH340 USB Driver (Official): WCH CH341SER Downloa
- ESP8266 Arduino Board Package: ESP8266 Arduino Core — GitHub
- ESP8266 GPIO Reference: ESP8266 Pinout Reference — Random Nerd Tutorials
📄 Appendix A: How to Install the CH340G Driver on Your Windows Computer
The CH340 USB IC is made by WCH. You can find the latest version of their drivers on their English-translated website here:
http://www.wch-ic.com/downloads/CH341SER_ZIP.html
- Click the Download button on the WCH page to download the ch341ser.zip file to your computer
- Unzip (extract) the ch341ser.zip file
- Run the Setup application in the CH341SER folder of the unzipped file (see screenshot below)

Click the Uninstall button first to remove any old versions, then click the Install button.
CH340G Driver Verification for Windows
To verify that your CH340G driver is working, you should see a difference in the Windows Device Manager and Arduino IDE Ports after plugging the board into a USB port on your computer.
Device Manager
To check that the CH340 associates to a COM port, open the Windows Device Manager. You can click the Start or ⊞ (Windows) button and type "device manager" to search for the application.
After opening the Device Manager, open the Ports (COM & LPT) tree. The CH340 should show up as USB-SERIAL CH340 (COM##). Depending on your computer, the COM port may show up as a different number.

Arduino IDE
If you have the Arduino IDE installed, you should also see a change in the number of available COM Ports (you may need to restart the Arduino IDE for the board to populate). Without the CH340 connected to your computer, in the IDE click on Tools > Port. Take note of the Serial Ports available:

Connect the board with the CH340 to your computer's USB port. Click somewhere else on the screen for the menu to refresh itself. Then go back to Tools > Port. A new COM port should appear. By process of elimination, the CH340 should have associated to the new COM port. Select this COM port to connect the IDE to your board.
In the example shown in these two screenshots, the new board is associated to COM Port 3.

Sold and supported by Envistia Mall. Ships from the USA. This product is compatible with Arduino Uno but is not manufactured by or affiliated with Arduino. "Arduino" and "Uno" are trademarks of Arduino SA. The manufacturer and Envistia LLC (dba Envistia Mall) are not responsible for any damages or losses resulting from the use of this product. Always follow proper electrical safety practices when working with electronic components. Specifications are based on manufacturer data and are subject to change without notice.