D1 Board - EN
D1 Board - EN
D1 Board - EN
Thank you for purchasing our AZ-Delivery D1 Board. On the following pages,
we will introduce you to how to use and set-up this handy device.
Have fun!
Table of Contents
Introduction....................................................................................................3
Specifications................................................................................................4
Features........................................................................................................5
D1 NodeMCU Wifi board...............................................................................6
Pinout............................................................................................................7
Input / Ouput pins description........................................................................8
Digital I/O pins...........................................................................................9
Analog input.............................................................................................10
PWM – Pulse-Width Modulation..............................................................11
Serial Communication..............................................................................12
USB to Serial communication..................................................................13
WiFi Communication................................................................................13
Other features..........................................................................................14
How to set-up Arduino IDE..........................................................................15
Additional setup.......................................................................................19
Sketch examples.....................................................................................21
-2-
Introduction
It has a voltage regulator that allows it to feed directly from the USB port.
The input/output pins work at 3.3V. The CH340G chip is responsible for
USB to serial communication.
-3-
Specifications
-4-
Features
• 802.11 b/g/n
• Integrated low power 32bit MCU
• Integrated 10bit ADC
• Integrated TCP/IP protocol stack
• Integrated TR switch, balun, LNA, power amplifier and matching network
• Integrated PLL, regulators, and power management units
• Wi-Fi 2.4GHz, support WPA/WPA2
• Support STA/AP/STA+AP operation modes
• Support Smart Link Function for both Android and iOS devices
• SDIO2.0, (H)SPI, UART, I2C, I2S, IRDA, PWM, GPIO
• STBC, 1x1 MIMO, 2x1 MIMO
• A-MPDU & A-MSDU aggregation and 0.4s guard interval
• Deep sleep power <10µA, Power down leakage current < 5µA
• Wake up and transmit packets in < 2ms
• Standby power consumption of < 1.0mW (DTIM3)
• +20dBm output power in 802.11b mode
• Operating temperature range -40C - 125C
-5-
D1 NodeMCU Wifi board
-6-
Pinout
The D1 Board has 25 functional pins. The pinout is shown on the following
image:
-7-
Input / Ouput pins description
Just like a normal Atmega328p board, the D1 Board has digital input/output
pins (GPIO pins - General Purpose Input/Output pins). These digital
input/outputs operate at 3.3V.
The pins are not 5V tolerant, applying more than 3.3V on any pin will
destroy the chip.
The maximum current that can be drawn from a single GPIO pin is 12mA.
GPIO 1 and 3 are used as TX and RX of the hardware Serial port (UART),
so in most cases, these pins can not be used as normal I/O while
sending/receiving serial data.
-8-
Digital I/O pins
-9-
Analog input
The ESP8266 has a single analog input pin, with an input voltage range
from 0.0V to 1.0V. The D1 Board has an on-board resistive voltage divider,
to get an easier 0-3.3V range. The ADC (analog to digital converter) has a
resolution of 10bits. The ESP can also use the ADC to measure the supply
voltage (VCC). To do this, include:
ADC_MODE(ADC_VCC)
at the top of your sketch, and use:
ESP.getVcc()
to actually get the voltage. If it is used to read the supply voltage, nothing
else can be connected to the analog pin.
- 10 -
PWM – Pulse-Width Modulation
ESP8266 supports software PWM on all digital pins. The default PWM
resolution is 10-bits at 1kHz, but this can be changed. To enable PWM on a
certain pin, use:
analogWrite(pin, value)
where pin is the digital pin,
and value a number between 0 and 1023.
The range (bit depth) of the PWM output can be changed by using
analogWriteRange(range).
- 11 -
Serial Communication
To use UART0 (TX = GPIO1, RX = GPIO3), the Serial object can be used,
just like on an Atmega328p: Serial.begin(baud)
- 12 -
USB to Serial communication
WiFi Communication
- 13 -
Other features
- 14 -
How to set-up Arduino IDE
If the Arduino IDE is not installed, follow the link and download the
installation file for the operating system of choice. The Arduino IDE version
used for this eBook is 1.8.13.
For Windows users, double click on the downloaded .exe file and follow
the instructions in the installation window.
- 15 -
For Linux users, download a file with the extension .tar.xz, which has to
be extracted. When it is extracted, go to the extracted directory and open
the terminal in that directory. Two .sh scripts have to be executed, the first
called arduino-linux-setup.sh and the second called install.sh.
To run the first script in the terminal, open the terminal in the extracted
directory and run the following command:
sh arduino-linux-setup.sh user_name
user_name - is the name of a superuser in the Linux operating system. A
password for the superuser has to be entered when the command is
started. Wait for a few minutes for the script to complete everything.
The second script, called install.sh, has to be used after the installation
of the first script. Run the following command in the terminal (extracted
directory): sh install.sh
After the installation of these scripts, go to the All Apps, where the Arduino
IDE is installed.
- 16 -
Almost all operating systems come with a text editor preinstalled (for
example, Windows comes with Notepad, Linux Ubuntu comes with
Gedit, Linux Raspbian comes with Leafpad, etc.). All of these text
editors are perfectly fine for the purpose of the eBook.
- 17 -
If the Arduino IDE is used on Windows, port names are as follows:
- 18 -
Additional setup
In order to use D1 Board with Arduino IDE, follow few easy steps. Before
setting-up the Arduino IDE, the driver for the USB to Serial communication
has to be installed. If the driver is not installed automatically, there is a
support page that contains the drivers for Windows/Mac or Linux and can
be chosen depending on which one is used. Drivers can be downloaded
from the following link.
Next, to install support for the ESP8266 platform, open Arduino IDE and go
to: File > Preferences, and find Additional URLs field.
- 19 -
Paste this link in the Additional URLs field. If one or more links are inside
this field, just add one comma after the last link, paste new link after comma
and click the OK button.
To upload the sketch code to the D1 Board, first select port on which you
connected the board. Go to: Tools > Port > {port name}
- 20 -
Sketch examples
Blinking LED
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
}
- 21 -
PWM - Pulse Width Modulation
void setup() {
}
void loop() {
// increase the LED brightness
for (int dutyCycle = 0; dutyCycle < 1023; dutyCycle++) {
// changing the LED brightness with PWM
analogWrite(LED_BUILTIN, dutyCycle);
delay(1);
}
- 22 -
Now it is the time to learn and make your own projects. You can do that with
the help of many example scripts and other tutorials, which can be found on
the Internet.
https://az-delivery.de
Have Fun!
Impressum
https://az-delivery.de/pages/about-us
- 23 -