Posts

Showing posts from December, 2022

Blynk IOT project with ESP8266 || IFTTT || Google Assistant || Webhooks||

Image
 /*************************************************************   Download latest Blynk library here:     https://github.com/blynkkk/blynk-library/releases/latest   Blynk is a platform with iOS and Android apps to control   Arduino, Raspberry Pi and the likes over the Internet.   You can easily build graphic interfaces for all your   projects by simply dragging and dropping widgets.     Downloads, docs, tutorials: http://www.blynk.cc     Sketch generator:           http://examples.blynk.cc     Blynk community:            http://community.blynk.cc     Follow us:                  http://www.fb.com/blynkapp                                 http://twitter.com/blynk_app   Blynk library is licensed under MIT license   This ...

ESP8266 whatsapp IOT project with 2 relays

Image
 //#include <WiFi.h> #include <ESP8266WiFi.h> #include <ThingESP.h> ThingESP8266 thing("surya33319", "suryaproject", "automation"); int LIGHT = D2; int FAN = D3; unsigned long previousMillis = 0;   //G.S Entertaiments const long INTERVAL = 6000;   void setup() {   Serial.begin(115200);   pinMode(LIGHT, OUTPUT);   Serial.begin(115200);   pinMode(FAN, OUTPUT);   thing.SetWiFi("surya internet", "surya33333");   thing.initDevice(); } String HandleResponse(String query) {  if (query == "light on") {     digitalWrite(LIGHT, 1);     return "Done: Light Turned ON";   }   else if (query == "light off") {     digitalWrite(LIGHT, 0);     return "Done: Light Turned OFF";   }   else if (query == "light status")     return digitalRead(LIGHT) ? "LIGHT is OFF" : "LIGHT is ON";   else return "Your query was invalid..";   if (query == "fan on") { ...

Arduino clap. switch to LIGHT...

Image
// Clap Light Switch // G.S Entertainments // https://www.youtube.com/channel/UCqP5Jo6e137TOrKd5t0hzjA int mic = 2;       // microphone module int indicLED = 13; // indication pin int lightPin = 9;  // relay (lights control) bool lightState = true; bool ignoreInt = false; bool ClapDetected = false; uint32_t ClapDetetedTime [3] {}; void setup() {   Serial.begin(115200);   pinMode(indicLED, OUTPUT);       pinMode(lightPin, OUTPUT);     digitalWrite(lightPin, lightState);   attachInterrupt(digitalPinToInterrupt(mic), ISR_ClapDetected, FALLING); } void loop() { delay(2); if(millis() - ClapDetetedTime[2] &gt;= 10) {   digitalWrite(indicLED, LOW); } if(millis() - ClapDetetedTime[2] &lt; 10 &amp;&amp; millis() - ClapDetetedTime[1] &lt; 800 &amp;&amp; ClapDetected &amp;&amp; ClapDetetedTime[1] - ClapDetetedTime[0]&gt;=800)   {     Serial.println("double clap det...