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

Picture of 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

Picture of Materials

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

DHT11 temperature and humidity sensor

10k resistence

power regulator 3,3v-5v

Step 2: Connections

Picture of Connections

ESP8266

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

Picture of Blynk App

http://www.blynk.cc/

------------------------------------------

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

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

Comments

cosminc16 (author)2016-11-09

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

MihailA3 (author)2015-11-10

Line an error when compiling.

timer.setInterval(1000L, sendUptime);

onorabil made it! (author)MihailA32016-09-02

Move the sendUptime function before the setup function, so the compiler can see it in the current scope.

In case the above doesn't make sense, just compile the attached sketch (replace auth token, ssid and password).

GrzegorzK5 (author)MihailA32015-11-21

I have the same

buraksefa (author)GrzegorzK52016-05-27

Could you fix that problem because I have the same now

h4fod (author)MihailA32016-04-07

Hi MihailA3

I have same problem: 'sendUptime' function not found in current scope when compiling sketch. Did you have a solution to this problem? I too have checked that I have the SimpleTimer library installed. Many thanks.

Akin Yildiz (author)2016-03-15

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

Gumby54 (author)2016-02-25

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?

catoplepa (author)2016-02-19

Hi Gumby54

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

Gumby54 (author)2016-02-19

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

Akin Yildiz (author)2016-02-16

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;
Blynk.email("my_email@example.com", "Subject", "Your message goes here");

so it can actually alarm us "greenhouse too cold" thank you for your time.!!
https://www.instructables.com/id/ESP8266-12-blynk-w...

Vegetish (author)2016-02-16

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?

catoplepa (author)2015-12-12

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

druid001 (author)2015-12-11

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)

catoplepa (author)2015-11-22

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

GrzegorzK5 (author)catoplepa2015-11-22

thanks

GrzegorzK5 (author)2015-11-22

Line an error when compiling.

timer.setInterval(1000L, sendUptime);

Arduino ID1.6.6

please help

catoplepa (author)2015-11-12

hi, MihailA3

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

Thanks

Catoplepa

MihailA3 (author)2015-11-12

Slightly modified the code and everything worked.

catoplepa (author)2015-11-11

Hi, MihailA3

Please check that you have library SimpleTimer in the folder

Thanks

catoplepa (author)2015-10-31

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 //

DHT dht(DHTPIN, DHTTYPE);

// second DHT22

#define DHT1PIN 13 //pin gpio 13 in sensor

#define DHT1TYPE DHT22 //

DHT dht(DHT1PIN, DHT1TYPE);

// 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()

{

Blynk.run();

timer.run();

}

MikeT55 (author)2015-10-30

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.

catoplepa (author)2015-10-18

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

GrzegorzK5 (author)catoplepa2015-10-18

thanks tohelp

catoplepa (author)2015-10-18

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)