In this tutorial we will show how to build WiFi humidity and temperature sensor connected in EasyIoT Cloud. We will use ESP8266, DHT22 and Arduino IDE.

This tutorial is obsolete. Use ESP8266 WiFi DHT22 humidity sensor (EasyIoT Cloud REST API V1) instead.

Contents

1. Introduction

2. Materials

3. EasyIoT Cloud configuration 

4. Program

5. Hardware

6. Buying guide

 

Introduction

Historical temperature and humidity chart.

Humidity and temperature chart

Materials

-ESP8266 WiFi module

ESP8266 ESP-01 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-01 Serial WIFI Wireless Transceiver Module
$2.11
$17.00
ESP8266 ESP-03 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-03 Serial WIFI Wireless Transceiver Module
$2.07
$2.15
ESP8266 ESP-12 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-12 Serial WIFI Wireless Transceiver Module
$2.06
$1.75
ESP8266 ESP-05 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-05 Serial WIFI Wireless Transceiver Module
$1.88
ESP8266 ESP-07 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-07 Serial WIFI Wireless Transceiver Module
$2.18
$1.88
ESP8266 Lua Nodemcu WIFI Network Development BoardESP8266 Lua Nodemcu WIFI Network Development Board
$7.43
$2.65

 

-DHT22 humidity sensor

DHT22 Digital Temperature And Humidity SensorDHT22 Digital Temperature And Humidity Sensor
$2.67
$2.45
 

 

-3.3V power supply (battery or regulator)

5pcs 3.3V regulator module 800mA5pcs 3.3V regulator module 800mA
$1.12
$1.56
2xAA 3V Battery Holder Box Case Wire2xAA 3V Battery Holder Box Case Wire
$0.99
$0.99

 

See buying guide at the end of tutorial for details.

EasyIoT Cloud configuration 

Register to EasyIoT Cloud service. If you do not receive registration email check spam folder. If it's not there contact us and we will activate your account.

Then go to Configure->Modules->Add Module and leave Generic sensor type. Click Senosr.Parameter1.

For first parameter set: Name: Sensor.Parameter1, Description: temperatureUnit:°C or °FEnable DB logging and DBAvgInterval:10. 

DB logging means that we will log values in database, and historical values can be displayed in chart. DB Avg.Interval = 10 means that average value of parameter is inserted in database every 10 minutes. 

Press Save Parameter button. After save you will see InstanceId/ParameterId - remember this value, because you will need it later in program.

Go back and press Add Parameter button. 

For second parameter set: Name: Name:Sensor.Parameter2, Description: humidity, Unit:%, Enable DB logging and DBAvgInterval:10.

Add new parameter and for last parameter set: Name: Settings.Icon1 and Value:humidity.png - this will change module icon. You can see all module icons under Configure->Module Icon.

If everything is configured correctly you should see new module on first age (go back on first page).

DHT22 humidity sensor

 

Program

Program is written in Arduino ESP8266 IDE. See Arduino ESP8266 IDE tutorial how to connect ESP8266 module to computer to upload program. Program is available at our GitHub. You will also need DHT22 library. Be sure to use library from our GitHub, because it's ported to Arduino ESP8266 IDE.

In program change Access Point username and password (AP_SSID     , AP_PASSWORD) and instance id/parameter id for temperature and humidity sensor. InstanceId/Id can be found in configuration. Change EIOT_CLOUD_TEMP_INSTANCE_PARAM_ID and EIOT_CLOUD_HUM_INSTANCE_PARAM_ID and write your InstanceId/Id for temperature and humidity parameter.

Instance id/parameter id:

 

//AP definitions - update this

#define AP_SSID     "xxxxx"

#define AP_PASSWORD "xxxxx"

// EasyIoT Cloud definitions - change EIOT_CLOUD_TEMP_INSTANCE_PARAM_ID and EIOT_CLOUD_HUM_INSTANCE_PARAM_ID

#define EIOT_CLOUD_TEMP_INSTANCE_PARAM_ID    "xxxxx"

#define EIOT_CLOUD_HUM_INSTANCE_PARAM_ID     "xxxxx"

 

If you are using Fahrenheit instead of Celsius use dht.toFahrenheit(temp) function to report temperature in Fahrenheit.

 

In program we will send value to EasyIoT Cloud server. Correct URL to updating value is and it's generated automatically:

http://cloud.iot-playground.com:40404/RestApi/SetParameter/[instance id]/[parameter id]/[value]

 

Hardware

Connection diagram is shown below. Instead of ESP8266-01 you can use different type of ESP8266. For power supply you can use 2 AA batteries or 3.3V regulator (see buying guide).

 

ESP8266 DHT22 connection

 

ESP8266 wifi DHT22 humidity sensor

See more tutorials at ​http://iot-playground.com/build​

Buying guide

To support this site and EasyIoT framework development please buy in our store.

ESP8266 ESP-01 Serial WIFI Wireless Transceiver Module

ESP8266 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-12 Serial WIFI Wireless Transceiver Module

ESP8266 serial Port WIFI wireless module ESP-12

ESP8266 ESP-03 Serial WIFI Wireless Transceiver Module

ESP8266 serial WIFI model ESP-03

ESP8266 ESP-05 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-05 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-07 Serial WIFI Wireless Transceiver Module

ESP8266 with external antenna

ESP8266 Lua Nodemcu WIFI Network Development Board

ESP8266 Lua Nodemcu WIFI Network Development Board

DHT22 Digital Temperature And Humidity Sensor

The DHT22 is a basic, low-cost digital temperature and humidity sensor.

5pcs 3.3V regulator module 800mA

Basic regulator module based on AMS1117.

2xAA 3V Battery Holder Box Case Wire

This 2xAA battery holder puts a nice finishing touch on your battery powered project.

 


Comments   

#6 David 2016-01-12 20:50
Quoting Ants Tamm:
How i connect this to Raspberry Easyiot server ?
Same question !!!
+1 #5 Ants Tamm 2015-12-22 13:50
How i connect this to Raspberry Easyiot server ?
#4 Bob 2015-12-01 16:39
Almost working...Data shows in home page under module selection but not on graph...Turned period down to 1 minute on both params to test and nothing
#3 Super User 2015-10-24 12:52
Quoting Todd McIntyre:
:D I did it. it's working.. I just need to wire up the DHT22 to it now.


Yes, it's easy, EasyIoT.
#2 Todd McIntyre 2015-10-23 05:31
:D I did it. it's working.. I just need to wire up the DHT22 to it now.
#1 Todd McIntyre 2015-10-20 04:47
WOW, I know what I'm doing this weekend... How long will the batterys last with this circuit?

You have no rights to post comments

Forum latest

  • No posts to display.