Blinking LED NodeMCU connection diagram

How to start learning NodeMCU in simple steps? Basic Tutorial on NodeMCU

This entry is part 6 of 9 in the series Arduino Tips & Tricks

Fundamentals of NodeMCU

NodeMCU is an open-source firmware, meaning it’s freely available to use, modify and distribute. It is based on ESP8266 chip. It runs on the ESP8266 Wi-Fi SoC (System on a Chip) and it provides Wi-Fi connectivity and a microcontroller in a single package.

LUA scripting language: You can program NodeMCU using the LUA scripting language, which is known for its simplicity and ease of learning.

Key features

NodeMCU comes with lots of features within a single package.

  1. It provides direct Wi-Fi connectivity.
  2. It has general purpose input/output (GPIO) pins for interfacing with sensors, actuators and other electronics devices and circuits.
  3. It has inbuilt analog-to-digital converter (ADC) for reading analog input signals.
  4. It has serial communication protocols (UART, SPI, I2C) for data exchange with other devices like another NodeMCU or Arduino.
  5. It has very low power consumption.

How to Start Learning NodeMCU

First gather the necessary hardware as listed below. You can get it from any electronics shop or search for it online on the sites like www.robomart.com or www.robosapi.com

  1. NodeMCU development board (available online for affordable prices)
  2. Micro-USB cable for power and programming
  3. Breadboard and jumper wires for prototyping
  4. Optional: sensors, LEDs, or other components for experimentation

Install the software

To program the NodeMCU you will require the Arduino IDE software. This is a popular and user-friendly environment for programming microcontrollers, including NodeMCU. Download it from this link.

After installing the software, Arduino IDE, you will have install the ESP8266 board package. 

For that follow this procedure.

  1. Open the Arduino IDE software. In the menu, click on File > Preferences > Settings
  2. Then paste following link into the “Additional Boards Manager URLs” field, and click “OK.”

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

  1. Then in menu again click on Tools > Board > Boards Manager and then search for “esp8266” and install the package by clicking on the “Install” button.

Let us write first program

Now you are ready to write your first program for your NodeMCU board.

  1. Start with simple examples like blinking an LED or reading sensor data.
  2. Use resources like the official NodeMCU documentation and online tutorials.
  3. Explore the Arduino IDE’s examples and libraries for NodeMCU.

Circuit Diagram

Build this simple circuit on small breadboard and then upload the code in NodeMCU.

image 13 Vidyasagar Academy

Example Code

 #define LED D1 // connect external LED to pin D1 with resistor
 void setup() 
 {
  pinMode(LED, OUTPUT); // LED pin as output.
 }
 void loop() 
 {
  // Note that the pins in NodeMCU are acive low on the ESP8266
  digitalWrite(LED, HIGH); // turn the LED off - there is no typing mistake here!
  delay(1000);
  digitalWrite(LED, LOW); // turn the LED on - there is no typing mistake here!
  delay(1000); // wait for 1 second.
 }

Our Upcoming Publications

Share on your network!
Prof. Dattaraj Vidyasagar
Prof. Dattaraj Vidyasagar

Author on this website. He is veteran of Core Electronics since last 36+ years. ATL Mentor of Change, Niti Ayog, Govt. of India, Google Certified Educator, International Robotics Trainer and author of 18 books on electronics, robotics, programming languages and web designing... ➤➤

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x