Skip to content

All items ship from our office in Colorado USA - $5.95 Flat-Rate US shipping & free shipping on orders over $75!

D1 Mini NodeMCU & Arduino WiFi ESP8266 ESP-12 WeMos Microcontroller User Guide

D1 Mini NodeMCU & Arduino WiFi ESP8266 ESP-12 WeMos Microcontroller

📋 D1 Mini Overview

The D1 Mini is a compact, affordable WiFi-enabled development board based on the ESP8266EX microcontroller. It's one of the most popular boards for Internet-of-Things (IoT) prototyping, packing WiFi connectivity, 4MB of flash memory, and 11 digital I/O pins into a tiny form factor.

The D1 Mini is fully compatible with the Arduino IDE and supports NodeMCU/Lua programming. It also supports both serial (USB) and OTA (Over-The-Air) programming, making it incredibly versatile for projects of all sizes.

Why Choose the D1 Mini?

  • Ultra-compact — Barely larger than a postage stamp
  • Built-in WiFi — 802.11 b/g/n connectivity right out of the box
  • Arduino compatible — Program it with the familiar Arduino IDE
  • Shield ecosystem — Stackable shields available for displays, relays, sensors, motors, and more
  • Multiple header options — Comes with male, female, and long female headers for flexible mounting

🔧 Technical Specifications

