Devices & Components
Arduino Uno Rev3
ESP8266 ESP-01
Jumper wires (generic)
DHT11 Temperature & Humidity Sensor (3 pins)
Hardware & Tools
Soldering iron (generic)
Software & Tools
Arduino IDE
Blynk
Project description
Code
Arduino Code
arduino
1#define BLYNK_AUTH_TOKEN "Your_Authorization_Token" 2#define BLYNK_PRINT Serial 3#include <ESP8266_Lib.h> 4#include <BlynkSimpleShieldEsp8266.h> 5#include "dht.h" 6#define dht_apin A0 7 8char auth[] = BLYNK_AUTH_TOKEN; 9char ssid[] = "your_SSID"; 10char pass[] = "your_password"; 11dht DHT; 12int T, H; 13 14#define EspSerial Serial1 15#define ESP8266_BAUD 115200 16 17ESP8266 wifi(&EspSerial); 18 19BlynkTimer timer; 20 21void myTimerEvent() 22{ 23 DHT.read11(dht_apin); 24 T = DHT.temperature; 25 H = DHT.humidity; 26 Blynk.virtualWrite(V0, T); 27 Blynk.virtualWrite(V1, H); 28} 29 30void setup() 31{ 32 Serial.begin(115200); 33 EspSerial.begin(ESP8266_BAUD); 34 delay(10); 35 Blynk.begin(auth, wifi, ssid,pass); //Comment this if you're using Local Server 36 //If you have your Local Blynk Server then uncomment this statement --> Blynk.begin(auth, wifi, ssid, pass, "Your_Machine's_IP_Address", 8080); //Use your server's port if this doesn't work 37 38 timer.setInterval(100L, myTimerEvent); 39} 40 41void loop() 42{ 43 Blynk.run(); 44 timer.run(); 45}
Arduino Code
arduino
1#define BLYNK_AUTH_TOKEN "Your_Authorization_Token" 2#define BLYNK_PRINT Serial 3#include <ESP8266_Lib.h> 4#include <BlynkSimpleShieldEsp8266.h> 5#include "dht.h" 6#define dht_apin A0 7 8char auth[] = BLYNK_AUTH_TOKEN; 9char ssid[] = "your_SSID"; 10char pass[] = "your_password"; 11dht DHT; 12int T, H; 13 14#define EspSerial Serial1 15#define ESP8266_BAUD 115200 16 17ESP8266 wifi(&EspSerial); 18 19BlynkTimer timer; 20 21void myTimerEvent() 22{ 23 DHT.read11(dht_apin); 24 T = DHT.temperature; 25 H = DHT.humidity; 26 Blynk.virtualWrite(V0, T); 27 Blynk.virtualWrite(V1, H); 28} 29 30void setup() 31{ 32 Serial.begin(115200); 33 EspSerial.begin(ESP8266_BAUD); 34 delay(10); 35 Blynk.begin(auth, wifi, ssid,pass); //Comment this if you're using Local Server 36 //If you have your Local Blynk Server then uncomment this statement --> Blynk.begin(auth, wifi, ssid, pass, "Your_Machine's_IP_Address", 8080); //Use your server's port if this doesn't work 37 38 timer.setInterval(100L, myTimerEvent); 39} 40 41void loop() 42{ 43 Blynk.run(); 44 timer.run(); 45}
Downloadable files
Connection Diagram Fritzing File
Connection Diagram Fritzing File
Connection Diagram Fritzing File
Connection Diagram Fritzing File
Connection Diagram
Connection Diagram

Comments
Only logged in users can leave comments