ESP8266-12 Blynk Wireless Temperature, Humidity DHT22 Sensor





Introduction: ESP8266-12 Blynk Wireless Temperature, Humidity DHT22 Sensor

in this project using a esp8266, to show the temperature and humidity DHT22 sensor on your smartphone or tablet.

DHT22 sensor is much more accurate than DHT11 but is also more expensive.

but if you only can use the DHT11

ESP8266-12 blynk wireless temperature e humidity DHT 11 sensor

Step 1: Materials

ESP8266-12 (esp8266-7, ...... , esp8266-12e)

DHT11 temperature and humidity sensor

10k resistence

power regulator 3,3v-5v

Step 2: Connections


VCC +3,3v

CH-PD +3.3v

gpio12 ---- pin2 (DHT22)

GND ground GPIO5 ground


DHT22 sensor
pin 1 +3,3v

pin 2 output .---- gpoi12 (ESP8266-12)

pin4 ground


10k resistence

pin 1 (DHT22) ---- 10k resistence---- pin 2 (DHT22)

Step 3: Blynk App


store app

Blynk Apple Store

Blynk Google Play store


configure blynk

create new project ( use hardware model esp8266 )

generate AUTH TOKEN

send E-mail TOKEN ( copy TOKEN in the esp8266 sketch)

in the app Blynk use Value Display widget or Gauge widget

Step 4: Sketch


blynk library

SimpleTimer library

DHT library


to programming the ESP8266-12, I use ide arduino 1.6.5 and CP2102 3.3V USB To UART Serial Interface Module Adaptor ( do not connect the power of the CP2102 to esp8266-12).


ESP8266 sketch
change the sketch in the following lines with your data

char auth[] = "xxxxxxxxxx"; //insert here your token generated by Blynk

Blynk.begin(auth, "ssid", "password!"); //insert here your SSID and password

Step 5: Thanks

Thanks by catoplepa



  • Oil Contest

    Oil Contest
  • Creative Misuse Contest

    Creative Misuse Contest
  • Clocks Contest

    Clocks Contest

20 Discussions

Hi , I recive value of 716 for temperature and 920 for humidity , what I can do ?

please make one with ds18b20 sensor on a digital pin.!!

Hi catoplepa,

I figured out the error. I did not realize the SSID was case sensitive, that corrected I managed to get connected. Now my issue is with the actual values; I get -3276.7 for temp, 6553.5 for Hum.. I am using both libraries and the sketch as is! Also using a dht22 3 pins breakout board. Any idea where I made a mistake?

Hi Gumby54

I'm sorry but I do not know Acrobotic ESP8266-12E

Cant get it to work. I am using Acrobotic ESP8266-12E gpio12 is on pin D6 on this dev board. What should I use as pin number in the sketch? It seems to load on the board but get nothing on my phone. The ide shows this at the bottom:

ploading 224880 bytes from /var/folders/0t/_yjn0r253bn11hlrdxszz7_w0000gs/T/build6298255724161252052.tmp/blynk_esp8266_dht22_instructable.cpp.bin to flash at 0x00000000


Any suggestions would be appreciated

how can you also display data on arduino IDE serial monitor and set too high/low values and based on these values send out an email;"", "Subject", "Your message goes here");

so it can actually alarm us "greenhouse too cold" thank you for your time.!!

This works, but when i connect to blynk it seems that the connection keeps jumping out, then back in again. The gauge shows the right values, then goes to blank (--), then back to the right value, over and over again. Might there be an issue with the code that causes a continuous disconnect?

Hi druid001

There are several ways to program the esp8266, I preferred to specify the way in which I have uploaded the sketch.

I also specify not to use the USB to power the esp8266

First time doing something like this. I don't understand the comment "to programming the ESP8266-12, I use ide arduino 1.6.5 and CP2102 3.3V USB To UART Serial Interface Module Adaptor ( do not connect the power of the CP2102 to esp8266-12)

Hi Grzegorzk5

I use Arduino IDE 1.6.5 and it works fine, but if I use Arduino IDE 1.6.6 to me gives me the same error.

It could be a problem of libraries

1 reply

Line an error when compiling.

timer.setInterval(1000L, sendUptime);

Arduino ID1.6.6

please help

hi, MihailA3

you have found a mistake in my sketch? or have you copied the sketch wrong? what kind of change you made



Slightly modified the code and everything worked.

Hi, MihailA3

Please check that you have library SimpleTimer in the folder


Hi, Mihe T55

yes is possible...try to test these sketch

#define BLYNK_PRINT Serial //

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

#include <SimpleTimer.h>

#include <DHT.h>

// first DHT22

#define DHTPIN 12 //pin gpio 12 in sensor

#define DHTTYPE DHT22 //


// second DHT22

#define DHT1PIN 13 //pin gpio 13 in sensor

#define DHT1TYPE DHT22 //


// You should get Auth Token in the Blynk App.

// Go to the Project Settings (nut icon).

char auth[] = "xxxxxxxxxx"; //

SimpleTimer timer;

void setup()


Serial.begin(9600); //

Blynk.begin(auth, "ssid", "password!"); //

// Setup a function to be called every second

timer.setInterval(1000L, sendUptime);


void sendUptime()


// You can send any value at any time.

// Please don't send more that 10 values per second.

//Read the Temp and Humidity from DHT

// first DHT22

float h = dht.readHumidity();

float t = dht.readTemperature();

Blynk.virtualWrite(10, t); // virtual pin 10

Blynk.virtualWrite(11, h); // virtual pin 11

// second DTH22

float h1 = dht.readHumidity();

float t1 = dht.readTemperature();

Blynk.virtualWrite(12, t1); // virtual pin 12

Blynk.virtualWrite(13, h1); // virtual pin 13


void loop()



hello, is it possible to combine two diferents circuits and comunite via phone? for example, I have two rooms and I want to check both temperatures, so I can chose circuit one for my room and see the temperature, if I want to check my brothers room it will be circuit 2.

you have in the folder, multiple versions of the same library

1 reply

Hi, GrzegorzK5

the sketch is very simple, you try to verify links or virtualpin on the blynk app

in the IDE arduino i use 4M (3M SPIFFS)