As we know, NodeMCU is an open-source IoT platform for to Lua based firmware developed for ESP8266 and ESP8266 is WiFi SoC (System on Chip) developed by Espressif Systems. Usually NodeMCU comes with inbuilt Lua interpreter, but preferred way is to program NodeMCU ESP8266 with Arduino IDE. NodeMCU is one of the most widely used development.

What is NodeMCU?

As discussed earlier, NodeMCU is an open source IoT platform. There are different boards available with NodeMCU firmware such as Lolin, Wemos etc. NodeMCU has on chip SoC WiFi available with 12 GPIO and 11 usable GPIOs. NodeMCU comes with inbuilt Lua interpreter. We can also program NodeMCU with Arduino IDE.

Program NodeMCU
NodeMCU Board

NodeMCU is around $3.5 board which can be used in IoT applications or as an development platform. It has one microUSB port which we can connect to the Laptop or PC for programming. It can be also progrramed by serialy, but in this tutorial, we are going to program it from microUSB serial port. Before Programming NodeMCU with Arduino IDE, we need to install NodeMCU board in Arduino IDE. So, let’s see the Steps to install NodeMCU board in Arduino IDE.

Steps to Program NodeMCU

Step 1: Download and install latest Arduino IDE

The fisrt and foremost thing we will require to program this microcontroller is Arduino IDE. So, first we will install Arduino IDE. Depending on the OS you are using, install respected version of Arduino IDE. You can download Arduino IDE from HERE.

Step 2: Add ESP8266 board preferences

After installing Arduino IDE, we have to install NodeMCU board in Arduino IDE. For this step, we have to add board prefernce for NodeMCU board.
Go to File > Preferences
The preference window will open. In Additional Boards Manager, paste the link below:

Step 3: Install ESP8266 Board in Arduino IDE

First, open Boards Manager in Android IDE.
Click on Tools > Board > Boards Manager.
Now, after this, Arduino Boards Manager will open.
In search box of Arduino Boards Manager, searach esp8266.
As shown in above image, you will find the board with name “esp8266 by ESP8266 Community”. Below of this, choose version and hit install.

Step 4: Install USB serial drivers

As we will program NodeMCU esp8266 from Laptop/PC, there should be USB to Serial converter. There is onchip USB to Serial IC on NodeMCU. For your NodeMCU, the USB to Serial IC may be SCILAB CP2102 or CH340G. Mostly, if you are using NodeMCU version 0.9, then it will have SCILAB CP2102. For NodeMCU version 1.0, it is CH340G. You can download required driver from the link given below:
Click Here to DOWNLOAD CH340G driver setup
Click Here to DOWNLOAD SCILAB CP2102 driver setup

Step 5: Connect to Laptop/PC and program ESP Blink

As shown in the above image, click on
File> Example > ESP8266 > Blink
Now, new window will open, with ESP8266 Blink sketch example. In this sketch, you will find that, pin named as LED_BUILTIN is declared as output. This is pin number D13 for NodeMCU. In NodeMCU, pin D13 is internally connected with the on board LED.
After programming NodeMCU esp8266, you will find the LED on NodeMCU is blinking with the given ON-OFF delay. You can change this delay by editing the code. We uploded the code, just to ensure the NodeMCU is programmed or not. If LED is blinking with given delay, hurrey, you just completed setup of NodeMCU programming from Arduino IDE.

Program is getting stucked at “uploading” ?

Connect your NodeMCU to Laptop/PC and follow this sequesnce of Push buttons:-

  1. Press and hold “Flash” Button + Press and release “Reset” Butto
  2. Now release flash button

This will enable program mode of you NodeMCU, now click on Upload button, and you will find issue is resolved.

Still unable to Program NodeMCU esp8266?

It may possible that, you are still not able to program NodeMCU ESP8266. Check for if any below reason:

  1. NodeMCU not getting connected to Laptop/Desktop (Mostly Driver issue)

Follow this troubleshooting guide for more.

0 0 vote
Article Rating

Notify of
Inline Feedbacks
View all comments