This document provides an overview of the NodeMCU course and ESP8266 development boards. It discusses the ESP8266 chip, the NodeMCU 1.0 development board, and the ESP8266 12-E NodeMCU kit. The ESP8266 is a low-cost WiFi-enabled microcontroller that is commonly used in IoT projects. It has an integrated TCP/IP stack and supports various protocols. The NodeMCU boards make it easy to program the ESP8266 chip and interface with inputs and outputs. The document describes the components and pinouts of the NodeMCU boards and how to interface with GPIO, I2C, SPI, PWM and analog pins.
2. What we learn in this Lesson
• ESP8266 Board.
• NodeMCU 1.0.
• ESP8266 12-E NodeMCU Kit.
3. ESP8266 Board
Eng.
Elaf
A.Saeed
• ESP8266 is usually mounted on circuit boards that making it easy for you to
program the chip and to interface with input and output devices.
4. NodeMCU 1.0
Eng.
Elaf
A.Saeed
ESP-12E Wi-Fi module
• Tensilica L106 32-bitsmicro controller (MCU).
• CPU clock speed is 80MHZ.
• Integrated 10-bit ADC.
• 4MB external SPI flash to store user programs.
• SDIO 2.0, (H) SPI, UART, I2C, PWM, GPIO.
• Integrated TCP/IP protocol stack.
• Frequency: Wi-Fi 2.4 GHz.
• Support STA/AP/STA+AP operation modes.
• Security: Support WPA/WPA2.
• Encryption: WEP/TKIP/AES.
• Protocols: IP4/TCP/UDP/HTTP/FTP.
• Onboard antenna with a reasonable range (-70~-80dBm at 50 feet)
7. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
• GPIO Maximum Current Imax.
1. 12mA here refers to the source current and sink current is greater than
12mA.
2. 12mA is for per pin and each pin is the same.
3. Drive capacity current of all GPIO pins total can be 16 x 12 mA.
The sink current of GPIO is about 20mA. The maximum source current of
GPIO is about 12mA.
8. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
RST Pin
• Most of the ESP8266 development boards have a built-in LED.
9. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
RST & Flash button
• You need to hold flash and press reset to
get it into upload mode. Some boards like
NodeMCU have a USB to Serial adapter
onboard which does it automatically.
10. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
GPIO
• General-purpose input/output (GPIO) can be either
input pin or output pin, whose behavior can be
controlled at the run time.
• GPIO’s(1,3) are mostly not used for GPIO purpose
because they are reserved for RX and TX in order to
communicate with a host PC through which compiled
object code is downloaded.
• We can use pinMode, digitalRead, digitalWrite,
INPUT, OUTPUT and INPUT_PULLUP for
GPIO’s pins (except GPIO16, it uses
INPUT_PULLDOWN_16)
• (GPIO 6-11) are used to connect the flash memory
chip.
11. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
On-board LED
• Most of the ESP8266 development boards have a built-in LED. This LED is
usually connected to GPIO2.
• The LED works with inverted logic. Send a HIGH signal to turn it off, and a
LOW signal to turn it on.
12. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
GPIO0
• When GPIO0 is pulled LOW, it sets the ESP8266 into bootloader mode. This
is the same as pressing the on-board FLASH/BOOT button.
13. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
GPIO16
• GPIO16 can be used to wake up the ESP8266 from deep sleep. To wake up
the ESP8266 from deep sleep, GPIO16 should be connected to the RST pin.
I2C
• The ESP8266 doesn't have hardware I2C pins, but it can be implemented in
software. So you can use any GPIOs as I2C. Usually, the following GPIOs
are used as I2C pins:
GPIO5: SCL
GPIO4: SDA
14. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
SPI
• The pins used as SPI in the ESP8266 are:
GPIO12: MISO
GPIO13: MOSI
GPIO14: SCLK
GPIO15: CS
PWM Pins
• ESP8266 allows software PWM in all I/O pins: GPIO0 to GPIO16. PWM
signals on ESP8266 have 10-bit resolution.
Interrupt Pins
• The ESP8266 supports interrupts in any GPIO, except GPIO16.
15. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
Analog Input
• The ESP8266 only supports analog reading in one GPIO. That GPIO is
called ADC0 and it is usually marked on the silkscreen as A0.
• The maximum input voltage of the ADC0 pin is 0 to 1V if you’re using the
ESP8266 bare chip. If you’re using a development board like the ESP8266
12-E NodeMCU kit, the voltage input range is 0 to 3.3V because these
boards contain an internal voltage divider.
16. ESP8266 12-E NodeMCU Kit
Eng.
Elaf
A.Saeed
Bootloader Mode
• The bootloader can go into a number of modes depending on the state of
GPIOs 0,2 and 15. The two useful modes are the UART download mode (for
flashing new firmware) and the flash startup mode (which boots from flash).
GPIO 0 GPIO 2 GPIO 15
UART Download Mode
(programming)
0 1 0
Flash Startup (Normal) 1 1 0
SD Card Boot 0 0 1