Things used in this project

Code

Blynk Bridge - Communication between ESP8266Arduino
/**************************************************************
   Blynk Bridge - Communication between ESP8266
   Sketch code for the receiver module (module which is controlled)
   www.geekstips.com
 **************************************************************/
 
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
 
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx";
 
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXXXXXXX";
char pass[] = "********";
 
// This code will update the virtual port 5
BLYNK_WRITE(V5) {
  int pinData = param.asInt();
}
 
void setup(){
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
}
 
void loop(){
  Blynk.run();
}
Blynk Bridge - Communication between ESP8266Arduino
/**************************************************************
   Blynk Bridge - Communication between ESP8266
   Sketch code for the master module (module which will command others)
   www.geekstips.com
 **************************************************************/
#define BLYNK_PRINT Serial
 
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <DHT.h>
 
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx";
 
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXXXXXXXXXXXX";
char pass[] = "*************";
 
#define DHTPIN 2 // What digital pin we're connected to
 
//#define DHTTYPE DHT11   // DHT 11
  #define DHTTYPE DHT22   // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21   // DHT 21, AM2301
 
DHT dht(DHTPIN, DHTTYPE);
SimpleTimer timer;
WidgetBridge bridge1(V1);
 
BLYNK_CONNECTED() {
  // Place the AuthToken of the second hardware here
  bridge1.setAuthToken("tttttttttttttttttttttttttttttttt"); 
}
 
void sendSensor(){
  // get readings from the DHT22 sensor
  float h = dht.readHumidity();
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
  
  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
 
  // Send command to the second ESP
  // WHEN Temperature IS OVER 28 C
  // in order to open the 220V Relay
  // Also update the VIRTUAL port 5 
  // on the second ESP
  if(t > 28){
     bridge1.digitalWrite(2, 1000);
     bridge1.virtualWrite(V5, 1000); 
  }else{
     bridge1.digitalWrite(2, 0);
     bridge1.virtualWrite(V5, 0); 
  }
 
  // Send temperature and humidity to Blynk App
  // on VIRTUAL ports 5 and 6 in order to 
  // display on Gauge Widget
  Blynk.virtualWrite(V5, h);
  Blynk.virtualWrite(V6, t);
}
 
void setup(){
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  dht.begin();
 
  timer.setInterval(1000L, sendSensor);
}
 
void loop(){
  Blynk.run();
  timer.run();
}
Blynk Bridge - Communication between ESP8266Arduino
WidgetBridge bridge1(V1);
 
BLYNK_CONNECTED() {
  // Place the AuthToken of the second hardware here
  bridge1.setAuthToken("***********************"); 
}
Blynk Bridge - communication between ESP8266Arduino
if(t > 28){
     bridge1.digitalWrite(2, 1000);
     bridge1.virtualWrite(V5, 1000); 
}else{
     bridge1.digitalWrite(2, 0);
     bridge1.virtualWrite(V5, 0); 
}
Github
https://github.com/blynkkk/blynk-library/blob/master/examples/Widgets/Bridge/Bridge.ino

Credits

Photo
GeeksTips.com

Technology tutorials, reviews and discussions

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Solar Smart Greenhouse Using Vertical Aquaponic Towers
Intermediate
  • 3,034
  • 43

Work in progress

Feed your family with 22 sqm greenhousing by combining permaculture, aquaponic vertical towers and IoT.

Measure wind speed with Eltako windsensor and Win10 IoT Core
Intermediate
  • 591
  • 7

Full instructions

This Project will help you track wind Speeds using Windows 10 IoT Core and the Eltako Windsensor.

Raspberry Pi Facial Recognition
Intermediate
  • 5,323
  • 42

Work in progress

So you want to control entry to your secret lair, huh? This project will allow you to use facial recognition using a Pi and AWS.

Avoid Injuries with Smart Backpack
Intermediate
  • 1,044
  • 13

Full instructions

Smart Backpack helps you to avoid injuries caused by backpacks by alerting you about improper uses.

Aquariumatic
Intermediate
  • 8,679
  • 17

Work in progress

Aquarium monitor with automation, Web GUI & IOT. Daisychain units can control multiple tanks all from the one master unit.

PiGlass
Intermediate
  • 2,777
  • 21

Full instructions

A device that can measure environmental conditions and relay to the user; in glasses form.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback