This Project is to Create an IOT based Temperature and Humidity Logger using ESP8266, Which is programmed with the Arduino IDE. Here we will interface DHT11 type sensor with ESP8266 to obtain the readings. This can be viewed by accessing the webpage, in which it is connected through WiFi.
If you are new to ESP8266 go through Getting started with ESP8266.
Before continuing with this project you can refer Programming ESP8266 with Arduino IDE to get started with.
Circuit Connection:
Here we are using USB to TTL converter for connecting the Module with the PC. The 3.3V output of the converter is used to power the module.
The connection details are as below:
WIFI Module |
USB-TTL
|
Vcc |
3.3v |
Gnd |
Gnd |
TX |
RX |
RX |
TX |
CH_PD |
Connected to 3.3v to enable chip firmware boot |
Don’t forget to pull up CH_PD HIGH, you won’t get a response from the module if it is not done.
If you don’t have USB-TTL, you can also use Arduino for the connection. For more details refer here.
Fig. 1: Image showing PCB Layout of ESP8266 Module ESP01 Version
|
Schematic overview of the ESP-01. Mind the orientation of the board, this is viewed from the top side. |
Connections for Programming mode:
To get the ESP-01 into the Programming mode, we have to connect it in a special way.
ESP-01 GPIO0 – Pull low by connecting to ground / minus
When you reboot the module it should be in the firmware flash mode!
Now you can upload your code from Arduino IDE by clicking upload button.
Wiring up DHT11 Temp & Humidity sensor to the ESP8266:
The DHT11 is chosen because it is lab calibrated, accurate and stable and its signal output is digital. The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. You can only get new data from it once every 2 seconds, so when using our library, sensor readings can be up to 2 seconds old this is the only real downside of this sensor.
Pin Name Description
1 VDD Power supply 3 – 5.5 V DC
2 DATA Serial data output
3 NC Not connected
4 GND Ground
Wiring:
Connect the sensor to the Arduino as shown below
DHT11 ESP8266
Pin 1 Vcc
Pin 2 GPIO 1 ( And a 10K pull up resistance)
Pin 4 Gnd
Install the DHT11 library and Modify:
Download this zipped file and unzip it under the library directory of the Arduino IDE folder. For example, for my computer’s setup, the directory is
XXXarduino-1.0.1libraries
After copying files across, the directory
XXXarduino-1.0.1librariesDHT
should have the following two files: dht.h and dht.cpp
Load the program DHTServer.ino after you save it onto your computer and open it in the Arduino IDE . Change your SSID and Password of your WiFi Network. (Link is available in the bottom)
Program Execution
Running the program:
-
Compile the program in the IDE
-
Run the program and open the Serial port ( shown below )
Output of the program:
Fig. 2: Screenshot of Arduino Serial Port Showing Connection with Temperature and Humidity Server
Navigate to the IP address Shown in the Serial Monitor and you should see the Web page temperature and Humidity readings.
Fig. 3: Screenshot of Webpage displaying Temperature and Humidity values received from ESP8266 Modem
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.