Project Report
Project Report
Automation
Group-2 (2021-2025)
Electronics and Instrumentation Engineering
National Institute of Technology, Agartala
Submitted by: -
Group 2 {
}
Submitted to: -
Home automation is building automation for a home. A home
automation system will monitor and/or control home
attributes such as lighting, climate, entertainment systems, and
appliances. It may also include home security such as access
control and alarm systems.
The phrase smart home refers to home automation devices that
have internet access. Home automation, a broader category,
includes any device that can be monitored or controlled via
wireless radio signals, not just those having internet access.
When connected with the Internet, home sensors and
activation devices are an important constituent of the Internet
of Things ("IoT").
In this Project, we are going to control an LED and a Fan
using HC-05 Bluetooth Sensor, Arduino Uno and an Android
Application.
#define ENA 3
#define in1 4
#define in2 7
#define led 9
int speed1=0;
int speed2=51;
int speed3=102;
int speed4=153;
int speed5=204;
int speed6=255;
int i;
void setup() {
Serial.begin(9600);
pinMode(ENA,OUTPUT);
pinMode(in1,OUTPUT);
pinMode(in2,OUTPUT);
pinMode(led,OUTPUT);
}
void loop()
{
while(Serial.available()>0)
{
i=Serial.parseInt();
if(i>=0&&i<=255){
analogWrite(led,i);
}
else if(i==300){
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(ENA,speed1);
}
else if(i==400){
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(ENA,speed2);
}
else if(i==500){
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(ENA,speed3);
}
else if(i==600){
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(ENA,speed4);
}
else if(i==700){
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(ENA,speed5);
}
else if(i==800){
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(ENA,speed6);
}
Serial.print("Received value: ");
Serial.println(i);
}
}