Follow Us
Facebook Twitter Google Plus Linkedin Instagram YouTube

Getting Started with NodeMCU (ESP8266)

Hello there,

If you are looking forward to get started with IoT,  then NodeMCU (ESP8266) is a great platform to start tinker with. This is why we have written this guide to get easily started with this interesting platform. Let’s get started..

What Nodemcu (ESP8266) is ?..

NodeMCU is an open source IoT platform. This platform contains ESP8266 processor from Espressif is an 80 MHz microcontroller which has WiFi capabilities in it. It is one of low cost module in IoT world which makes it popular among the developers. There are range of exciting projects possible with this small and low cost module.


 

Now let’s try hands on this platform…

Setting up Programming Environment

This guide assumes that you are having NodeMCU with the Silicon Labs CP2102 USB to UART Bridge for programming.

Step 1:

Download and install the Silicon Labs CP2102 USB to UART Bridge driver for your computer.

Step 2:

Download and install latest version of Arduino IDE.

Step 3:

Start Arduino and open Preferences window.

Step 4:

Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.

Step 5:

Open Boards Manager from Tools > Board menu and install esp8266 platform (and don’t forget to select your ESP8266 board from Tools > Board menu after installation).

 

Running first program on NodeMCU

Blinking LED is the best way to start programming with any new hardware platform. So let us blink an LED with this new platform. But before that it is very important for us to understand pin mapping on the board. The following picture explain it well.

You can choose any digital pin from D0 to D8. You need to connect anode of your LED (long leg) to one leg of a resistor (100 ohm) and remaining leg of resistor to digital pin. Now connect cathode of LED (short leg) to GND pin. You could refer the following interfacing diagram where pin D4 is used.

Now open Arduino IDE. Create a new file and paste the following simple code. You should replace D4 in program with your pin number.


void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}


// the loop function runs over and over again forever
void loop() {
digitalWrite(D4, HIGH);  // turn the LED on (HIGH is the voltage level)
delay(1000);             // wait for a second
digitalWrite(D4, LOW);   // turn the LED off by making the voltage LOW
delay(1000);             // wait for a second
}

Congratulations….! You have successfully completed the initial steps towards your IoT journey.

Leave a Reply

Your email address will not be published.Required fields are marked *