
Hi everyone! Here I have documented, how to make a prototype of an IoT-based smart home. In this project, I have included the functions that are Automatic door open system, smart parking system, IoT based security system and IoT based fan control system. but you can add more functions here. I have only added four functions here. So lets now dive into the each functions here.
Automatic Door open system
Here I have used Arduino, Servo motor, Ultrasonic sensor.(components are given bellow in my article). when anyone puts their hand in front of an ultrasonic sensor,, the servo motor will turn a pre-set angle. The door, connected along with the servo motor also turns the pre-set position.
Smart Parking System
Ultrasonic sensor and buzzer have been used to make noise, when any of your vehicle goes to crash with wall. but actually buzzer will make noise when any object will detect in front of the Sensor.
These two have been controlled by Arduino.
Now let's get into IoT.
IoT-based Motion Detector Security System
In my old post, I had documented that how to made IOT based motion detector security system. You can check it out for more details. So here I have included that system. When you are going to leave your home you can turn it on. Otherwise, it will send notification frequently to your smartphone, while you are in the room.
Control Home Appliances using a mobile phone or your voice
You can control your home appliances wherever you are. You can notify the particular appliances will to turn on or off. So you can manage the waste flow of current. you can check out my "Control your home appliances using WIFI or Mobile network" which has provided full instruction to make Blynk connection between Node MCU.
So here, I have only added DC fan to demonstrate to you. If you want to add Voice control features to this prototype. You want to make IFTT Intermediate connection between google assistant and Node MCU. In one of my previous tutorials. I had shown you how to control home appliances using your voice. If you want to add a voice control feature to your project you can check it out that.
Components
1. Arduino UNO
2. Node mcu
3. Ultra Sonic sensor- 02
4. PIR motion detector
5.5v Relay module
6.Buzzer
7. LED
8. Power Bank
9. 9v DC battery
10. 12V DC fan
11.Servo motor
12. Jumper wires
Node MCU Connection
NODE MCU---------- PIR
vv ---------- VCC
GND --------- GND
D1 --------- IN1
NODE MCU---------- LED
GND --------- Cathode
D2 --------- Anode
NODE MCU---------- Relay
GND --------- GND
VV --------- VCC
D3 --------- IN1
I have used rigifoam to make the setup of this prototype.
/**************************************************************
*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[] = "[email protected]";
/* 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);
}
