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

Lighting control
Intermediate
  • 201
  • 4

Lighting control using the Cayenne Dashboard button and wall mount button.

Sense and Display with Android Things and Kotlin
Intermediate
  • 181
  • 3

Full instructions

This project shows how to get started to read I2C temperature sensor and display the reading to OLED display using Android Things and Kotlin

Smart Conductive 'On Air' Sign!
Intermediate
  • 764
  • 12

Full instructions

Raspberry Pi + Bare Conductive Paint + Pi Cap + RGB LEDs = AWESOME CONDUCTIVE SIGN!

Wireless Sensor Node
Intermediate
  • 286
  • 4

Work in progress

This project is a compact wireless sensor node that connects directly to a smart phone or tablet to display data from connected sensors.

Trigger Google Assistant on Pi Using Ultrasonic HC-SR04
Intermediate
  • 626
  • 4

Trigger Google Assistant SDK on RPi using ultrasonic sensor HC-SR04 on Raspberry Pi.

CNC Controller in Python
Intermediate
  • 962
  • 10

Full instructions

First ever CNC machine controller implementation in pure Python.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login