SlideShare a Scribd company logo
1 of 27
Download to read offline
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

More Related Content

Similar to WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11

Internet of things laboratory
Internet of things laboratoryInternet of things laboratory
Internet of things laboratorySoumee 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.IOJingfeng Liu
 
Home Automation with LinkSprite IO
Home Automation with LinkSprite IOHome Automation with LinkSprite IO
Home Automation with LinkSprite IOJingfeng 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.4Melvin 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.docxgalerussel59292
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5Syed Mustafa
 
Eclipse Kura Shoot a-pi
Eclipse Kura Shoot a-piEclipse Kura Shoot a-pi
Eclipse Kura Shoot a-piEclipse Kura
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection systemAashiq Ahamed N
 
IWAN Lab Guide
IWAN Lab GuideIWAN Lab Guide
IWAN Lab Guidejww330015
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming FamiliarizationAmit Kumer Podder
 
INT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdfINT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdfMSingh88
 
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.pdfJayanthi Kannan MK
 

Similar to 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
 

Recently uploaded

Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 

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