Menu Close

NodeMCU connecting to internet on Arduino IDE

This tutorial of Robo India is a basic tutorial to connect a NodeMCU wifi module to the internet. This tutorial is based on Arduino IDE.

1. Introduction:

This tutorial explains how to connect a NodeMCU wifi development board to the internet. It connects to the internet through a wifi network.

1.2 Hardware required

S.No.ItemQuantity
1NodeMCU 1
2.Micro USB cable 1

2. Building Circuit

No circuit is required to run this tutorial. Just plug USB cable to the NodeMCU, upload the code provided here in this tutorial and its done.

3. Programming:

Here is the code to run this circuit on NodeMCU.

You may download this code (Arduino Sketch) from here.

#include <ESP8266WiFi.h>

const char *ssid =  "Your wifi Network name";     // replace with your wifi ssid and wpa2 key
const char *pass =  "Network password";

WiFiClient client;
 
void setup() 
{
       Serial.begin(9600);
       delay(10);
               
       Serial.println("Connecting to ");
       Serial.println(ssid); 
 
       WiFi.begin(ssid, pass); 
       while (WiFi.status() != WL_CONNECTED) 
          {
            delay(500);
            Serial.print(".");
          }
      Serial.println("");
      Serial.println("WiFi connected"); 
}
 
void loop() 
{      
  
}


4. Output

Output of this project is seen on serial monitor. Open serial monitor after uploading the code. Output is seen there.

If you have any query please write us at support@roboindia.com

Thanks and Regards
Content Development Team 
Robo India
https://roboindia.com

5 Comments

Leave a Reply