Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

Wemos D1 Mini

Image of Wemos D1 Mini

Wemos D1 Mini Documentation

Introduction

The Wemos D1 Mini is a versatile and compact development board that harnesses the power of the ESP8266 microcontroller. This board is widely used in the realm of Internet of Things (IoT) projects due to its small form factor, integrated Wi-Fi capabilities, and compatibility with the Arduino development environment. It is ideal for applications such as home automation, sensor networks, and DIY electronics projects.

Technical Specifications

Key Features

  • Microcontroller: ESP8266
  • Operating Voltage: 3.3V
  • Digital I/O Pins: 11
  • Analog Input Pins: 1 (Max input: 3.2V)
  • Clock Speed: 80/160MHz
  • Flash Memory: 4MB
  • Integrated Wi-Fi: 802.11 b/g/n
  • USB-to-Serial Converter: CH340G

Pin Configuration

Pin Function Description
D0 GPIO16 General-purpose I/O, can be used for deep sleep wake-up
D1 GPIO5 General-purpose I/O, often used for I2C SCL
D2 GPIO4 General-purpose I/O, often used for I2C SDA
D3 GPIO0 General-purpose I/O, pulled up, connected to FLASH button
D4 GPIO2 General-purpose I/O, pulled up, built-in LED
D5 GPIO14 General-purpose I/O, SPI SCK
D6 GPIO12 General-purpose I/O, SPI MISO
D7 GPIO13 General-purpose I/O, SPI MOSI
D8 GPIO15 General-purpose I/O, SPI SS, pulled to GND
RX GPIO3 RX pin, used for serial communication
TX GPIO1 TX pin, used for serial communication
A0 ADC0 Analog input, max 3.2V input
RST RESET Reset pin, pull low to reset the device
3V3 3.3V power supply
5V 5V power supply (USB or external)
GND Ground

Usage Instructions

Setting Up the Wemos D1 Mini

  1. Install the USB Driver: Download and install the CH340G driver to enable USB-to-serial communication.
  2. Arduino IDE Configuration: In the Arduino IDE, go to File > Preferences and add the following URL to the "Additional Boards Manager URLs": http://arduino.esp8266.com/stable/package_esp8266com_index.json
  3. Install the ESP8266 Board Package: Go to Tools > Board > Boards Manager, search for "ESP8266", and install the package.
  4. Select the Board: Choose "LOLIN(WEMOS) D1 R2 & mini" from Tools > Board menu.
  5. Select the Port: Select the COM port that the Wemos D1 Mini is connected to from Tools > Port.

Basic Blink Example

// Define the LED_BUILTIN pin as the built-in LED pin
#define LED_BUILTIN D4

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

void loop() {
  digitalWrite(LED_BUILTIN, LOW); // Turn the LED on
  delay(1000);                    // Wait for a second
  digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off
  delay(1000);                     // Wait for a second
}

Important Considerations and Best Practices

  • Power Supply: Ensure that the power supply is stable and within the recommended voltage range.
  • I/O Pins: Do not exceed the maximum current rating for the I/O pins (12mA per pin).
  • Analog Input: The maximum voltage for the A0 pin is 3.2V. Exceeding this voltage can damage the board.
  • Firmware Flashing: When flashing new firmware, ensure that the correct settings are used to prevent bricking the device.

Troubleshooting and FAQs

Common Issues

  • Board Not Recognized: Ensure that the CH340G USB driver is installed and the USB cable is functioning.
  • Cannot Upload Sketch: Check the board and port settings in the Arduino IDE. Make sure the correct board is selected and the COM port is the one assigned to the Wemos D1 Mini.
  • Wi-Fi Connection Issues: Verify the Wi-Fi credentials and signal strength. Ensure the board is within range of the Wi-Fi router.

FAQs

Q: Can I power the Wemos D1 Mini with 5V? A: Yes, you can power the board through the 5V pin or the USB port.

Q: How do I put the Wemos D1 Mini into deep sleep mode? A: You can use the ESP.deepSleep(microseconds) function in your code. Connect D0 to RST to wake up the board.

