Hello everyone,
Thank You for viewing our project Home Automation System .
This system is designed to control the speed of the fan to cool a light a bulb.
We decided to build this project because today’s light bulbs tend to heat and this can cause blast in the house. Which could turn out to be a huge fire accident! So, we have made an automation system which could be controlled by your smartphone. This will cool out the bulb and the speed also you can control by just sitting and do the work.
There are 5 speed in the fan which can be controlled by the ‘volume up and down ‘buttons of the IR remote. The fan can be turned on by the ‘2’ button of the IR remote. The bulb can be turned on and off by the ‘1’ button of the IR remote. All the button you press will be displayed in the LCD. So, you can say this is a user friendly project.
I am Ishaan. I enjoy building and creating and my interests range from quantum mechanics to aerospace. I am an avid course taker and constantly is having at least one course, and I have also participated in many sports and other co-curricular activities.
In this image all the components with the connections are given
#
include
<IRremote.h>
#
include
<LiquidCrystal.h>
const int
RECV_PIN =
8
;
IRrecv irrecv
(
RECV_PIN )
;
decode_results results ;
LiquidCrystal
lcd
(
7
,
6
,
5
,
4
,
3
,
2
)
;
int
x =
0
;
int
y =
0
;
int
z =
0
;
void
setup
(
)
{
pinMode
(
12
,
OUTPUT
)
;
pinMode
(
10
,
OUTPUT
)
;
pinMode
(
9
,
OUTPUT
)
;
irrecv .
enableIRIn
(
)
;
Serial
.
begin
(
9600
)
;
lcd .
begin
(
16
,
2
)
;
lcd .
setCursor
(
0
,
0
)
;
lcd .
print
(
"Home Automation"
)
;
}
void
loop
(
)
{
if
(
irrecv .
decode
(
&
results )
)
{
lcd .
clear
(
)
;
lcd .
setCursor
(
0
,
0
)
;
lcd .
print
(
"Bulb Fan Speed"
)
;
if
(
results .
value ==
0xFD08F7
)
{
x ++
;
if
(
x %
2
==
1
)
{
digitalWrite
(
12
,
HIGH
)
;
lcd .
setCursor
(
0
,
2
)
;
lcd .
print
(
"ON"
)
;
}
else
{
digitalWrite
(
12
,
LOW
)
;
lcd .
setCursor
(
0
,
2
)
;
lcd .
print
(
"OFF"
)
;
}
}
if
(
results .
value ==
0xFD8877
)
{
y ++
;
if
(
y %
2
==
1
)
{
digitalWrite
(
9
,
HIGH
)
;
lcd .
setCursor
(
5
,
2
)
;
lcd .
print
(
"ON"
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
else
{
digitalWrite
(
9
,
LOW
)
;
lcd .
setCursor
(
5
,
2
)
;
lcd .
print
(
"OFF"
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
}
if
(
results .
value ==
0xFD807F
&&
z >=
0
&&
z <
6
)
{
z ++
;
if
(
z ==
1
)
{
analogWrite
(
10
,
51
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
if
(
z ==
2
)
{
analogWrite
(
10
,
102
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
if
(
z ==
3
)
{
analogWrite
(
10
,
153
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
if
(
z ==
4
)
{
analogWrite
(
10
,
204
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
if
(
z ==
5
)
{
analogWrite
(
10
,
255
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
}
if
(
results .
value ==
0xFD906F
&&
z >
0
&&
z <=
6
)
{
z --
;
if
(
z ==
1
)
{
analogWrite
(
10
,
51
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
if
(
z ==
2
)
{
analogWrite
(
10
,
102
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
if
(
z ==
3
)
{
analogWrite
(
10
,
153
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
if
(
z ==
4
)
{
analogWrite
(
10
,
204
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
if
(
z ==
5
)
{
analogWrite
(
10
,
255
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
if
(
z ==
0
)
{
analogWrite
(
10
,
0
)
;
lcd .
setCursor
(
9
,
2
)
;
lcd .
print
(
z )
;
}
}
Serial
.
println
(
results .
value ,
HEX )
;
Serial
.
print
(
x )
;
Serial
.
print
(
y )
;
Serial
.
print
(
z )
;
irrecv .
resume
(
)
;
}
}
© 2025 Mechatron Robotics. All Rights Reserved