Tools and Components

About: I love DIY Electronics

Here is the list of components required to get started with the NodeMCU,

Hardware Components

  • NodeMCU
  • BreadBoard
  • MicroUSB
  • LEDs
  • 330 Ohm Resistor
  • A Cup of Coffee (Helpful when you wait for the Software tools to download)

Software Tools

  • Arduino IDE
  • LUA script Flasher

Step 1: The Arduino Style

To get started we need to download the arduino IDE and some necessary drivers.
The arduino IDE can be downloaded via this link - www.arduino.cc

After downloading the arduino IDE navigate to File => Preferences and in the additional boards URLs add the below URL

http://arduino.esp8266.com/versions/2.3.0/package...

After that navigate to the Tools>Boards>Board Manager and scroll down the list till you can find ESP8266 click on it and then hit install. Now you have setup the arduino IDE to work along with the node MCU.

Additionally you need to install the drivers if you are on a windows based computer. The drivers can be downloaded and install from the below link.

http://arduino.esp8266.com/versions/2.3.0/package...

Step 2: Arduino Uploading First Code

Once the driver is installed it is time to program the NodeMCU, for this select the NodeMCU 1.0 board from the Tools => Boards menu of the arduino IDE.

Now need to find the specific port to which the NodeMCU is connected to the computer. This can be found in device manager. In Tools => Ports make sure you select the right port as seen before.

Then Create a new sketch and paste the code below in the arduino IDE and hit upload.

void setup() {
pinMode(LED_BUILTIN, OUTPUT); //Set the Built in LED to pin to act as an output pin
pinMode(16, OUTPUT); //Set the D0 to pin to act as an output pin

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

}

The code will take a few minutes to upload and Then you should see the LED blink at the interval set in the code.

Step 3: Programming in Pyhton

The NodeMCU doesn't support a full python installation hence there is a smaller distribution of python named as micropython which is based of Python3. So you get all the basic functionality of Python3 on nodeMCU. You can learn more about micropython from the below URL.

https://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/intro.html

Lets start with getting micropython running on the board, you can use nodemcu flasher tool to flash micropython on to you board. NodeMCU flasher tool can be downloaded from here. After flashing it use putty or any other serial monitor to open the right com port and now you should have a python terminal open you can python commands via this shell.

Makerspace Contest 2017

First Prize in the
Makerspace Contest 2017

Share

    Recommendations

    • Optics Contest

      Optics Contest
    • Plastics Contest

      Plastics Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018

    10 Discussions

    0
    None
    DanieleT15

    2 months ago

    I am confused about this instructable. The whole idea with NodeMCU is that it runs a "special" firmware that lets you write your code in Lua. You just completely ignored the Lua part and reflashed the chip to use Arduino C-code and Python? How is this a NodeMCU tutorial? It's rather a generic esp8266 tutorial. As this is a "getting started with nodemcu", I assumed it will show the NodeMCU specific stuff, like a "hello world" example in Lua? Especially as this page is the first hit on google when searching for "nodemcu getting started".

    0
    None
    soilwork

    9 months ago

    Nice instructable, but one question , why D0 is referenced as "16" I never use node MCU before only arduino , or where I can find the pin out making or the equivalences :p

    2 replies
    0
    None
    GeertVcsoilwork

    Reply 5 months ago

    NodeMCU has its own pin definition file, also called pins_arduino.h. See (on windows) this directory:

    C:\Users\<user>\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\variants\nodemcu\pins_arduino.h

    In there, you will see they have an own definition of LED_BUILTIN (mapped on GPIO 16 and not the more frequently used GPIO 13 in case of an Arduino) and they have also static defines for D0 - D10. There, you can see that for instance D0 is mapped on 16.


    Best,

    0
    None
    soilworkGeertVc

    Reply 5 months ago

    thank you so much, I will check that

    0
    None
    GeertVc

    5 months ago on Step 3

    No absolute need for a resistor here (although it doesn't harm).

    0
    None
    nazrdogan

    1 year ago

    NodeJS is a good microcontroller to get started with IoT (Internet of Things) related projects.

    I think its not "NodeJS".it should be "NodeMcu"

    0
    None
    ajayt7

    1 year ago

    Thank you for posting such a good tutorial

    0
    None
    Swansong

    1 year ago

    Great tutorial and very clear photos :) Thanks for sharing!

    1 reply