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, manufactured by AZDelivery with part ID ESP8266, is an open-source IoT platform that integrates a Wi-Fi module and a microcontroller into a single compact board. It is based on the ESP8266 chip and features built-in support for Lua scripting and Arduino programming, making it a versatile choice for developing connected devices and IoT applications.

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!
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
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
NodeMCU ESP8266 Controlled Drone with TFT Display and nRF24L01 Communication
Image of receiver/transmitter: A project utilizing NodeMCU in a practical application
This circuit features a NodeMCU V3 ESP8266 microcontroller interfaced with an LCD TFT screen, an nRF24L01 wireless transceiver, and an Adafruit Analog 2-Axis Joystick. The NodeMCU collects joystick inputs and displays information on the TFT screen, while also communicating with other devices via the nRF24L01 module. The circuit is powered by a 9V battery, with the NodeMCU regulating the voltage for other components.
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 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
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 receiver/transmitter: A project utilizing NodeMCU in a practical application
NodeMCU ESP8266 Controlled Drone with TFT Display and nRF24L01 Communication
This circuit features a NodeMCU V3 ESP8266 microcontroller interfaced with an LCD TFT screen, an nRF24L01 wireless transceiver, and an Adafruit Analog 2-Axis Joystick. The NodeMCU collects joystick inputs and displays information on the TFT screen, while also communicating with other devices via the nRF24L01 module. The circuit is powered by a 9V battery, with the NodeMCU regulating the voltage for other components.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Home automation systems
  • IoT-enabled sensors and actuators
  • Wireless data logging
  • Smart appliances
  • Prototyping connected devices
  • Remote monitoring and control systems

Technical Specifications

Key Technical Details

  • Microcontroller: ESP8266
  • Operating Voltage: 3.3V
  • Input Voltage (via USB): 4.5V–10V
  • Digital I/O Pins: 11 (including PWM, I2C, SPI, and UART)
  • Analog Input Pins: 1 (10-bit ADC, 0–3.3V range)
  • Wi-Fi: 802.11 b/g/n
  • Flash Memory: 4MB
  • Clock Speed: 80MHz (can be overclocked to 160MHz)
  • Power Consumption: ~70mA (idle), ~200mA (transmitting)
  • Dimensions: 49mm x 26mm x 13mm

Pin Configuration and Descriptions

The NodeMCU board features a total of 30 pins. Below is the pinout and description:

Pin Name Type Description
VIN Power Input Input voltage (4.5V–10V) for powering the board via an external power source.
3V3 Power Output Regulated 3.3V output from the onboard voltage regulator.
GND Ground Ground connection.
D0–D8 Digital I/O General-purpose digital pins (can be used for PWM, I2C, SPI, etc.).
A0 Analog Input 10-bit ADC input (0–3.3V range).
RX UART Input UART receive pin for serial communication.
TX UART Output UART transmit pin for serial communication.
EN Enable Active-high enable pin for the ESP8266 module.
RST Reset Active-low reset pin to restart the board.
SD3, SD2, SD1, CMD, CLK Flash Memory Pins Used internally for SPI flash memory communication. Not typically user-accessible.

Usage Instructions

How to Use the NodeMCU in a Circuit

  1. Powering the Board:

    • Connect the NodeMCU to a computer or USB power source using a micro-USB cable.
    • Alternatively, supply 4.5V–10V to the VIN pin for external power.
  2. Programming the Board:

    • Install the Arduino IDE and add the ESP8266 board package via the Boards Manager.
    • Select "NodeMCU 1.0 (ESP-12E Module)" as the board type.
    • Write your code in the Arduino IDE or Lua scripting environment.
  3. Connecting Peripherals:

    • Use the digital 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).
    • For I2C communication, use D1 (SCL) and D2 (SDA).
    • For SPI communication, use D5 (SCK), D6 (MISO), D7 (MOSI), and D8 (CS).

Example: Blinking an LED

Here is an example of how to blink an LED connected to pin D1:

// Define the LED pin
const int ledPin = D1;

void setup() {
  // Set the LED pin as an output
  pinMode(ledPin, OUTPUT);
}

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

  // Turn the LED off
  digitalWrite(ledPin, LOW);
  delay(1000); // Wait for 1 second
}

Important Considerations and Best Practices

  • Voltage Levels: Ensure all connected peripherals operate at 3.3V logic levels. Use level shifters if interfacing with 5V devices.
  • Power Supply: Use a stable power source to avoid unexpected resets or instability.
  • Wi-Fi Configuration: Configure the Wi-Fi credentials in your code for seamless connectivity.
  • GPIO Limitations: Avoid using GPIO pins D3 and D4 for external pull-up or pull-down resistors, as they are connected to the onboard flash memory.

Troubleshooting and FAQs

Common Issues and Solutions

  1. The board is not detected by the computer:

    • Ensure the correct USB driver for the CP2102 or CH340 chip (depending on your NodeMCU version) is installed.
    • Try a different USB cable or port.
  2. Upload errors in the Arduino IDE:

    • Check that the correct board and COM port are selected 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 router is within range and supports 2.4GHz Wi-Fi (ESP8266 does not support 5GHz).
  4. The board resets unexpectedly:

    • Check the power supply for stability.
    • Avoid drawing excessive current from the 3V3 pin.

FAQs

Q: Can I use the NodeMCU with 5V sensors?
A: The NodeMCU operates at 3.3V logic levels. Use a level shifter to safely interface with 5V sensors.

Q: How do I restore the factory firmware?
A: Use the ESP8266 Flasher tool to reflash the original firmware. Ensure you download the correct firmware version for your board.

Q: Can I use the NodeMCU for battery-powered projects?
A: Yes, but ensure the battery provides a stable voltage within the acceptable range (4.5V–10V). Consider using a low-power mode to conserve energy.

Q: What is the maximum Wi-Fi range of the NodeMCU?
A: The range depends on environmental factors but typically extends up to 50 meters indoors and 100 meters outdoors.

By following this documentation, you can effectively utilize the NodeMCU for a wide range of IoT and embedded applications.