Getting Started with the LOLIN D1 Mini Board

Getting Started with the LOLIN D1 Mini

Short on time? Plug in your LOLIN D1 mini, select the board in Arduino IDE, paste the Blink sketch below, and upload. Boom—first win!

LOLIN (WEMOS) D1 mini — tiny, Wi-Fi ready, and beginner-friendly.

What is LOLIN (formerly WEMOS)?

LOLIN boards are compact, affordable development boards built around Espressif’s Wi-Fi-enabled chips. Popular picks include the LOLIN D1 mini, LOLIN D1 R2, and LOLIN32 (ESP32-based). They’re perfect for IoT projects, home automation, web-controlled gadgets, and quick sensor prototypes.

Step-by-Step: Arduino IDE Setup

  1. Open File → Preferences and paste this into Additional Boards Manager URLs:
    https://arduino.esp8266.com/stable/package_esp8266com_index.json
  2. Go to Tools → Board → Boards Manager…, search for ESP8266, and click Install.
  3. Select your board: Tools → Board → LOLIN (WEMOS) D1 R2 & mini.
  4. Connect the board via USB. If it doesn’t show up, install the CH340 (or CP2102) USB driver for your OS.
  5. Select the correct Port under Tools → Port.

Pro tip: If uploads fail, try another USB cable (must be data-capable), switch ports, or lower upload speed under Tools.

Your First Sketch: Blink (Built-in LED)

Paste this into a new sketch and upload. On many D1 minis the built-in LED is on pin LED_BUILTIN (mapped internally):

// LOLIN D1 mini Blink
void setup() {
  pinMode(LED_BUILTIN, OUTPUT); // Built-in LED pin
}
void loop() {
  digitalWrite(LED_BUILTIN, LOW);  // LED ON (active low on ESP8266)
  delay(500);
  digitalWrite(LED_BUILTIN, HIGH); // LED OFF
  delay(500);
}

On ESP8266, the LED is usually active-low (LOW = on). That’s not a bug—just a quirk of the board design.

Wi-Fi Quickstart: Test Connection

Confirm the Wi-Fi radio is happy by connecting to your network and printing the IP address:

#include <ESP8266WiFi.h>

const char* ssid     = "YourSSID";
const char* password = "YourPassword";

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.print("Connected! IP: ");
  Serial.println(WiFi.localIP());
}

void loop() {
  // Your IoT magic goes here
}

LOLIN D1 mini Pinout (ESP8266)

Handy mapping when translating between “Dx” silk labels and actual GPIO numbers:

Label GPIO Typical Use
D0 GPIO16 Deep sleep wake, no PWM
D1 (SCL) GPIO5 I2C SCL
D2 (SDA) GPIO4 I2C SDA
D3 GPIO0 Boot mode pin (use carefully)
D4 (LED) GPIO2 Built-in LED (active-low)
D5 (SCK) GPIO14 SPI SCK / PWM
D6 (MISO) GPIO12 SPI MISO / PWM
D7 (MOSI) GPIO13 SPI MOSI / PWM
D8 (SS) GPIO15 SPI SS (boot strap, use with care)
RX GPIO3 UART RX (avoid during programming)
TX GPIO1 UART TX (avoid during programming)
A0 ADC0 Analog in (0–1.0V max)
5V / 3V3 / G / RST Power, Ground, Reset

Voltage gotcha: A0 reads up to ~1.0V. Use a divider for sensors that output higher voltages.

What Can You Build?

  • Wi-Fi temperature & humidity sensors (MQTT or web dashboard)
  • Smart lights and LED effects (WS2812/Neopixel)
  • Home automation triggers (relays, contact sensors)
  • Remote data loggers (to cloud or local server)
From quick LED demos to full IoT dashboards—LOLIN makes it easy.

Troubleshooting: Windows Not Recognizing the Board

  • Install driver: Most D1 minis use the CH340 USB-serial driver (some use CP2102).
  • Try a different cable: Many “charge-only” cables lack data lines.
  • Check Device Manager: Look under Ports (COM & LPT) for a new COM port.
  • Re-select the port in Arduino IDE: Tools → Port.
  • Boot mode pins: Avoid pulling GPIO0, GPIO2, or GPIO15 to the wrong levels at boot.

Next Steps

  1. Add a sensor shield and read temperature via I2C on D1/D2.
  2. Serve a tiny web page from the board to view sensor data.
  3. Publish readings to MQTT and build a dashboard.

Focus keyphrase: LOLIN D1 mini tutorial


Breadcrumb label: LOLIN D1 Mini Setup Guide

© Your Site Name • Update this page as you add examples and photos