Wemos D1 mini: ESP8266 multi-purpose IoT development board less than $5

The Wemos D1 Mini is a board based on the ESP8266 ESP-12E module developed by the Wemos CC company. You can buy it between $3.50 and $5. As with all Arduino cards, you will also find many clones that works perfectly.

New Wemos to discover: D1 Mini Pro, Wemos XI, Shield SHT30

This small card is really very convenient to program and use. The programming can be done directly from the IDE Arduino or in Lua (using ESPlorer already presented in this article) by connecting it to the computer using a USB cable. On Mac OS X, it is recognized immediately on the port /dev/cu.wchusbserialfaxxxx . If you encounter any problems, you can manually install the CH340 drivers. You can retrieve it here. For Windows, you will also find the CH340 drivers here if needed.

Wemos D1 mini shields

Wemos (and other manufacturers) also developed learning / prototyping shields that connect to the board (the solder terminals are delivered with the card. You can choose the one you need at the time of the welding).

Check shipping cost before buying PIN
esp8266 Wemos D1 mini ESP8266 Wemos D1 Mini board

From $3.50 to $5

chargeur raspbery pi 3 5v 3000ma 5V/3A micro-usb power supply

The ESP8266 is sensitive to the quality of the power supply (risk of crash). A good quality power supply is recommended.

wemos d1 mini shield batterie lipo LiPo battery charger with micro USB connector.

About $2.20

wemos d1 mini relai shield Relai (1 output)

About $1.20

D1
wemos d1 mini one button shield 1-Button

About $0.60

wemos d1 mini dht11 shield DHT11 (not official shield): temperature / humidity sensor (read this tutorial)

About $2.70

Adafruit library : https://github.com/adafruit/DHT-sensor-library

D4
wemos d1 mini dht22 shield DHT22 (not official shield): temperature / humidity sensor. Tutorial : presentation of the shield, how to use with ESP Easy and Arduino code

About $2.80

Adafruit library : https://github.com/adafruit/DHT-sensor-library.

D4
SHT30: temperature and humidity sensor on I2C bus

About $2.3

Librairy and example on GitHub

D1 – SCL

D2 – SDA

wemos d1 mini oled shield I2C SSD1306 monochrome OLED Display. How to use SSD1306 OLED display

About $4

D1 – SCL

D2 – SDA

wemos d1 mini microsd shield Micro SD card reader (ideal for making a mini data logger)

About $1

wemos d1 mini proto shield Breadboard

About $0.90

wemos d1 mini dual base Double base. Lets you install a Wemos on a slot (and overlay a shields). A 2nd location allows to install a 2nd shields.

About $1

wemos d1 mini motor shield i2c I2C Driver to drive 2 motors (15 VDC max.)

About $2.50 (without shipping cost)

D1 – SCL

D2 – SDA

DC Power 7-24VDC (1A max)

About $1,4

wemos shield rbg led ws2812b adafruit neopixel library D2

All specials for Wemos official shields

Characteristics of the board

all technical documentation

  • 11 digital I/O
  • Interruption/PWM/I2C/one-wire: available on all pins except the D0
  • 1 analog input, limited to a voltage of 3.2V Max
  • 4 Mbytes memory Flash
  • CPU frequency : 80 MHz / 160 MHz
  • Dimensions: 34.2 mm x 25.6 mm
  • Weight: 10 g

Pins

Pin (on the board) Function ESP8266 correspondence
TX TXD TXD
RX RXD RXD
A0 Analog input, max 3.3V input A0
D0 IO GPIO16
D1 IO, SCL GPIO5
D2 IO, SDA GPIO4
D3 IO, 10k Pull-up GPIO0
D4 IO, 10k Pull-up, BUILTIN_LED GPIO2
D5 IO, SCK GPIO14
D6 IO, MISO GPIO12
D7 IO, MOSI GPIO13
D8 IO, 10k Pull-down, SS GPIO15
G GND GND
5V 5V
3V3 3.3V 3.3V
RST Reset RST

 

Correspondance Pins GPIO WeMos D1 mini

Wemos D1 Mini pinout (source : wemos.cc)

Attention, like all ESP8266 modules, do not exceed a voltage of 3.3V on the IO.

All pins support interrupts, PWM, I2C communication and One-Wire except pin D0.

Warning. Do not exceed 3.3 Volts to power the card on pin 3V is worth destroying the card

Use the Wemos D1 mini with the Arduino IDE

The Wemos D1 Mini is used like all ESP8266 cards. First, configure the Arduino IDE. Open Preferences and add the repository to the esp8266 library.

http://arduino.esp8266.com/stable/package_esp8266com_index.json

IDE Arduino 1.6.8 esp8266 package

Go to the map manager and look for esp8266, then click install.

IDE Arduino 1.6.x ajouter carte esp8266

In the list of cards, choose WeMos D1 R2 & Mini from the ESP8266 Modules list.

For my part I had to opt for an upload speed of 115200 baud. If you encounter problems, here are some ways:

  • Make a Reset,
  • Unplug and then reconnect the card,
  • Remove the card from the mounting (especially when first used).

This map comes with a series of examples that you can download on github here. Place the directory in your Arduino folder and restart the IDE to refresh the list of examples. A section is dedicated to shields:

  • 1 Button: Connected button
  • DHT pro: for the DHT22
  • DHT: for the DHT11
  • Micro SD: SD card reader
  • Relay: relay control 10A – 230V (alternating current) or 10A – 30V (direct current)
  • WS2812B: driver for RGB LED headband

wemos d1 mini exemples github

With regard to pin marking in the Arduino code, the reference of the pin indicated on the card can be used directly in the Arduino program (eg D2 instead of 4). If you want your program to work on either an Arduino or an ESP, it is best to continue using the Arduino references.

How to use interrupts

Compared to an Arduino Uno that has only 2 interrupts, an interrupt can be connected to all Wemos D1 Mini pins, except for pin D0 which is reserved for sleep mode.

Using the Arduino IDE, use the attachInterrupt and detachInterrupt functions as usual.

To attach an interrupt: attachInterrupt (interrupt, function, mode)

  • Interrupt: Indicate the pin on which the interrupt is connected, for example 4 for pin D4 of the Wemos.
  • Function: The function called when the interrupt is triggered
  • Modes :
    • LOW: Interrupt is triggered when the spindle is at the LOW level
    • CHANGE: Interrupt triggers when the spindle changes state LOW / HIGH
    • RISING: Interrupt is triggered when the spindle changes from LOW to UP (rising edge)
    • FALLING: the interrupt is triggered when the spindle changes from the UP state to the LOW state (falling edge)

Detach an interrupt: detachInterrupt (pin or interrupt number).

Programming the Wemos D1 Mini in Lua

For those who prefer the Lua and NodeMCU, you can program the Wemos in this language. I advise you to use ESPlorer, a program written in Java that I have already presented to you in this article. To reinstall the original firmware, follow this article.

Develop without programming with ESP Easy

Finally, the Wemos lends itself very well to the use of the firmware ESP Easy. ESP Easy makes it possible to make measurements, to order actuators, to communicate with a home automation server or an online service very simply. To learn more about ESP Easy, follow this comprehensive guide.

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

We will be happy to hear your thoughts

Leave a Reply

DIY Projects
%d bloggers like this: