Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use NodeMcu: Examples, Pinouts, and Specs

Image of NodeMcu
Cirkit Designer LogoDesign with NodeMcu in Cirkit Designer

Introduction

NodeMCU is an open-source IoT platform developed by WCH.cn, based on the ESP8266 Wi-Fi module (manufacturer part ID: esp). It integrates a built-in microcontroller and supports both Lua scripting and the Arduino IDE, making it a versatile and user-friendly choice for developing connected devices. With its compact design and robust features, NodeMCU is widely used in IoT applications, home automation, and wireless sensor networks.

Explore Projects Built with NodeMcu

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP8266 NodeMCU Controlled Environmental Monitoring System with OLED Display and Relay Switching
Image of soil moisture: A project utilizing NodeMcu in a practical application
This circuit features an ESP8266 NodeMCU microcontroller connected to various peripherals. It includes a DHT11 sensor for temperature and humidity readings, a YL-83 module with YL-69 probe for soil moisture detection, a 0.96" OLED display for data output, a common cathode RGB LED for status indication, a piezo speaker for audio alerts, and a KY-019 relay module for controlling external loads. The NodeMCU facilitates data acquisition from sensors, drives the display and LED, and can trigger the relay and speaker based on sensor inputs or programmed conditions.
Cirkit Designer LogoOpen Project in Cirkit Designer
NodeMCU ESP8266 and Arduino Nano Based Smart Energy Monitoring System with IR Control
Image of SCADA: A project utilizing NodeMcu in a practical application
This circuit features a NodeMCU V3 ESP8266 microcontroller interfaced with a PZEM004T power monitoring module, a DHT11 temperature and humidity sensor, and two 5V relays for controlling external devices. The NodeMCU collects environmental data and power consumption metrics, and can control the relays based on this data or external inputs from an IR sensor. An Arduino Nano is also present, powered by a 5V adapter, and is connected to the NodeMCU and IR sensor, suggesting a secondary control or processing function within the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP8266 NodeMCU Based Health Monitoring System
Image of heart rate: A project utilizing NodeMcu in a practical application
This circuit features an ESP8266 NodeMCU microcontroller connected to a heart pulse sensor and a temperature sensor (LM35). The heart pulse sensor's signal output is connected to the D0 pin of the NodeMCU, while the temperature sensor's voltage output is connected to the A0 pin. Both sensors are powered by the NodeMCU, with the pulse sensor's VCC connected to VIN and the temperature sensor's +Vs connected to 3V3; both sensors share a common ground with the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
NodeMCU ESP8266 with DHT11 and MQ Gas Sensors for Environmental Monitoring
Image of air quality monitoring: A project utilizing NodeMcu in a practical application
This circuit features a NodeMCU V3 ESP8266 microcontroller interfaced with an array of sensors for environmental monitoring. The KY-015 DHT11 sensor is connected for temperature and humidity readings, while the MQ-2 and MQ135 sensors are used for detecting various gases and air quality. The NodeMCU reads analog and digital signals from these sensors to process and potentially transmit environmental data.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with NodeMcu

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of soil moisture: A project utilizing NodeMcu in a practical application
ESP8266 NodeMCU Controlled Environmental Monitoring System with OLED Display and Relay Switching
This circuit features an ESP8266 NodeMCU microcontroller connected to various peripherals. It includes a DHT11 sensor for temperature and humidity readings, a YL-83 module with YL-69 probe for soil moisture detection, a 0.96" OLED display for data output, a common cathode RGB LED for status indication, a piezo speaker for audio alerts, and a KY-019 relay module for controlling external loads. The NodeMCU facilitates data acquisition from sensors, drives the display and LED, and can trigger the relay and speaker based on sensor inputs or programmed conditions.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SCADA: A project utilizing NodeMcu in a practical application
NodeMCU ESP8266 and Arduino Nano Based Smart Energy Monitoring System with IR Control
This circuit features a NodeMCU V3 ESP8266 microcontroller interfaced with a PZEM004T power monitoring module, a DHT11 temperature and humidity sensor, and two 5V relays for controlling external devices. The NodeMCU collects environmental data and power consumption metrics, and can control the relays based on this data or external inputs from an IR sensor. An Arduino Nano is also present, powered by a 5V adapter, and is connected to the NodeMCU and IR sensor, suggesting a secondary control or processing function within the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of heart rate: A project utilizing NodeMcu in a practical application
ESP8266 NodeMCU Based Health Monitoring System
This circuit features an ESP8266 NodeMCU microcontroller connected to a heart pulse sensor and a temperature sensor (LM35). The heart pulse sensor's signal output is connected to the D0 pin of the NodeMCU, while the temperature sensor's voltage output is connected to the A0 pin. Both sensors are powered by the NodeMCU, with the pulse sensor's VCC connected to VIN and the temperature sensor's +Vs connected to 3V3; both sensors share a common ground with the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of air quality monitoring: A project utilizing NodeMcu in a practical application
NodeMCU ESP8266 with DHT11 and MQ Gas Sensors for Environmental Monitoring
This circuit features a NodeMCU V3 ESP8266 microcontroller interfaced with an array of sensors for environmental monitoring. The KY-015 DHT11 sensor is connected for temperature and humidity readings, while the MQ-2 and MQ135 sensors are used for detecting various gases and air quality. The NodeMCU reads analog and digital signals from these sensors to process and potentially transmit environmental data.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Home automation systems
  • IoT-enabled devices
  • Wireless data logging
  • Smart appliances
  • Prototyping and educational projects

