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

Contact

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

Blynk GPS Tracker
Intermediate
  • 209
  • 5

Full instructions

Simple GPS tracker using a Particle Photon (or Electron) and an EM406 GPS module with location visible on Blynk app map.

How to Use the Android 'IP Webcam' App with Python / OpenCV
Intermediate
  • 79
  • 2

Protip

Using OpenCV open source library with a IP camera using RasPi3b

Headless Voice Activated Google Assistant on Raspberry Pi
Intermediate
  • 1,117
  • 10

Full instructions

Turn your Raspberry Pi into a Google Assistant.

Arduino101 Bluetooth Interfacing
Intermediate
  • 213
  • 4

Full instructions

Use the Arduino101 Bluetooth wireless interface with the Blynk GUI Library for control of things directly from your phone or tablet !

DIY Vintage Spotify Radio Using A Raspberry Pi
Intermediate
  • 3,509
  • 17

Full instructions

Make your own vintage radio that streams Spotify, Google Play Music, SoundCloud and your own local music!

Pulse Train HAT for Raspberry Pi Mecanum Bot Example
Intermediate
  • 1,442
  • 19

Full instructions

With this example, we show how to use the PTHAT and wireless Xbox controller to control a Mecanum Bot.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Feedback