NodeMCU
- Manoj Reddy
- Oct 9, 2022
- 3 min read
What is NodeMCU ? -
The NodeMCU (Node MicroController Unit ) is an open-source software and hardware development environment built around an inexpensive System-on-a-Chip (SoC) called the ESP8266. The ESP8266, designed and manufactured by Espressif Systems, contains the crucial elements of a computer: CPU, RAM, networking (WiFi), and even a modern operating system and SDK. That makes it an excellent choice for Internet of Things (IoT) projects of all kinds.

However, as a chip, the ESP8266 is also hard to access and use. You must solder wires, with the appropriate analog voltage, to its pins for the simplest tasks such as powering it on or sending a keystroke to the “computer” on the chip. You also have to program it in low-level machine instructions that can be interpreted by the chip hardware. This level of integration is not a problem using the ESP8266 as an embedded controller chip in mass-produced electronics. It is a huge burden for hobbyists, hackers, or students who want to experiment with it in their own IoT projects.
NodeMCU ESP8266 Specifications & Features -
Microcontroller: Tensilica 32-bit RISC CPU Xtensa LX106
Operating Voltage: 3.3V
Input Voltage: 7-12V
Digital I/O Pins (DIO): 16
Analog Input Pins (ADC): 1
UARTs: 1
SPIs: 1
I2Cs: 1
Flash Memory: 4 MB
SRAM: 64 KB
Clock Speed: 80 MHz
USB-TTL based on CP2102 is included onboard, Enabling Plug n Play
PCB Antenna
Small Sized module to fit smartly inside your IoT projects
NodeMCU Development Board Pinout Configuration-

Pin Category | Name | Description |
Power | Micro-USB, 3.3V, GND, Vin | Micro-USB: NodeMCU can be powered through the USB port
3.3V: Regulated 3.3V can be supplied to this pin to power the board
GND: Ground pins
Vin: External Power Supply |
Control Pins | EN, RST | The pin and the button resets the microcontroller |
Analog Pin | A0 | Used to measure analog voltage in the range of 0-3.3V |
GPIO Pins | GPIO1 to GPIO16 | NodeMCU has 16 general purpose input-output pins on its board |
SPI Pins | SD1, CMD, SD0, CLK | NodeMCU has four pins available for SPI communication. |
UART Pins | TXD0, RXD0, TXD2, RXD2 | NodeMCU has two UART interfaces, UART0 (RXD0 & TXD0) and UART1 (RXD1 & TXD1). UART1 is used to upload the firmware/program. |
I2C Pins | | NodeMCU has I2C functionality support but due to the internal functionality of these pins, you have to find which pin is I2C. |
Installing ESP8266 Board in Arduino IDE -
ESP8266 community created an add-on for the Arduino IDE. So before starting with ESP8266 first install Arduino IDE.
Installing ESP8266 to Arduino IDE
1) Open Arduino IDE, Open preferences window from Arduino IDE. Go to File -> Preferences.

2)Enter the URL “http://arduino.esp8266.com/stable/package_esp8266com_index.json” into Additional Board Manager URLs field and click the “OK” button
If you already have a URL in there, and want to keep it, you can separate multiple URLs by placing a comma between them.

3) Open Boards Manager. Go to Tools -> Board -> Boards Manager

4) Search ESP8266 board menu and install “esp8266 platform”


5) Choose your ESP8266 board from Tools > Board > Generic ESP8266 Module

6) Selected Board details with Port selection

7) Re-open your Arduino IDE
Bootloader Modes -
The bootloader can go into a number of modes depending on the state of GPIO’s 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 1 GPIO 2 GPIO 15
UART Download Mode (Programming) 0 1 0
Flash Startup (Normal) 1 1 0
SD-Card Boot 0 0 1
For ESP witty you have to hold the Flash button only while programming, No need to reset. Few boards may not require any user actions.
Flashing Steps -
The module can enter a number of bootloader modes depending on GPIO pin states. To flash NodeMCU (or any other firmware) you’ll need to connect the following pins:
GPIO 0: LOW
GPIO 2: HIGH
GPIO 15: LOW
Apply 3.3V and GND and use a 3.3V UART to connect the device to a computer.
Follow the below steps to put device in serial programming mode before clicking on upload icon
To upload program to ESP on some boards you need to hold flash button while uploading and some boards require reset with holding of flash button.
Press and hold RST button.
Press and HOLD FLASH button while RST is in pressed condition.
Release RST while FLASH is in pressed condition or on some boards hold it during program upload.
Release FLASH after releasing RST
Built-in LED blinking of NodeMCU -

Program code -
int pin = 2;
void setup() {
// initialize GPIO 2 as an output.
pinMode(pin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(pin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(pin, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Comments