Power Control using Blynk

Hello all,

Here is a short project to show the flexibility of Blynk. Here I control the fun using the ESP8266, and some Blynk code.

I use the Omron TRIAC part #: Omron G3NA-220B-DC5-24 , I like this TRIAC because is Arduino Friendly, the ESP8266 is powered by 3.2 volts, still able to trigger ON the TRIAC gate. that is it. Just having fun :slight_smile:

From here, you can take it to the next level. How about a Temperature/Humidity sensor? If the temp is 85 degrees, turn on the A/C, if the R% humidity is 90, outch! That is humid! Turn on the dehumidifier, etc,etc.

Here is a youtube video:
https://www.youtube.com/watch?v=oA6lpMWUJ90

/*  
*********************************************************************************************
          Power Control -  Having fun with Blynk
          Author: Alex Rodriguez 
          Reviewed: April., 3, 2016 
 
********************************************************************************************
*/  

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "xxxxxxxxxxxxxxxxxxxx";
// Hardware variables 
#define TRIAC 4

void setup()
{
  pinMode(TRIAC, OUTPUT);          
  Serial.begin(115200);
  Blynk.begin(auth, "SSID", "PASSWORD"); 
  
}

BLYNK_WRITE(V7) 
{
  if (param.asInt() == 0) 
  {   
  digitalWrite(TRIAC, LOW); 
  } 
  else 
  {
  digitalWrite(TRIAC, HIGH); 
  }
}

// ==============( Void Loop  ) ==================================

void loop()
{
  Blynk.run();
   
}
1 Like