SlideShare une entreprise Scribd logo
Showcased by: Hussain S
Enroll no. 2021BTBME009
1
INTERFACING OF
WIFI-MODULE
WITH ARDUINO
Objective
https://eldontronics.wordpress.com
/wp-
content/uploads/2017/08/img_4189
.jpg
The ESP-01 module's primary
goal is to make adding Wi-Fi to
electronic projects simple and
affordable.
It functions similarly to a tiny
chip that you can attach to other
electronic devices, such as
sensors or microcontrollers, to
enable wireless internet access.
Less expensive with less space
compatable
2
Core Components
Arduino Uno
http://image
WIFI Module: ESP01
http://image
3
DTH11 sensor
http://image
The Arduino Uno can be
programmed using the Arduino
software platform, which simplifies
the process of writing code for
controlling sensors, motors, lights,
and other electronic components.
The Arduino Uno is a popular
microcontroller board based on the
ATmega328P microcontroller
Arduino UNO
http://image
4
Features of Arduino UNO
The operating voltage is 5V
The recommended input voltage will range from 7v to 12V
The input voltage ranges from 6v to 20V
Digital input/output pins are 14
Analog i/p pins are 6
DC Current for each input/output pin is 40 mA
DC Current for 3.3V Pin is 50 mA
Flash Memory is 32 KB
SRAM is 2 KB
EEPROM is 1 KB
CLK Speed is 16 MHz
5
OTHER APPLICATIONS OF ARDUINO
Traffic Light Count Down Timer
Parking Lot Counter
Home Automation
Weighing Machines
Medical Instrument
Washing Machine
Microwave Over
Security Systems
CCTV Switchers
Advantages
No additional programmer/burner hardware is
required for the programming board
Portable
Low power consumption
6
The ESP01 WiFi module is
The ESP01 is a compact and power-efficient WIFI module that
seamlessly integrates with microcontrollers. It enables wireless
connectivity for a wide range of IoT and smart home applications.
http://image 7
8
Feature of ESP01
Compact size: Small footprint
GPIO Pins: GPIO pins for interfacing with sensors and peripherals.
power supply: 3.3 volts (V)
Serial communication: Utilizes UART for communication with
microcontrollers.
AT command support: Communicates with microcontroller via AT
commands
Cost-effective: Inexpensive
9
Applications
Home automation applications of
the ESP01 ESP01 module is widely used in IoT
10
Environmental Monitoring
Industrial control and monitoring
Wireless Control
Connection Description
VCC
Connect to a 3.3V
output from Arduino
GND
Connect to
Arduino's ground
TX
Connect Arduino's
TX pin to ESP-01's
RX pin
RX
Connect Arduino's
RX pin to ESP-01's
TX pin
11
ESP-01 Arduino Interfacing connection
Software Setup:
Install the Arduino IDE if you
haven't already.
Install the ESP8266 library in
Arduino IDE: Go to "Sketch" ->
"Include Library" -> "Manage
Libraries", then search for
"ESP8266" and install it.
Programming ESP-01
Communication with Arduino
Hardware Setup:
Note:
Remember to use a voltage divider or
level shifter
Code
#include<SoftwareSerial.h>
#include <Wire.h>
#include <DFRobot_DHT11.h>
SoftwareSerial comm(2, 3); //setting Tx and Rx pins
DFRobot_DHT11 DHT;
#define DHT11_PIN 11
String server = ""; //variable for sending data to webpage
boolean No_IP = false; //variable to check for ip Address
String IP = ""; //variable to store ip Address
char temp1 = '0';
int a = 0;
int b = 0;
String str1 = "<p>I am Arduino</p>"; //String to display on webpage
String str2 = "<p>Data Received Successfully.....</p>"; //another
string to
display on webpage
12
void setup()
{
Serial.begin(115200);
comm.begin(115200);
wifi_init();
Serial.println("System Ready..");
}
void loop()
{
int temperature = 0;
int humidity = 0;
DHT.read(DHT11_PIN);
Serial.print("Temperature: ");
Serial.print(DHT.temperature);
temperature = DHT.temperature;
Serial.print(" °CHumidity: ");
Serial.print(DHT.humidity);
Serial.println(" %");
humidity = DHT.humidity;
13
sendDataToServer(temperature, humidity);
delay(10000);
}
void findIp(int time1) //check for the availability of IP Address
{
int time2 = millis();
while (time2 + time1 > millis())
{
while (comm.available() > 0)
{
if (comm.find("IP has been read"))
{
No_IP = true;
}
}
}
}
void showIP()//Display the IP Address
{ 14
IP = "";
char ch = 0;
while (1)
{
comm.println("AT+CIFSR");
while (comm.available() > 0)
{
if (comm.find("STAIP,"))
{
delay(1000);
Serial.print("IP Address:");
while (comm.available() > 0)
{
ch = comm.read();
if (ch == '+')
break;
IP += ch;
15
}
}
if (ch == '+')
break;
}
if (ch == '+')
break;
delay(1000);
}
Serial.print(IP);
Serial.print("Port:");
Serial.println(80);
}
void establishConnection(String command, int timeOut) //Define the
process for
sending AT commands to module
{
int q = 0;
while (1) 16
Serial.println(command);
comm.println(command);
while (comm.available())
{
if (comm.find("OK"))
q = 8;
}
delay(timeOut);
if (q > 5)
break;
q++;
}
if (q == 8)
Serial.println("OK");
else
Serial.println("Error");
}
17
void wifi_init() //send AT commands to module
{
establishConnection("AT", 100);
delay(1000);
establishConnection("AT+CWMODE=3", 100);
delay(1000);
establishConnection("AT+CWQAP", 100);
delay(1000);
establishConnection("AT+RST", 5000);
delay(1000);
findIp(5000);
if (!No_IP)
{
18
Serial.println("Connecting Wifi....");
establishConnection("AT+CWJAP="hussain","hussain97"", 7000);
//provide your
WiFi username and password here
}
else
{
}
Serial.println("Wifi Connected");
showIP();
establishConnection("AT+CIPMUX=1", 100);
establishConnection("AT+CIPSERVER=1,80", 100);
}
void sendData(String server1)//send data to module
{
int p = 0;
while (1)
{ 19
unsigned int l = server1.length();
Serial.print("AT+CIPSEND=0,");
comm.print("AT+CIPSEND=0,");
Serial.println(l + 2);
comm.println(l + 2);
delay(100);
Serial.println(server1);
comm.println(server1);
while (comm.available())
{
//Serial.print(Serial.read());
if (comm.find("OK"))
{
20
p = 11;
break;
}
}
if (p == 11)
break;
delay(100);
}
}
void sendToServer()//send data to webpage
{
server = "<h1>Welcome to Data Receiving from Arduino</h1>";
sendData(server);
server = str1;
server += str2;
sendData(server);
delay(5000);
comm.println("AT+CIPCLOSE=0");
21
void sendDataToServer(int temperature, int humidity) {
String server1 = "</p>";
server1 += "<p>Temperature: ";
server1 += temperature;
server1 += "</p>";
server1 += "<p>Humidity: ";
server1 += humidity;
server1 += "</p>";
sendData(server1);
}
22
Explanation
1. Libraries: The code includes libraries like SoftwareSerial for
communication, Wire for I2C communication, and DFRobot_DHT11 for
interacting with the DHT11 sensor.
2. Global Variables: Variables like server, No_IP, IP, temp1, a, b,
str1, and str2 are declared for various purposes including storing
server information, IP address, and strings for webpage display.
3. setup() Function: Initializes serial communication, initializes the
WiFi module, and prints a message to indicate system readiness.
4. loop() Function: Continuously reads temperature and humidity from
the DHT11 sensor, sends the data to the server, and then delays for 10
seconds before repeating.
23
5. findIp() Function: Checks for the availability of an IP address.
6. showIP() Function: Retrieves and displays the IP address.
7. establishConnection() Function: Sends AT commands to the WiFi
module and waits for the response.
8. wifi_init() Function: Initializes the WiFi module by sending a
series of AT commands, connecting to the WiFi network if an IP address
is available, and configuring the module for server communication.
9. sendData() Function: Sends data to the server using
the AT command AT+CIPSEND.
10. sendToServer() Function: Constructs and sends HTML-formatted data
to the server.
11. sendDataToServer() Function: Formats and sends temperature and
humidity data to the server.
24
Result
25
9. References
1. https://www.arduino.cc/
2. https://www.electronicwings.com/nodemcu
3.https://www.instructables.com/Connect-Arduino-Uno-With-ESP8266/
4. https://docs.arduino.cc/retired/boards/arduino-uno-wifi
Conclusion
The ESP-01 WiFi module's integration with the Arduino Uno provides an
easy and practical way to integrate wireless connectivity into
electronic projects. This improves these projects' usefulness and
adaptability and creates new opportunities for IoT, home automation,
and industrial control, among other industries. This integration has
the potential to completely change how electronic devices communicate
and interact with one another with the right setup and programming.
26
27

Contenu connexe

Similaire à WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11

NodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDENodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDE
Subhadra Sundar Chakraborty
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
Electric&elctronics&engineeering
 
Internet of things laboratory
Internet of things laboratoryInternet of things laboratory
Internet of things laboratory
Soumee Maschatak
 
IRJET- Wi-Fi Control First Person View Robot (FPV)
IRJET- Wi-Fi Control First Person View Robot (FPV)IRJET- Wi-Fi Control First Person View Robot (FPV)
IRJET- Wi-Fi Control First Person View Robot (FPV)
IRJET Journal
 
Open Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IOOpen Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IO
Jingfeng Liu
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IO
Jingfeng Liu
 
Esp8266 wi fi_module_quick_start_guide_v_1.0.4
Esp8266 wi fi_module_quick_start_guide_v_1.0.4Esp8266 wi fi_module_quick_start_guide_v_1.0.4
Esp8266 wi fi_module_quick_start_guide_v_1.0.4
Melvin Gutiérrez Rivero
 
All contents are Copyright © 1992–2012 Cisco Systems, Inc. A.docx
All contents are Copyright © 1992–2012 Cisco Systems, Inc. A.docxAll contents are Copyright © 1992–2012 Cisco Systems, Inc. A.docx
All contents are Copyright © 1992–2012 Cisco Systems, Inc. A.docx
galerussel59292
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5
Syed Mustafa
 
Eclipse Kura Shoot a-pi
Eclipse Kura Shoot a-piEclipse Kura Shoot a-pi
Eclipse Kura Shoot a-pi
Eclipse Kura
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection system
Aashiq Ahamed N
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
Arvind Singh
 
IWAN Lab Guide
IWAN Lab GuideIWAN Lab Guide
IWAN Lab Guide
jww330015
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
udhayakumarc1
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
udhayakumarc1
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
Amit Kumer Podder
 
INT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdfINT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdf
MSingh88
 
20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Joris20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Jorisimec.archive
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
Jayanthi Kannan MK
 
The arduino and iot
The arduino and iotThe arduino and iot
The arduino and iot
Shreya Pohekar
 

Similaire à WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11 (20)

NodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDENodeMCU 0.9 Manual using Arduino IDE
NodeMCU 0.9 Manual using Arduino IDE
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
 
Internet of things laboratory
Internet of things laboratoryInternet of things laboratory
Internet of things laboratory
 
IRJET- Wi-Fi Control First Person View Robot (FPV)
IRJET- Wi-Fi Control First Person View Robot (FPV)IRJET- Wi-Fi Control First Person View Robot (FPV)
IRJET- Wi-Fi Control First Person View Robot (FPV)
 
Open Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IOOpen Source Home Automation with LinkSprite.IO
Open Source Home Automation with LinkSprite.IO
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IO
 
Esp8266 wi fi_module_quick_start_guide_v_1.0.4
Esp8266 wi fi_module_quick_start_guide_v_1.0.4Esp8266 wi fi_module_quick_start_guide_v_1.0.4
Esp8266 wi fi_module_quick_start_guide_v_1.0.4
 
All contents are Copyright © 1992–2012 Cisco Systems, Inc. A.docx
All contents are Copyright © 1992–2012 Cisco Systems, Inc. A.docxAll contents are Copyright © 1992–2012 Cisco Systems, Inc. A.docx
All contents are Copyright © 1992–2012 Cisco Systems, Inc. A.docx
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5
 
Eclipse Kura Shoot a-pi
Eclipse Kura Shoot a-piEclipse Kura Shoot a-pi
Eclipse Kura Shoot a-pi
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection system
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
 
IWAN Lab Guide
IWAN Lab GuideIWAN Lab Guide
IWAN Lab Guide
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
INT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdfINT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdf
 
20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Joris20081114 Friday Food iLabt Bart Joris
20081114 Friday Food iLabt Bart Joris
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
 
The arduino and iot
The arduino and iotThe arduino and iot
The arduino and iot
 

Dernier

Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
Kamal Acharya
 
An Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering TechniquesAn Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering Techniques
ambekarshweta25
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 

Dernier (20)

Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
 
An Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering TechniquesAn Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering Techniques
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 

WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11

  • 1. Showcased by: Hussain S Enroll no. 2021BTBME009 1 INTERFACING OF WIFI-MODULE WITH ARDUINO
  • 2. Objective https://eldontronics.wordpress.com /wp- content/uploads/2017/08/img_4189 .jpg The ESP-01 module's primary goal is to make adding Wi-Fi to electronic projects simple and affordable. It functions similarly to a tiny chip that you can attach to other electronic devices, such as sensors or microcontrollers, to enable wireless internet access. Less expensive with less space compatable 2
  • 3. Core Components Arduino Uno http://image WIFI Module: ESP01 http://image 3 DTH11 sensor http://image
  • 4. The Arduino Uno can be programmed using the Arduino software platform, which simplifies the process of writing code for controlling sensors, motors, lights, and other electronic components. The Arduino Uno is a popular microcontroller board based on the ATmega328P microcontroller Arduino UNO http://image 4
  • 5. Features of Arduino UNO The operating voltage is 5V The recommended input voltage will range from 7v to 12V The input voltage ranges from 6v to 20V Digital input/output pins are 14 Analog i/p pins are 6 DC Current for each input/output pin is 40 mA DC Current for 3.3V Pin is 50 mA Flash Memory is 32 KB SRAM is 2 KB EEPROM is 1 KB CLK Speed is 16 MHz 5
  • 6. OTHER APPLICATIONS OF ARDUINO Traffic Light Count Down Timer Parking Lot Counter Home Automation Weighing Machines Medical Instrument Washing Machine Microwave Over Security Systems CCTV Switchers Advantages No additional programmer/burner hardware is required for the programming board Portable Low power consumption 6
  • 7. The ESP01 WiFi module is The ESP01 is a compact and power-efficient WIFI module that seamlessly integrates with microcontrollers. It enables wireless connectivity for a wide range of IoT and smart home applications. http://image 7
  • 8. 8 Feature of ESP01 Compact size: Small footprint GPIO Pins: GPIO pins for interfacing with sensors and peripherals. power supply: 3.3 volts (V) Serial communication: Utilizes UART for communication with microcontrollers. AT command support: Communicates with microcontroller via AT commands Cost-effective: Inexpensive
  • 9. 9 Applications Home automation applications of the ESP01 ESP01 module is widely used in IoT
  • 10. 10 Environmental Monitoring Industrial control and monitoring Wireless Control
  • 11. Connection Description VCC Connect to a 3.3V output from Arduino GND Connect to Arduino's ground TX Connect Arduino's TX pin to ESP-01's RX pin RX Connect Arduino's RX pin to ESP-01's TX pin 11 ESP-01 Arduino Interfacing connection Software Setup: Install the Arduino IDE if you haven't already. Install the ESP8266 library in Arduino IDE: Go to "Sketch" -> "Include Library" -> "Manage Libraries", then search for "ESP8266" and install it. Programming ESP-01 Communication with Arduino Hardware Setup: Note: Remember to use a voltage divider or level shifter
  • 12. Code #include<SoftwareSerial.h> #include <Wire.h> #include <DFRobot_DHT11.h> SoftwareSerial comm(2, 3); //setting Tx and Rx pins DFRobot_DHT11 DHT; #define DHT11_PIN 11 String server = ""; //variable for sending data to webpage boolean No_IP = false; //variable to check for ip Address String IP = ""; //variable to store ip Address char temp1 = '0'; int a = 0; int b = 0; String str1 = "<p>I am Arduino</p>"; //String to display on webpage String str2 = "<p>Data Received Successfully.....</p>"; //another string to display on webpage 12
  • 13. void setup() { Serial.begin(115200); comm.begin(115200); wifi_init(); Serial.println("System Ready.."); } void loop() { int temperature = 0; int humidity = 0; DHT.read(DHT11_PIN); Serial.print("Temperature: "); Serial.print(DHT.temperature); temperature = DHT.temperature; Serial.print(" °CHumidity: "); Serial.print(DHT.humidity); Serial.println(" %"); humidity = DHT.humidity; 13
  • 14. sendDataToServer(temperature, humidity); delay(10000); } void findIp(int time1) //check for the availability of IP Address { int time2 = millis(); while (time2 + time1 > millis()) { while (comm.available() > 0) { if (comm.find("IP has been read")) { No_IP = true; } } } } void showIP()//Display the IP Address { 14
  • 15. IP = ""; char ch = 0; while (1) { comm.println("AT+CIFSR"); while (comm.available() > 0) { if (comm.find("STAIP,")) { delay(1000); Serial.print("IP Address:"); while (comm.available() > 0) { ch = comm.read(); if (ch == '+') break; IP += ch; 15
  • 16. } } if (ch == '+') break; } if (ch == '+') break; delay(1000); } Serial.print(IP); Serial.print("Port:"); Serial.println(80); } void establishConnection(String command, int timeOut) //Define the process for sending AT commands to module { int q = 0; while (1) 16
  • 17. Serial.println(command); comm.println(command); while (comm.available()) { if (comm.find("OK")) q = 8; } delay(timeOut); if (q > 5) break; q++; } if (q == 8) Serial.println("OK"); else Serial.println("Error"); } 17
  • 18. void wifi_init() //send AT commands to module { establishConnection("AT", 100); delay(1000); establishConnection("AT+CWMODE=3", 100); delay(1000); establishConnection("AT+CWQAP", 100); delay(1000); establishConnection("AT+RST", 5000); delay(1000); findIp(5000); if (!No_IP) { 18
  • 19. Serial.println("Connecting Wifi...."); establishConnection("AT+CWJAP="hussain","hussain97"", 7000); //provide your WiFi username and password here } else { } Serial.println("Wifi Connected"); showIP(); establishConnection("AT+CIPMUX=1", 100); establishConnection("AT+CIPSERVER=1,80", 100); } void sendData(String server1)//send data to module { int p = 0; while (1) { 19
  • 20. unsigned int l = server1.length(); Serial.print("AT+CIPSEND=0,"); comm.print("AT+CIPSEND=0,"); Serial.println(l + 2); comm.println(l + 2); delay(100); Serial.println(server1); comm.println(server1); while (comm.available()) { //Serial.print(Serial.read()); if (comm.find("OK")) { 20
  • 21. p = 11; break; } } if (p == 11) break; delay(100); } } void sendToServer()//send data to webpage { server = "<h1>Welcome to Data Receiving from Arduino</h1>"; sendData(server); server = str1; server += str2; sendData(server); delay(5000); comm.println("AT+CIPCLOSE=0"); 21
  • 22. void sendDataToServer(int temperature, int humidity) { String server1 = "</p>"; server1 += "<p>Temperature: "; server1 += temperature; server1 += "</p>"; server1 += "<p>Humidity: "; server1 += humidity; server1 += "</p>"; sendData(server1); } 22
  • 23. Explanation 1. Libraries: The code includes libraries like SoftwareSerial for communication, Wire for I2C communication, and DFRobot_DHT11 for interacting with the DHT11 sensor. 2. Global Variables: Variables like server, No_IP, IP, temp1, a, b, str1, and str2 are declared for various purposes including storing server information, IP address, and strings for webpage display. 3. setup() Function: Initializes serial communication, initializes the WiFi module, and prints a message to indicate system readiness. 4. loop() Function: Continuously reads temperature and humidity from the DHT11 sensor, sends the data to the server, and then delays for 10 seconds before repeating. 23
  • 24. 5. findIp() Function: Checks for the availability of an IP address. 6. showIP() Function: Retrieves and displays the IP address. 7. establishConnection() Function: Sends AT commands to the WiFi module and waits for the response. 8. wifi_init() Function: Initializes the WiFi module by sending a series of AT commands, connecting to the WiFi network if an IP address is available, and configuring the module for server communication. 9. sendData() Function: Sends data to the server using the AT command AT+CIPSEND. 10. sendToServer() Function: Constructs and sends HTML-formatted data to the server. 11. sendDataToServer() Function: Formats and sends temperature and humidity data to the server. 24
  • 26. 9. References 1. https://www.arduino.cc/ 2. https://www.electronicwings.com/nodemcu 3.https://www.instructables.com/Connect-Arduino-Uno-With-ESP8266/ 4. https://docs.arduino.cc/retired/boards/arduino-uno-wifi Conclusion The ESP-01 WiFi module's integration with the Arduino Uno provides an easy and practical way to integrate wireless connectivity into electronic projects. This improves these projects' usefulness and adaptability and creates new opportunities for IoT, home automation, and industrial control, among other industries. This integration has the potential to completely change how electronic devices communicate and interact with one another with the right setup and programming. 26
  • 27. 27