Technical Specifications

Key Technical Details

Parameter Specification
Microcontroller ESP8266
Operating Voltage 3.3V
Input Voltage (VIN) 4.5V - 10V
Digital I/O Pins 11
Analog Input Pins 1 (10-bit ADC)
Flash Memory 4MB
Clock Speed 80 MHz (can be overclocked to 160 MHz)
Wi-Fi Standard 802.11 b/g/n
Communication Protocols UART, SPI, I2C
Power Consumption 170 mA (average during Wi-Fi operation)
Dimensions 49mm x 26mm

Pin Configuration and Descriptions

Pin Name Pin Number Description
VIN - Input voltage (4.5V - 10V)
GND - Ground
3V3 - 3.3V output
D0 GPIO16 General-purpose digital I/O
D1 GPIO5 General-purpose digital I/O, supports I2C
D2 GPIO4 General-purpose digital I/O, supports I2C
D3 GPIO0 General-purpose digital I/O, boot mode
D4 GPIO2 General-purpose digital I/O, boot mode
D5 GPIO14 General-purpose digital I/O, supports SPI
D6 GPIO12 General-purpose digital I/O, supports SPI
D7 GPIO13 General-purpose digital I/O, supports SPI
D8 GPIO15 General-purpose digital I/O, boot mode
A0 ADC0 Analog input (0V - 3.3V)
RST - Reset pin

Usage Instructions

How to Use NodeMCU in a Circuit

  1. Powering the NodeMCU:

    • Connect the VIN pin to a 5V power source or use the micro-USB port for power and programming.
    • Ensure the GND pin is connected to the ground of your circuit.
  2. Programming the NodeMCU:

    • Install the Arduino IDE and add the ESP8266 board package via the Board Manager.
    • Select "NodeMCU 1.0 (ESP-12E Module)" from the Tools > Board menu.
    • Connect the NodeMCU to your computer using a USB cable and select the appropriate COM port.
  3. Connecting Peripherals:

    • Use the digital I/O pins (D0-D8) for connecting sensors, actuators, or other devices.
    • Use the A0 pin for analog sensors (ensure the input voltage does not exceed 3.3V).
  4. Uploading Code:

    • Write your code in the Arduino IDE or Lua script.
    • Click the "Upload" button to flash the code onto the NodeMCU.

Example Code for Arduino IDE

The following example demonstrates how to connect the NodeMCU to a Wi-Fi network and blink an LED.

#include <ESP8266WiFi.h> // Include the ESP8266 Wi-Fi library

const char* ssid = "Your_SSID";     // Replace with your Wi-Fi SSID
const char* password = "Your_Password"; // Replace with your Wi-Fi password
const int ledPin = D4;              // Built-in LED pin (GPIO2)

void setup() {
  pinMode(ledPin, OUTPUT);          // Set LED pin as output
  Serial.begin(115200);             // Initialize serial communication
  Serial.println("Connecting to Wi-Fi...");

  WiFi.begin(ssid, password);       // Connect to Wi-Fi
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nWi-Fi connected!");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP());   // Print the IP address
}

void loop() {
  digitalWrite(ledPin, HIGH);       // Turn the LED on
  delay(1000);                      // Wait for 1 second
  digitalWrite(ledPin, LOW);        // Turn the LED off
  delay(1000);                      // Wait for 1 second
}

Important Considerations

  • Voltage Levels: Ensure all connected peripherals operate at 3.3V logic levels to avoid damaging the NodeMCU.
  • Wi-Fi Signal Strength: Place the NodeMCU in an area with a strong Wi-Fi signal for reliable operation.
  • Power Supply: Use a stable power source to prevent unexpected resets or malfunctions.

Troubleshooting and FAQs

Common Issues and Solutions

  1. NodeMCU Not Detected by Computer:

    • Ensure the USB cable is functional and supports data transfer.
    • Install the appropriate USB-to-serial driver (e.g., CH340 driver).
  2. Code Upload Fails:

    • Check the selected COM port in the Arduino IDE.
    • Press and hold the "Flash" button on the NodeMCU while uploading the code.
  3. Wi-Fi Connection Issues:

    • Verify the SSID and password in your code.
    • Ensure the Wi-Fi network operates on the 2.4 GHz band (not 5 GHz).
  4. Overheating:

    • Avoid overloading the GPIO pins with excessive current.
    • Use proper heat dissipation if the NodeMCU operates continuously.

FAQs

Q: Can I power the NodeMCU with a 5V power bank?
A: Yes, you can power the NodeMCU via the micro-USB port or the VIN pin with a 5V source.

Q: What is the maximum current output of the GPIO pins?
A: Each GPIO pin can source or sink up to 12 mA. Avoid exceeding this limit to prevent damage.

Q: Can I use the NodeMCU with a 5V sensor?
A: Use a voltage divider or level shifter to step down the 5V signal to 3.3V before connecting it to the NodeMCU.

Q: How do I reset the NodeMCU?
A: Press the "RST" button on the board to perform a hardware reset.