Q: What is the maximum current the Wemos D1 Mini can supply to external components? A: The board can supply a maximum of 500mA through the 3.3V pin when powered via USB.

For further assistance, consult the Wemos D1 Mini community forums or the extensive online resources available for troubleshooting and project ideas.

Example Projects

GarageDoor
Image of GarageDoor: A project utilizing Wemos D1 Mini in a practical application
This circuit is designed to interface a Wemos D1 Mini microcontroller with a two-channel relay, an IR sensor, pushbuttons, and an LED with a current-limiting resistor. The Wemos D1 Mini controls the relay channels via its D1 and D2 pins, receives input from the IR sensor on pin D7, and uses pins D5 and D6 to interact with the pushbuttons through diodes for input debouncing or protection. The LED indicates status or provides feedback, and the 5V power from the Wemos D1 Mini is distributed to the relay, IR sensor, and LED through diodes for polarity protection.
d1 mini project
Image of d1 mini project: A project utilizing Wemos D1 Mini in a practical application
This circuit features a Wemos D1 Mini microcontroller connected to a DHT11 humidity and temperature sensor, a 0.96" OLED display, and an HW-040 rotary encoder. The DHT11 sensor provides environmental data to the microcontroller, which displays this information on the OLED screen. The rotary encoder allows for user interaction, enabling navigation through a menu system to display different options or sensor readings.
DS18B20 and OLED I2C
Image of DS18B20 and OLED I2C: A project utilizing Wemos D1 Mini in a practical application
This circuit is designed to measure temperature using a DS18B20 1-Wire Temperature Sensor and display the readings on a 0.96" OLED screen. The Wemos D1 Mini serves as the microcontroller, interfacing with the temperature sensor via a digital input with a pull-up resistor and communicating with the OLED display over an I2C connection. The circuit is likely used for a compact temperature monitoring system.
sister
Image of sister: A project utilizing Wemos D1 Mini in a practical application
This circuit consists of a Wemos D1 Mini microcontroller connected to four SG90 servomotors. Each servomotor is controlled by a separate digital output pin (D5, D6, D7, D8) from the Wemos D1 Mini. The servomotors share a common power supply from the 5V pin and a common ground with the microcontroller.

Example Projects

Image of GarageDoor: A project utilizing Wemos D1 Mini in a practical application
GarageDoor
This circuit is designed to interface a Wemos D1 Mini microcontroller with a two-channel relay, an IR sensor, pushbuttons, and an LED with a current-limiting resistor. The Wemos D1 Mini controls the relay channels via its D1 and D2 pins, receives input from the IR sensor on pin D7, and uses pins D5 and D6 to interact with the pushbuttons through diodes for input debouncing or protection. The LED indicates status or provides feedback, and the 5V power from the Wemos D1 Mini is distributed to the relay, IR sensor, and LED through diodes for polarity protection.
Image of d1 mini project: A project utilizing Wemos D1 Mini in a practical application
d1 mini project
This circuit features a Wemos D1 Mini microcontroller connected to a DHT11 humidity and temperature sensor, a 0.96" OLED display, and an HW-040 rotary encoder. The DHT11 sensor provides environmental data to the microcontroller, which displays this information on the OLED screen. The rotary encoder allows for user interaction, enabling navigation through a menu system to display different options or sensor readings.
Image of DS18B20 and OLED I2C: A project utilizing Wemos D1 Mini in a practical application
DS18B20 and OLED I2C
This circuit is designed to measure temperature using a DS18B20 1-Wire Temperature Sensor and display the readings on a 0.96" OLED screen. The Wemos D1 Mini serves as the microcontroller, interfacing with the temperature sensor via a digital input with a pull-up resistor and communicating with the OLED display over an I2C connection. The circuit is likely used for a compact temperature monitoring system.
Image of sister: A project utilizing Wemos D1 Mini in a practical application
sister
This circuit consists of a Wemos D1 Mini microcontroller connected to four SG90 servomotors. Each servomotor is controlled by a separate digital output pin (D5, D6, D7, D8) from the Wemos D1 Mini. The servomotors share a common power supply from the 5V pin and a common ground with the microcontroller.