Temperature & Humidity Monitoring Using the ESP-01 & DHT and the AskSensors Cloud

18,095

15

9

Introduction: Temperature & Humidity Monitoring Using the ESP-01 & DHT and the AskSensors Cloud

About: IoT Maker, co-founder of asksensors.com

In this instructable we are going to learn how to monitor the temperature and the humidity measurements using the IOT-MCU/ESP-01-DHT11 board and the AskSensors IoT Platform.

I'm choosing the IOT-MCU ESP-01-DHT11 module for this application because it's ready-to-use and save development time. However, if you are looking for home automation systems, I suggest the ESP8266 nodeMCU tested in my previous instructable, which provides more input/outpout, large memory and additional features.

ESP-01 OVERVIEW:

  • The ESP8266 is a low-cost WiFi module with full TCP/IP stack.
  • The ESP8266 series are produced by Espressif Systems.
  • The ESP-01 is a small size black colored module with 1M memory.
  • Note that the ESP-01 module requires only 3.3 volts to power up.

IOT-MCU ESP-01-DHT OVERVIEW:

This module uses the ESP-01 or the ESP-01S as the master control, and the DHT11 allowing to measure the in the scales from 0 to 50 degrees Celsius and the humidity of the air in the ranges from 20 to 90%.

As follows a summary of the main characteristics:

  • Controller: ESP-01 / ESP-01S (To buy separately)
  • Temperature and humidity sensor: DHT11
  • Operating voltage: DC 3.7V-12V (It supports 3.7V lithium battery power supply)
  • Measuring range: 20-90% RH 0-50 ℃,
  • Measurement accuracy: Temperature ± 2 ℃, Humidity ± 5% RH.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Materials

These are the components that you will need for this tutorial:

  1. ESP-01 or ESP-01S
  2. USB Serial converter to program your ESP-01.

  3. IOT-MCU/ ESP-01-DHT11

  4. External 3.7V to 5V DC Power supply.

Step 2: Environment Setup

First, You need install the ESP8266 core to the arduino IDE. Skip this step if you have the ESP8266 already installed.

  1. Start the Arduino IDE version 1.6.4 or higher
  2. Go to 'File > Preferences'
  3. Add the link below to Additional Boards Manager URLs:

    'http://arduino.esp8266.com/stable/package_esp8266com_index.json'

  4. Go to 'Tools > Boards > Boards Manager'
  5. Search for ESP8266, hit the Install button. Wait until the installation is complete.

Step 3: Create Your Sensor Modules at AskSensors

  1. Get an AskSensors account at asksensors.com
  2. Create a new Sensor with two modules:
  • Module 1: Temperature
  • Module 2: Humidity

3. Get your Api Key In generated by AskSensors.

You can find tutorials and instructables showing how to get started with the AskSensors IoT platform and setting sensors to collect data using the web browser or the ESP8266 nodeMCU.

Step 4: Coding

  1. Install the Adafruit DHT Library.
  2. Get this example sketch from the AskSensors github page.
  3. Modify the Wi-Fi SSID and password, the Api Key In and, if needed, the delay between two successive measurements:

const char* wifi_ssid = "..........";             // SSID 
const char* wifi_password = ".........";         // WIFI 
const char* apiKeyIn = ".........";      // API KEY IN
delay(25000);     // delay in msec

Now the code is all set. Let's move to the next step to run the software.

Step 5: Programming the ESP-01

    Upload the code using Arduino IDE:

  1. Install the USB serial adapter driver.
  2. Connect the GPIO_0 to the ground in order to enable the programming mode of ESP8266. There are some USB serial adapter that come with programming switch on it so during upload you have to press the switch. in my case,I have no switch, so I soldered a jumper between the GPIO_0 and the ground of the USB serial adapter.
  3. Insert the ESP-01 into the USB serial adapter as shown in the first image(1).
  4. Connect the serial adapter to your computer USB port.
  5. Open Arduino IDE . You should get 'Port' enabled. if not, select the right port shown for your USB serial adapter (On Arduino software click Tools >> Port).
  6. Select 'Generic ESP8266 Module' as your board (Go to Tools >> Board >> Generic ESP8266 Module )
  7. Hit the upload button.wait until the upload is complete.

