NewLogo
What is IoT And how to use ESP8266 in Projects ?
 

What is a WiFi Module? How to use ESP8266?

Introduction :

IoT is a technology in which we connect devices or computers through the Internet to exchange data from any source or place to another source or place without any human interaction.
 
These are some recent facts about IoT :

 

    • # Cisco states in a research that 27.1 billion devices are connected in 2021. 
    •  
    • # 43% of network devices will be mobile-connected in 2021.

    •  
    • # Every second, 127 IoT devices are connected to the internet or web today.
    •  
    •  
So after understanding the internet of things we can easily understand that IoT Technology helps us to become digital in modern society.


 

So after understanding the internet of things we can easily understand that IoT Technology helps us to become digital in modern society.

  Working and Features of ESP8266 WiFi module :

 
 
Now let's see the working of IoT devices. So in the Internet of things technology electronics devices transmit or receive data from other sources through the internet. But how these devices exchange data with each other? Well, data can be changed wirelessly by various communication protocols like Bluetooth, Internet, Radiofrequency waves, etc.
 
In IoT, any theme can be used to fulfill the project's requirements. All protocols have their pros and cons. In all of the themes, the most popular protocol is the internet. In this tutorial, we use ESP8266 that also works on the same internet protocol to exchange the data.ESP32 also comes with a Bluetooth feature along with the internet.
 
To provide the internet to devices like sensors, actuators or any other microcontrollers we need an another device or Wi-Fi module that can provide the internet to these devices to become capable of transmitting or receiving data.so many Wi-Fi modules in the market can be embedded with sensors and actuators and microcontrollers to provide the internet.
 
I made a video to give an introduction to different types of Wi-Fi models. So if you want to know about other Wi-Fi modules you can check out this video by clicking on this link.

ESP8266 is a low-cost device while ESP32 is less costly than esp8266. ESP32 also inbuilt Bluetooth feature by which we can connect our device also through Bluetooth.
 
Programming and setup are the same for both Wi-Fi models so by understanding the esp8266 we can also easily understand ESP32. there is no such major difference between these two devices. Here is a video by me in which I told the difference between ESP8266 and ESP32 and the features of both modules. To see the video, Click Here.
Now we'll see how to use ESP8266 to transmit or receive the data through the sensor. Here are the required things you needed in this tutorial:-ESP8266 wifi Module.

Raspberry Pi 3 - Model B- 1 GB Ram (Latest & Original)

Arduino IDE Software.USB Cable.If you want to purchase ESP8266, You can order by clicking here or from our website. We provide low-cost electronic devices with fast shipping and with a good customer experience.  let's get back to our tutorial. after getting this to devices.
 
We will install Arduino software that helps us to program our device. So until now, we have introduced IoT with esp8266 so let's jump into how to use this amazing wifi module to create creative and innovative projects. 

 

 

  • After downloading the .exe file, Open that file and install Arduino IDE.
  •  
  • Now Open the Arduino software.
  •  
  • To connect esp8266 libraries and boards in the Arduino we have to add a URL in the additional board of Arduino IDE. To do this go to File>preference>additional board 
  •  
  • And paste https://arduino.esp8266.com/stable/package_esp8266com_index.json this URL.
  •  

 

  • Now go to tools>board and click on manage boards. And search for esp8266 and install the esp8266 community.
  •  
  • Now go to Sketch>Include libraries and scroll down it and you can see all required libraries for esp8266. And by going to file>examples you can find examples on esp8266.
  •  
  • Now we will connect our esp8266 with our mobile hotspot to provide it good internet connectivity.
  •  
  • here is the code for connecting Nodemcu with wifi:
 

 

  #include <ESP8266WiFi.h>
 const char* ssid = STASSID;
 const char* password = STAPSK;
 void setup() {
Serial.begin(115200);
 Serial.println();
 Serial.print("connecting to ");
 Serial.println(ssid);
 WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500); Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
 Serial.println("IP address: ");
 Serial.println(WiFi.localIP());
 void loop() {
}
 
 
  • To run this code connects the esp8266 device with your laptop or desktop through a USB cable. Please ensure that the USB cable should be capable of transmitting the data.
  •  
  • After connecting by going through tools>boards, select board ESP8266 1.0. And by going through tools>port select the available port. 

 

  • Paste the given code and upload it, By clicking on the upload button.
  •  
  • If you did everything same as told in this tutorial then your program should be Run.
  •  
  • now open tools>serial Monitor.If your output print the given strings then congratulations your program is successful running. In next tutorial we will send moisture sender's data on server.

 

 

Leave a Reply

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