Arduino IDE WeMos D1 Mini Board Support Install & Blink LED Instructions

wemos_d1_mini_board_front_1

wemos_d1_mini_board_back_2

This post describes how to install the board support package for the WeMos D1 Mini board into the Arduino IDE and blink the board’s LED.

Note

A WeMos D1 Mini clone: “IZOKEE D1 Mini NodeMcu Lua 4M Bytes WLAN WIFI Internet Development Board Base on ESP8266 ESP-12F for Arduino, 100% Compatible with WeMos D1 Mini” from [amazon] was used in this example.

Description from Amazon:

  • This D1 mini module is a mini WIFI board based on ESP-8266EX.

  • This WLAN board contains 11 digital input / output pins, all pins have interrupt / pwm / I2C / 1-wire and a micro-USB connection.

  • Our D1 mini development board is 100% compatible with Arduino WeMos and can be programmed in the Arduino IDE. (Verified)

Prerequisites

  • Installed the Arduino IDE on Ubuntu 16.04.3 following [instructions]

  • A USB 2.0 A-Male to Micro B Cable [amazon]

Steps

1. Double click the Arduino IDE icon to run the Arduino IDE

run_arduino_ide_3

2. (A) Click File and (B) click Preferences

click_preferences_4

3. (A) Enter http://arduino.esp8266.com/versions/2.3.0/package_esp8266com_index.json into the Additional Boards Manager URLs: field (comma separate multiple URLs) and (B) click OK

add_url_5

4. (A) Click Tools, (B) Board: …. and (C) Boards Manager…

boards_manager_6

5. (A) Type esp8266 and (B) click Install

install_esp8266_7

You should see:

installing_esp8266_8

6. (A) check that it is INSTALLED and click (B) Close

esp8266_installed_9

7. (A) Click Tools, (B) Board: … and (C) WeMos D1 R2 & mini

wemos_d1_and_mini_10

8. Plug the USB cable in to the WeMos D1 Mini board and the computer

9. Type (replace zpfeffer with your username) sudo usermod -a -G dialout zpfeffer

10. Unplug the USB from the computer, close all programs, log out, log in and start the Arduino IDE again.

11. Plug the USB cable into the computer.

12. (A) Click Tools, (B) Port and (C) /dev/ttyUSB0

tools_port_dev_ttyusb0_11

You should see:

dev_tty_usb0_12

13. Paste the following code (from [link]) into sketch_nov03a:

/* Deep Sleep - Blink
 *
 * Blinks the onboard LED, sleeps for 10 seconds and repeats
 *
 * Connections:
 * D0 -- RST
 *
 * If you cant reprogram as the ESP is sleeping, disconnect D0 - RST and try again
 */

// sleep for this many seconds
const int sleepSeconds = 5;

void setup() {
  Serial.begin(9600);
  Serial.println("\n\nWake up");

  pinMode(BUILTIN_LED, OUTPUT);

  // Connect D0 to RST to wake up
  pinMode(D0, WAKEUP_PULLUP);

  // LED: LOW = on, HIGH = off
  Serial.println("Start blinking");
  for (int i = 0; i < 20; i++)
  {
    digitalWrite(BUILTIN_LED, LOW);
    delay(100);
    digitalWrite(BUILTIN_LED, HIGH);
    delay(100);
  }
  Serial.println("Stop blinking");

  Serial.printf("Sleep for %d seconds\n\n", sleepSeconds);

  // convert to microseconds
  ESP.deepSleep(sleepSeconds * 1000000);
}

void loop() {
}

14. Click Upload

click_upload_13

Click Save

save_14

15. Click Upload

click_upload_15

You should see compiled output:

compiled_output_16

…and:

compiled_17

Here’s a video of the compile:

(Video_unavailable)

Here’s a video of the serial port output:

(Video_unavailable)

And here’s the board blinking:

(Video_unavailable)

References

WEMOS D1 Mini at [link]

WEMOS D1 Mini / Get started in Arduino at [link]

WEMOS’ store at [link]

ESP8266 Community Forum at [link]

Wemos D1 Mini, ESP8266 Getting Started Guide With Arduino at [link]

Arduino at [link]

Arduino IDE at [link]

Arduino core for the ESP32 at [link]

Deep Sleep - Blink at [link]

Other Related References

Things4U - Internet of Things for You at [link]

Charles’s Blog at [link]