Sharifdeen Ashshak
Published

4 different system in one home (prototype)

Here I have made prototype of smart home. In this Smart home project I have used Arduino and Node Mcu to control the Hardware parts.

IntermediateFull instructions provided1,485
4 different system in one home (prototype)

Things used in this project

Story

Read more

Schematics

Arduino Circuit

Code

Arduino_Code

C/C++
/**************************************************************
 *for more project:
 *  website: www.blackkeyhole.com
 *  Youtube:Blackkeyhole
 *  Facebook page:Blackkeyhole
 *  Instagram:_ashshak_ahk
 **************************************************************/
#include <ESP8266WiFi.h>

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <BlynkSimpleEsp8266.h>
char auth[] = "65d9cf145e7a442291c612f24e1df68b";

/* WiFi credentials */
char ssid[] = "ROVAI TIMECAP";
char pass[] = "mjr747@1";

/* HC-SR501 Motion Detector */
#define ledPin D2 
#define pirPin D1 // Input for HC-S501
int pirValue; // Place to store read PIR Value
int motionDetected = 0;





void setup()
{
  Serial.begin(115200);
  delay(10);
  Blynk.begin(auth, ssid, pass);
  pinMode(ledPin, OUTPUT);
  pinMode(pirPin, INPUT);
  digitalWrite(ledPin, LOW);
  
}

void loop()
{
  getPirValue();
  Blynk.run();
  
}

/***************************************************
 * Get PIR data
 **************************************************/
void getPirValue(void)
{
  pirValue = digitalRead(pirPin);
  if (pirValue) 
  { 
    Serial.println("==> Motion detected");
    Blynk.notify("T==> Motion detected");  
  }
  
  digitalWrite(ledPin, pirValue);
}

Nodemcu code

C/C++
/**************************************************************
 *for more project:
 *  website: www.blackkeyhole.com
 *  Youtube:Blackkeyhole
 *  Facebook page:Blackkeyhole
 *  Instagram:_ashshak_ahk
 **************************************************************/
#include <ESP8266WiFi.h>

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <BlynkSimpleEsp8266.h>
char auth[] = "AlAVqXZvwRfRkUqO2fXIUB7RjDqHJy50"; //enter your auth sent by blynk

/* WiFi credentials */
char ssid[] = "ZTE WIFI";
char pass[] = "kl2229834";

/* HC-SR501 Motion Detector */
int ledPin= D2; 
int pirPin=D1; // Input for HC-S501
int pirValue; // Place to store read PIR Value
int motionDetected = 0;

void setup()
{
  Serial.begin(9600);
  delay(10);
  Blynk.begin(auth, ssid, pass);
  pinMode(ledPin, OUTPUT);
  pinMode(pirPin, INPUT);
  digitalWrite(ledPin, LOW);
}

void loop()
{
  getPirValue();
  delay(100);
  Blynk.run();
}

/***************************************************
 * Get PIR data
 **************************************************/
void getPirValue(void)
{
  pirValue = digitalRead(pirPin);
  if (pirValue==1) 
  { 
    Serial.println("==> Motion detected");
    Blynk.notify("T==> Motion detected");  
  }
  
  digitalWrite(ledPin, pirValue);

}

Credits

Sharifdeen Ashshak

Sharifdeen Ashshak

34 projects • 39 followers
Ai, IoT, embedded enthusiast

Comments