Feature Specification
Microcontroller ESP8266EX (ESP-12 module)
Operating Voltage 3.3V
Input Voltage (USB) 5V via Micro-USB
Digital I/O Pins 11 (all support interrupt/PWM/I²C/one-wire except D0)
Analog Input Pins 1 (A0, 0–3.2V max input)
Flash Memory 4MB
Clock Speed 80MHz / 160MHz
WiFi 802.11 b/g/n (2.4GHz)
USB-to-UART Chip CH340G
Antenna Built-in PCB antenna
Board Dimensions 34.2mm × 25.6mm × 6.8mm (1.35" × 1.0" × 0.27")
Weight ~5g (excluding headers)

📌 Pinout Reference

                 ┌───────────┐
           RST  ─┤ 1      16 ├─  TX  (GPIO1)
            A0  ─┤ 2      15 ├─  RX  (GPIO3)
    D0 (GPIO16) ─┤ 3      14 ├─  D1  (GPIO5)  [SCL]
    D5 (GPIO14) ─┤ 4      13 ├─  D2  (GPIO4)  [SDA]
    D6 (GPIO12) ─┤ 5      12 ├─  D3  (GPIO0)
    D7 (GPIO13) ─┤ 6      11 ├─  D4  (GPIO2)  [LED]
    D8 (GPIO15) ─┤ 7      10 ├─  GND
           3V3  ─┤ 8       9 ├─  5V
                 └───────────┘

Pin Details

Board Label GPIO Function Notes
TX GPIO1 UART Transmit Used for serial communication; avoid for general I/O
RX GPIO3 UART Receive Used for serial communication; avoid for general I/O
A0 ADC0 Analog Input 0–3.2V input range; 10-bit resolution (0–1023)
D0 GPIO16 Digital I/O Wake from deep sleep; no PWM/I²C/interrupt support
D1 GPIO5 Digital I/O / SCL Default I²C clock line — safe to use ✅
D2 GPIO4 Digital I/O / SDA Default I²C data line — safe to use ✅
D3 GPIO0 Digital I/O Pulled HIGH; LOW at boot enters flash mode — use with caution ⚠️
D4 GPIO2 Digital I/O Built-in LED (active LOW); pulled HIGH at boot — use with caution ⚠️
D5 GPIO14 Digital I/O / SCK SPI clock — safe to use ✅
D6 GPIO12 Digital I/O / MISO SPI data in — safe to use ✅
D7 GPIO13 Digital I/O / MOSI SPI data out — safe to use ✅
D8 GPIO15 Digital I/O / SS SPI select; pulled LOW at boot — use with caution ⚠️
RST Reset Active LOW; resets the board
3V3 Power 3.3V regulated output
5V Power 5V from USB input
GND Ground Common ground
⚠️ Important: All I/O pins operate at 3.3V logic. Do not apply 5V to any GPIO pin — this can permanently damage the board.
💡 Pin Selection Tip: For general-purpose use, pins D1, D2, D5, D6, and D7 are the safest choices. Pins D3, D4, and D8 have pull-up/pull-down resistors that affect boot behavior, so use them only when necessary and be aware of their boot-time states.

🔌 Header Pin Options

The D1 Mini comes with three sets of header pins (unsoldered) to support various configurations:

Header Type Best For
Female headers Stacking shields on top of the D1 Mini — recommended for most users
Male headers Plugging the D1 Mini into a breadboard
Long female headers Stacking shields while also allowing breadboard access from below
💡 Tip: If you plan to use stackable shields (display, relay, motor, etc.), solder the female headers. This lets you plug shields directly on top of the board.

💻 Getting Started

Step 1: Install the CH340G USB Driver

The D1 Mini uses the CH340G USB-to-UART bridge chip. You need to install the driver so your computer can communicate with the board.

Download the driver:

Operating System Instructions
Windows Download and run the CH341SER installer from WCH. Follow the on-screen prompts. Supports Windows 7 through Windows 11.
macOS Download the macOS driver from the WCH website. Open the package and run the installer. You may need to allow it in System Preferences → Security & Privacy.
Linux Most modern Linux distributions (kernel 2.6+) include CH340 drivers by default. No installation needed.

Verify the Driver Is Working

  1. Connect the D1 Mini to your computer via a Micro-USB cable
  2. Open your system's device manager:
    • Windows: Device Manager → Ports (COM & LPT) → Look for "USB-SERIAL CH340 (COMx)"
    • macOS: Terminal → type ls /dev/tty.* → Look for /dev/tty.wchusbserial*
    • Linux: Terminal → type ls /dev/ttyUSB* → Look for /dev/ttyUSB0
⚠️ Important: Make sure you are using a data-capable Micro-USB cable. Some cables are charge-only and will not allow communication with the board. If the board doesn't appear in your device manager, try a different cable.

Step 2: Set Up the Arduino IDE

The Arduino IDE is the easiest way to program the D1 Mini. Follow these steps to add ESP8266 board support.

Install Arduino IDE

If you don't already have it, download the Arduino IDE from:
https://www.arduino.cc/en/software

Add the ESP8266 Board Manager URL

  1. Open the Arduino IDE
  2. Go to File → Preferences (on macOS: Arduino IDE → Settings)
  3. In the "Additional Board Manager URLs" field, paste the following URL:
https://arduino.esp8266.com/stable/package_esp8266com_index.json
  1. Click OK
💡 Tip: If you already have other board URLs in this field, separate them with a comma.

Install the ESP8266 Board Package

  1. Go to Tools → Board → Boards Manager
  2. In the search box, type "ESP8266"
  3. Find "ESP8266 by ESP8266 Community" and click Install
  4. Wait for the installation to complete

Select the Correct Board Settings

  1. Go to Tools → Board and select "LOLIN(WEMOS) D1 R2 & mini"
  2. Configure the following settings under the Tools menu:
Setting Value
Board LOLIN(WEMOS) D1 R2 & mini
Upload Speed 921600
CPU Frequency 80 MHz
Flash Size 4MB (FS:2MB OTA:~1019KB)
Port Select the COM port where your board is connected

Step 3: Upload Your First Sketch (Blink Example)

Let's verify everything is working by blinking the built-in LED.

  1. In the Arduino IDE, go to File → Examples → ESP8266 → Blink, or paste the following code:
/*
 * D1 Mini - Blink Example
 * Blinks the built-in LED on GPIO2 (D4)
 * The built-in LED is active LOW (LOW = ON, HIGH = OFF)
 */

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the built-in LED pin as output
}

