D1 mini instead of Arduino

  • Dec 27, 2021

To develop devices without Wi-Fi, they usually use Arduino Uno and Arduino Nano boards (more precisely, mainly their Chinese clones), but due to the crisis electronics, they have risen in price significantly, but D1 mini boards with Wi-Fi still cost 150 rubles and in most cases they can be used instead of Arduino.

D1 mini instead of Arduino

The D1 mini board is based on the ESP8266 chip. It connects to a computer or a power source via the MicroUSB connector, it has 5 and 3.3 V power pins, 11 digital I / O and 1 analog input. For most projects, this is sufficient.

To use the D1 mini in the Arduino environment, you need to go to the "settings file" and in the "Additional links for the Board Manager" field insert the address http://arduino.esp8266.com/stable/package_esp8266com_index.json .
After that, at the end of the list of boards, several new models will appear, from which you need to select "LOLIN (WEMOS) D1 R2 & mini".

Most projects and libraries work on the D1 mini in the same way as on regular Arduino boards.

The pin names written on the D1 mini board are different from the Arduino. Devices with an I2C interface are connected to pins D1 (SCL) and D2 (SDA). Devices with SPI interface to pins D5 (SCK), D6 (MISO or SDO), D7 (MOSI or SDA), D8 (SS or CS).

instagram viewer

There is a blue LED on the board, which can be controlled by a separate pin "LED_BUILTIN" (0 - on).
This sketch from AlexGyver is flashing with a built-in LED:


void setup () {
pinMode (LED_BUILTIN, OUTPUT);

void loop () {
digitalWrite (LED_BUILTIN, 0);
delay (1000);
digitalWrite (LED_BUILTIN, 1);
delay (300);
}

As it turned out, by default, the Wi-Fi module in the D1 mini is turned on and consumes power. The board with the simplest sketch, which outputs one character to the serial port once per second, consumes about 80 mA.

To disable Wi-Fi, you need to add the ESP8266WiFi library connection line at the beginning, and in the "void setup ()" section, two lines that disable Wi-Fi:


#include

void setup () {
WiFi.mode (WIFI_OFF);
WiFi.forceSleepBegin ();
}

After that, the consumption of the board with the same sketch is reduced by almost three times to 28 mA.

It was found that different Chinese clones of D1 mini have different consumption. So, the Doiting board consumed 80/28 mA, and the board of an unknown manufacturer with the inscription "ESP8266MOD" on the cover was 72/19 mA.

Such a low consumption board I ordered here (penultimate option - D1 mini).

Payments are still on the way from here (the first option is D1 mini).

For comparison, in the same stores nano now costs ~ 300 rubles + 50 rubles delivery, here it is in TENSTAR ROBOT GREAT WALL and at SAMIORE FEIYANG.
Uno costs 340 rubles + 150 rubles delivery
in the first store and 360 + 150 rubles delivery in the second.

P.S. Thanks to Stanislav Gritsinov for his help with disabling Wi-Fi.

© 2021, Alexey Nadezhin

For ten years I have been writing every day about technology, discounts, places of interest and events. Read my blog on the site ammo1.ru, v LJ, Zen, Mirtesen, Telegram.
My projects:
Lamptest.ru. I test LED lamps and help figure out which ones are good and which are not so good.
Elerus.ru. I collect information about domestic electronic devices for personal use and share it.
You can contact me in Telegram
@ ammo1 and by mail [email protected].