Before powering up the board:

  1. Remove the ESP-01 from the USB serial adapter.
  2. Be sure to remove also the connection between the GPIO_0and the ground to let the ESP-01 starts its firmware normally.
  3. Insert the ESP-01 into the IOT-MCU connector as shown in the second image(2). Now we are ready to power up the board!

Got Issues ?

Have you get any issues? Please see the next step.

Step 6: Throubleshooting

Programming the ESP-01 is a little bit hard for beginners. These are some possible errors:

  • GPIO_0 is not grounded during the Reset
  • The USB Connection with PC is not good.
  • The COM port is not correct. If you have more than one port showing, just disconnect the USB serial adapter from the USB port and see what port disappeared. Insert the serial adapter again and verify the new COM port added. Select this port number manually.
  • You are not selecting the right Board(Generic ESP8266 Module).

If you are still having issues, please refer to this instructable.

Step 7: Results

Power up the board, the ESP8266 will do the following sequence:

  1. Initialization
  2. Connect to the WiFi network
  3. Read temperature and humidity from the DHT11
  4. Connect and send the measurements to the AskSensors server
  5. Repeat the two previous steps periodically.

Login to the AskSensors web site and show graphs of the temperature and humidity modules. You will get your measurements plotted in real time. You can also export the collected data in CSV files.

Step 8: Well Done!

You have successfully completed our tutorial about monitoring the temperature and humidity with ESP8266 and IOT-MCU board connected to the AskSensors cloud.
See more instructables here.

1 Person Made This Project!

Recommendations

  • Trash to Treasure Contest

    Trash to Treasure Contest
  • Raspberry Pi Contest 2020

    Raspberry Pi Contest 2020
  • Wearables Contest

    Wearables Contest

9 Discussions

0
stamy1
stamy1

Answer 1 year ago

REMOVE FROM THE URL ANDRESS THE QUOTES " ' "

0
askSensors
askSensors

Reply 1 year ago

Great instructable,
Thanks!

0
RR_TV
RR_TV

1 year ago

Then how do you troubleshoot the code? I've followed all the steps but for some reason no data is coming in to the AskSensors platform. Any suggestions?

0
askSensors
askSensors

Reply 1 year ago

Hello,
STEP1:
First, You need to confirm that you are able to send data to your sensor using the appropriate API KEY IN. You can do it from the browser as shown in this tutorial (step 3).
https://www.instructables.com/id/Send-Data-to-AskS...

STEP2:
If STEP1 Ok, so try to send dummy data to your sensor using only ESP8266 connected to the serial terminal (which allows you to see if your ESP8266 is connecting to WiFi and sending data to the AskSensors server. use the following code:
https://github.com/asksensors/AskSensors-ESP8266-A...

STEP3: Connect your DHT sensor to your ESP8266. To be sure, you can start with testing your DHT sensor separately: ESP + plugged on the serial converter and DHT sensor connected to the ESP using wires. use the adafruit library:
https://github.com/asksensors/DHT-sensor-library

STEP4: Build all. use this example sketch: https://github.com/asksensors/AskSensors-ESP8266-D...

Hope it helps :-)

0
RR_TV
RR_TV

Reply 1 year ago

This is great, thank you very much for taking the time to help!

1
RR_TV
RR_TV

Question 1 year ago

On the last step how do you power up the board connected with the IOT-MCU and still connect it to the serial monitor? I don't understand that part.

0
askSensors
askSensors

Reply 1 year ago

Hello,
Yes you are right, At the final step, the IOT-MCU board does not allow USB connection.