void loop() {
  digitalWrite(LED_BUILTIN, LOW);   // Turn LED ON (active LOW)
  delay(1000);                       // Wait 1 second
  digitalWrite(LED_BUILTIN, HIGH);  // Turn LED OFF
  delay(1000);                       // Wait 1 second
}
  1. Click the Upload button (→ arrow icon) in the Arduino IDE
  2. Wait for the upload to complete — you should see "Done uploading" in the status bar
  3. The built-in LED on the board should now blink on and off every second 🎉

Step 4: WiFi Example — Connect to Your Network

Here's a simple sketch that connects the D1 Mini to your WiFi network and prints the assigned IP address:

/*
 * D1 Mini - WiFi Connection Example
 * Connects to your WiFi network and prints the IP address
 */

#include <ESP8266WiFi.h>

const char* ssid     = "YOUR_WIFI_NETWORK_NAME";
const char* password = "YOUR_WIFI_PASSWORD";

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());
}

void loop() {
  // Your code here
}

To use this sketch:

  1. Replace YOUR_WIFI_NETWORK_NAME with your actual WiFi SSID
  2. Replace YOUR_WIFI_PASSWORD with your actual WiFi password
  3. Upload the sketch
  4. Open Tools → Serial Monitor and set the baud rate to 115200
  5. You should see the board connect and display its IP address

🛠️ Troubleshooting

Board Not Detected by Computer

  • Try a different USB cable — Many Micro-USB cables are charge-only and don't carry data
  • Install/reinstall the CH340G driver from WCH or follow the SparkFun guide
  • Try a different USB port — Avoid USB hubs; connect directly to your computer
  • On macOS: Check System Preferences → Security & Privacy — you may need to allow the driver

Upload Fails or Times Out

  • Verify the correct Board is selected: LOLIN(WEMOS) D1 R2 & mini
  • Verify the correct Port is selected under Tools → Port
  • Try lowering the Upload Speed to 115200
  • Press and hold the RESET button on the board, then release it just as the upload begins
  • Close any other programs that might be using the serial port (e.g., Serial Monitor, PuTTY)

Serial Monitor Shows Garbled Text

  • Make sure the baud rate in the Serial Monitor matches the baud rate in your sketch (e.g., Serial.begin(115200) → set monitor to 115200)
  • Press the RESET button on the board to restart the sketch

WiFi Won't Connect

  • Double-check your SSID and password (they are case-sensitive)
  • Make sure your router is broadcasting on 2.4GHz — the ESP8266 does not support 5GHz networks
  • Move the board closer to your router
  • Try restarting your router

Board Keeps Restarting (Boot Loop)

  • This is often caused by insufficient power. Try a different USB cable or power source
  • Check for short circuits on your wiring
  • Make sure pins D3 (GPIO0) and D8 (GPIO15) are not being pulled to unexpected states at boot

🛒 Where to Buy the D1 Mini

Ready to get started with the D1 Mini? You can purchase it directly from our store:

D1 Mini NodeMCU ESP8266 Microcontroller — Envistia Mall


📚 Additional Resources


⚠️ Safety & Handling Precautions

  • Operating voltage is 3.3V — Do not apply 5V to GPIO pins
  • Handle with care — Avoid touching components with bare hands to prevent static discharge
  • Do not short-circuit the pins — always double-check wiring before powering on
  • Keep away from moisture — The board is not waterproof
  • Solder in a well-ventilated area when attaching header pins

📄 Appendix A: How to install the CH340G driver on your computer

The CH340 USB IC is made by WCH. You can find the latest version of their drivers in their English translated website here:

http://www.wch-ic.com/downloads/CH341SER_ZIP.html

Click on 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 the screenshot below:

CH340 Windows Driver Installation Image 1

Click the “Uninstall” button first to remove any old versions, then click on 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 Arduino board with a CH340 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, you will need to 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.

CH340 Windows Driver Installation Image 2

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:

CH340 Windows Driver Installation Image 3

Connect the Arduino 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 in order to connect the IDE to your Arduino board.

In the example shown in these two screen shots, the new Arduino CH340 board is associated to COM Port 3.

CH340 Windows Driver Installation Image 3A
Share this guide:
in

🛒 Related Products

Find the components mentioned in this guide in our store.

Browse Products →