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
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
------------------------------------------
store app
------------------------------------------
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
----------------------------------------------------------
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
21 Comments
4 years ago
hello when i run the code i receive this error :
Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
sketch_aug28a:2:25: error: ESP8266WiFi.h: No such file or directory
compilation terminated.
exit status 1
ESP8266WiFi.h: No such file or directory
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
any suggestion on how to fix this ??
6 years ago
Hi , I recive value of 716 for temperature and 920 for humidity , what I can do ?
7 years ago
please make one with ds18b20 sensor on a digital pin.!!
7 years ago
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?
7 years ago
Hi Gumby54
I'm sorry but I do not know Acrobotic ESP8266-12E
7 years ago
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
7 years ago
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...
7 years ago
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?
7 years ago
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
7 years ago
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)
7 years ago
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
Reply 7 years ago
thanks
7 years ago
Line an error when compiling.
timer.setInterval(1000L, sendUptime);
Arduino ID1.6.6
please help
7 years ago
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
7 years ago
Slightly modified the code and everything worked.
7 years ago
Hi, MihailA3
Please check that you have library SimpleTimer in the folder
Thanks
7 years ago
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();
}
7 years ago
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.
7 years ago
you have in the folder, multiple versions of the same library
Reply 7 years ago
thanks tohelp