The NodeMCU (IoT) Guide


The NodeMCU development board is a powerful solution to program microcontrollers and be part of the Internet of Things (IoT). The NodeMCU development board, based on ESP8266EX, is a cute module with a microcontroller, integrated Wi-Fi receiver, and transmitter. NodeMCU supports several programing languages; hence, it is very easy to upload programs from any computer over a micro-USB port. I have been playing with the NodeMCU for quite a while now and, I have to say, it is a lot more fun than the other available IoT modules. When it comes to prototyping — just another perfect, relatively cheap, easy-to-learn, and user-friendly minuscule magic module!

NodeMCU V1.0

The first generation of the NodeMCU Development Kit had the version number V0.9. The second generation had the version number V1.0, and this newer version used ESP-12E (not ESP-12), which comes with 4 MB of flash memory. The new version comes with the CP2102 serial chip (not CH340) and it works really well and without a hassle. However, I noticed that, when it comes to many Chinese online vendors, there’s a blurring mix-up of generation and version names. The common name used by them for version 1.0 is V2, and most of those V2 boards are fabricated by or at least marked with “Amica.” Technically, it’s “NodeMCU V1.0 with ESP-12E module!”



NodeMCU First Run

NodeMCU is a complete environment of hardware and software for IoT prototyping based on the Lua language. You can connect NodeMCU to your computer through a standard USB interface for power, programming, and debugging. Before using NodeMCU V1.0 for the first time, install the requisite USB driver (CP210x) on the operating system of your computer:
Download it from:

Now you can test your NodeMCU in Lua shell. As this calls for an appropriate terminal software, download PuTTY onto your computer:


Next, connect NodeMCU, run PuTTY to enter its Lua shell, and enter the test code to test the onboard LED in NodeMCU (also see following images). If everything is okay, you should able to connect NodeMCU with PuTTY, enter Lua shell, and test the on/off functions of the onboard blue indicator. If NodeMCU has no response in the PuTTY terminal, try to press the RST button on NodeMCU.

> gpio.mode(0, gpio.OUTPUT)
> gpio.write(0, gpio.HIGH)
> print(
> gpio.write(0, gpio.LOW)
> print(



This simple tutorial will show you how to use NodeMCU V1.0 for the first time. The steps are pretty simple to follow and should get your NodeMCU board running in less than 15 minutes. In upcoming articles, I will adapt new design ideas to implant NodeMCU at the heart of fascinating IoT systems. See you all in succeeding projects.

NodeMCU Links

Wikipedia Article on NodeMCU:
Offical NodeMCU Website:
Github Repository for NodeMCU Firmware:
Github Repository for NodeMCU Hardware:

NodeMCU & Arduino IDE

Did you know? It’s very easy to use the Arduino IDE to program your NodeMCU, a great starting point for Arduino lovers to familiarize themselves with the technologies surrounding the IoT. Note that when you use the NodeMCU board with the Arduino IDE, the Lua firmware will be deleted and replaced by the sketch uploaded by you. If you want to use the Lua SDK again, it will become necessary to “flash” the firmware again.

The NodeMCU programming can be as easy as in Arduino. The major difference is in the pin assignment of the NodeMCU board. Ready? Then follow these steps:

  • Run the Arduno IDE
  • Open the “Preferences” window and type the indicated address in the “Additional Board Manager URLs:”
  • In the “Tools” menu, configure your board “NodeMCU 1.0 (ESP-12E Module)”
  • Now just proceed as the Arduino: Start your sketching!


Shown next is an example code to realize a “breathing LED” on NodeMCU, taken from

#define LED D0 // Blue LED in NodeMCU at pin GPIO16 (D0).
#define BRIGHT 350 //max LED intensity (1‐500)
#define INHALE 1250 //Inhalation time in milliseconds.
#define REST 1000 //Rest Between Inhalations.
void setup() {
   pinMode(LED, OUTPUT); // LED pin as output.
void loop() {
   //ramp increasing intensity, Inhalation:
   for (int i=1;i<BRIGHT;i++){
      digitalWrite(LED, LOW); // turn the LED on.
      delayMicroseconds(i*10); // wait
      digitalWrite(LED, HIGH); // turn the LED off.
      delayMicroseconds(PULSE‐i*10); // wait
      delay(0); //to prevent watchdog firing.
   //ramp decreasing intensity, Exhalation (half time):
   for (int i=BRIGHT‐1;i>0;i‐‐){
      digitalWrite(LED, LOW); // turn the LED on.
      delayMicroseconds(i*10); // wait
      digitalWrite(LED, HIGH); // turn the LED off.
      delayMicroseconds(PULSE‐i*10); // wait
      delay(0); //to prevent watchdog firing.
   delay(REST); //take a rest...

No Comments

Join the conversation!

Error! Please fill all fields.
Looking for the latest from TI?