Introduction to NodeMCU

Jan 11, 2019 | NodeMCU

NodeMCU is exactly something that the following image indicates. NodeMCU is like a programmable Arduino board, but a lot more than just that. It has inbuilt Wifi and a lot more which I will be covering here and also show you all how to program it.

What is NodeMCU?

NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi 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. It uses many open source projects, such as lua-cjson, and spiffs.

Arduino Uno Vs NodeMCU

SpecificationNodeMCUArduino UNO
WifiYESNO
RAM128KB2KB
ROM4MB32KB
ConnectorMicroUSBUSB Type B
Operating Voltage3.3V5V
Max Current12mA40mA
Clock Speed80MHz16MHz
GPIO Pins1416
Analog Pins16
PWM96
Size4.8 x 2.5 CM6.6 x 5.3 CM

Yes, all this in almost the same price of Arduino UNO!

NodeMCU overview and pinout:

A NodeMCU board looks like the following:

And here is the pinout diagram of a NodeMCU board:

Programming the NodeMCU board

Step 1:
Another great thing about the NodeMCU is that it can easily be programmed through the Arduino IDE. So, to get started with the awesome NodeMCU board, first get yourself one ofcourse.

Step 2:
Next, you will need the Arduino IDE. Download it from here if you do not have it already.
(If you already have the Arduino IDE, make sure it is equal or above version 1.8)

Step 3:
Now, open the Arduino IDE and navigate to File > Preferences

A window like below should appear. Now, copy and paste this link in the red marked box shown in the image.

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

Step 4:
After the link has been put there, navigate to Tools > Boards > Board Manager

Type and search for “8266” and install the ESP8266 package.

It may take a little time to download and install. But after that has been done, you are ready to also done with your NodeMCU programming environment set up!

Now, let’s test it!

Programming the NodeMCU: LED Blink Project

You program the NodeMCU exactly like Arduino. The same syntax does the same basic things.

So, first of all, implement the following circuit:

Next, connect the MicroUSB cable and connect your NodeMCU to your computer. You should see your board blinking a blue light a few times. That is normal and unlike Arduino, it doesn’t have any indicator to show if it is being supplied power.

Now, from your Arduino IDE, navigate to Tools > Board and select “NodeMCU 0.9(ESP – 12 Module)”.

After that has been down, it is time to write code and upload to your board!

void setup() {
  pinMode(D7, OUTPUT);     // Initialize the D7 pin as an output
}

void loop() {
  digitalWrite(D7, HIGH);   
  delay(3000);                      // Wait for 3 seconds

  digitalWrite(D7, LOW);  // Turn the LED off by making the voltage LOW
  delay(1000);                    // Wait for 1 seconds
}

Now, click upload & wait for the code to upload. You should see the blue LED blinking while the code is being uploaded.

Now, after the codes has been uploaded, you should see the LED blinking.

Congratulations! You have successfully learned to program and use NodeMCU!

Someone in DULWICH HILL bought a
Arduino Nano 3.0 Atmel ATmega328 Mini-USB Board+ 1pcs USB Cable
about 33 mins ago
 
Someone in KENNINGTON bought a
High Accuracy DS3231 RTC and EEPROM
about 29 mins ago
 
DHT22 Digital Temperature & Humidity Sensor
Someone in RINGWOOD NORTH bought a
DHT22 Digital Temperature and Humidity Sensor AM2302
about 9 hours ago
 
DHT22 Digital Temperature & Humidity Sensor
Someone in INGLEWOOD bought a
DHT22 Digital Temperature and Humidity Sensor AM2302
about 8 hours ago
 
Someone in PERTH bought a
Arduino Nano 3.0 Atmel ATmega328 Mini-USB Board
about 10 hours ago
 
UNO R3 Board ATmega328P CH340G Arduino Compatible with USB Cable
Someone in AUSTINMER bought a
UNO R3 Board MEGA328P CH340G Arduino Compatible with USB Cable + 1 Item
about 10 hours ago
 
Someone in KATOOMBA bought a
Arduino Nano 3.0 Atmel ATmega328 Mini-USB Board+ 1pcs USB Cable
about 11 hours ago
 
Someone in MARYBOROUGH bought a
Bi-Directional IDE to SATA or SATA to IDE Converter
about 22 hours ago
 
Smoke and Combustible Gas Sensor – MQ2 (LPG, I-Butane, Propane, Methane, Alcohol and Hydrogen)
Someone in KEILOR LODGE bought a
Smoke and Combustible Gas Sensor – MQ2 (Smoke, LPG, I-Butane, Propane, Methane, Alcohol and Hydrogen)
about 1 day ago
 
Breadboard Power Supply Module 3.3V - 5V (Red Wings - MB102)
Someone in WELLARD bought a
Breadboard Power Supply Module 3.3V - 5V (Red Wings - MB102)
about 1 day ago
 
Share This
X