December 17, 2020

Programming NodeMCU Step by Step Using Arduino IDE

Programming NodeMCU is as easy as programming as Arduino UNO. You just have to equip your Arduino IDE.

First Connect the NodeMCU to your PC or Laptop using a micro USB data cable.

Then go to the link (NodeMCU Driver) to download the driver. Download and Extract the driver and install it.

Now open the Arduino IDE and go to File > Preferences 

In the Preferences window, you will find Additional Boards Manager URLs. Just copy the line below and paste it there.

http://arduino.esp8266.com/stable/package_esp8266com_index.json


Then close the IDE and reopen it.

Now go to Tools > Board: > Boards Manager



Open the Boards Manager and search for nodemcu.


Then install the most updated version from there.

That's all you have to do. Now let's check what changes have come.


Now lets program nodeMCU with a basic example program Blink. 
Go to File > Examples > Basic > Blink

Now Go to Tools > Boards: and select NodeMCU


After selecting the board go to Port and select the right communication port. Hit the Upload button.


The upload may take a few seconds and after that, you will find a screen like this stating that uploading is done. During the upload the led near pin D0 might blink several times but after the uploading is complete the led will keep glowing for 1 sec and staying off for 1 second.



Video: Coming Soon

NodeMCU Driver Link: https://github.com/nodemcu/nodemcu-devkit/tree/master/Drivers

Introduction to Node MCU

 NodeMCU is an open-source IoT platform. It includes firmware that runs on the ESP8266 Wi-Fi system on a chip(SoC) from Espressif Systems and hardware which is based on the ESP-12 module. The term "NodeMCU" by default refers to the firmware rather than the development kits. The firmware uses the Lua scripting language. It is based on the eLua project and built on the Espressif Non-OS SDK for ESP8266.

In simple words, NodeMCU is a WiFi-enabled microcontroller. It has a micro USB connector so it could be connected to any computer using data cable. The only thing that you must remember that it is a 3.3V logic level device. It means you will get a 3.3V digital high signal and giving more than 3.3V signal is not safe for the controller, however, the input voltage can vary from 5 to 12V.

NodeMCU Pinout contains 9 Digital pins, 1 Analog Pins, 1 Reset Pins & 4 Power Pins. Although some pins are very difficult to use sometimes. 

Let's have a look at the pinout.
 

  • D0 - D8 are Digital Pins
  • A0 is the only analog pin
The Micro USB port makes it very easy to connect with PC. Node MCU can be programmed using Arduino IDE but when we program it with Arduino IDE the original Lua firmware gets overwritten or in other words lost.
a
In our next blog, we will discuss the programming process of the NodeMCU.