0% found this document useful (0 votes)
6 views

Sample Mini Project Report

The project report titled 'Controlling Appliances Using IR Remote' discusses the development of a low-cost system for controlling up to 15 devices via an IR remote, operating effectively within a range of 20 to 30 meters. It explores wireless sensor networks (WSNs), their topologies, applications, and security issues, emphasizing the importance of energy efficiency and reliability in network design. The report also outlines the necessary hardware and software requirements, implementation details, and testing results for the proposed system.

Uploaded by

RAJ KAMDAR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Sample Mini Project Report

The project report titled 'Controlling Appliances Using IR Remote' discusses the development of a low-cost system for controlling up to 15 devices via an IR remote, operating effectively within a range of 20 to 30 meters. It explores wireless sensor networks (WSNs), their topologies, applications, and security issues, emphasizing the importance of energy efficiency and reliability in network design. The report also outlines the necessary hardware and software requirements, implementation details, and testing results for the proposed system.

Uploaded by

RAJ KAMDAR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

CONTROLLING APPLIANCES USING IR REMOTE

STUDENT NAME CLASS ROLL NO.

NEIL MEHTA TE-6-21

KRUSHAV SHAH TE-6-34

VRUSHABH SHAH TE-6-39

UNDER THE GUIDANCE OF


MR. CHETAN MAHAJAN
MR. SANTOSH RATHOD

Department of Information Technology


Shah & Anchor Kutchhi Engineering College, Mumbai
2020-2021

1|Page
Approval for Project Report for SNL Lab semester VI
This project report entitled CONTROLLING APPLIANCES USING IR REMOTE
by Neil Mehta, Krushav Shah and Vrushabh Shah is approved for semester VI in
partial fulfillment of the requirement for the Sensor Network Lab of T.E.
Engineering.

Examiners

1.__________________________

2.__________________________

Guide

1.__________________________

2 .__________________________

2|Page
Table of contents Page No.
Abstract 4
List of Figures 5
Introduction 7
i. What is WSN 8
ii. Characteristics of WSN 8
iii. Network Topology 8
iv. Application of WSN 15
v. Security of WSN 15
vi. WSN Design methodology 16
Review of literature 18
Problem statement 20
Objectives 21
Project Flow/Details 22
Circuit Diagram 23
Requirement of Hardware and 24
Software
Implementation 33
Testing 42
Result 47
Conclusion 48
References 49

3|Page
ABSTRACT

The system is devoted to basic appliances, technologies such as Wi-Fi, Bluetooth and IR remotes.
Today, homeowners with big homes and cable problems are discovering wireless communications
as something new. Solutions for building and expanding your home automation system.
Therefore, RF equipment controls are widely used nowadays. Our approach is to create a low-cost
system most efficient for controlling appliances between the boundaries. We created a system
wherein the user can turn on/off 15 devices from remote controller. It works for up to 20 to 30
meters. Enhancement of controller mode is the inescapable pattern of advancement of shrewd
apparatus. In this system we planned and built up a controller arrangement of shrewd apparatus
dependent on remote sensor organization, understanding the expansion of controller method of
shrewd apparatus. The innovation can be utilized to shape and control organization of home
devices inside the house.

4|Page
LIST OF FIGURES

1. Wireless Network
7
2. Bus topology
10
3. Tree topology
11
4. Star topology
11
5. Ring topology
12
6. Mesh topology
13
7. Circular topology
13
8. Grid topology
14
9. Block Diagram
23
10. Circuit Diagram
24
11. Potentiometer
25
12. DC Motor
25
13. Arduino Uno
26
14. Bulb
27
15. Fan
27
16. Relay SPDT
28
17. LCD
28
18. Resistor
29
5|Page
19. IR Sensor
30
20. Arduino IDE (1)
30
21. Arduino IDE (1.1)
31
22. Tinker Cad
42
23. Case 1
43
24. Case 2
44
25. Case 3
45
26. Case 4
46
27. Case 5
47

6|Page
CHAPTER 1: INTRODUCTION
Definition
A dynamic network infrastructure with self-configuring capabilities based on the standard and
interoperable communication protocols where physical and virtual “things” have identities,
physical attributes, and virtual personalities and use intelligent interfaces, and are seamlessly
integrated into the information network, often communicate data associated with users and their
environments.

What is Wireless Network?

Figure 1 Wireless Network

Wireless Sensor Networks (WSNs) can be defined as a self-configured and fewer wireless
networks to monitor physical or environmental conditions, such as temperature, sound, vibration,
pressure, motion or pollutants and to cooperatively pass their data through the network to a main
location or sink where the data can be observed and analyzed. A sink or base station acts like an
interface between users and the network. One can retrieve required information from the network
by injecting queries and gathering results from the sink. Typically, a wireless sensor network
contains hundreds of thousands of sensor nodes. The sensor nodes can communicate among
7|Page
themselves using radio signals. A wireless sensor node is equipped with sensing and computing
devices, radio transceivers and power components. The individual nodes in a wireless sensor
network (WSN) are inherently resource constrained: they have limited processing speed, storage
capacity, and communication bandwidth. After the sensor nodes are deployed, they are responsible
for self-organizing an appropriate network infrastructure often with multi-hop communication
with them. Then the onboard sensors start collecting information of interest. Wireless sensor
devices also respond to queries sent from a “control site” to perform specific instructions or
provide sensing samples. The working mode of the sensor nodes may be either continuous or event
driven. Global Positioning System (GPS) and local positioning algorithms can be used to obtain
location and positioning information. Wireless sensor devices can be equipped with actuators to
“act” upon certain conditions. These networks are sometimes more specifically referred as
Wireless Sensor and Actuator Networks as described. Wireless sensor networks (WSNs) enable
new applications and require non-conventional paradigms for protocol design due to several
constraints. Owing to the requirement for low device complexity together with low energy
consumption (i.e. long network lifetime), a proper balance between communication and signal/data
processing capabilities must be found. This motivates a huge effort in research activities,
standardization process, and Wireless Sensor Networks – Technology and Protocols 4 industrial
investments in this field since the last decade. At present time, most of the research on WSNs has
concentrated on the design of energy and computationally efficient algorithms and protocols, and
the application domain has been restricted to simple data-oriented monitoring and reporting
applications. The authors propose a Cable Mode Transition (CMT) algorithm, which determines
the minimal number of active sensors to maintain K-coverage of a terrain as well as K-connectivity
of the network. Specifically, it allocates periods of inactivity for cable sensors without affecting
the coverage and connectivity requirements of the network based only on local information. In one
paper a delay-aware data collection network structure for wireless sensor networks is proposed.
The objective of the proposed network structure is to minimize delays in the data collection
processes of wireless sensor networks which extends the lifetime of the network. In one of the
papers, the authors have considered relay nodes to mitigate the network geometric deficiencies
and used Particle Swarm Optimization (PSO) based algorithms to locate the optimal sink location
with respect to those relay nodes to overcome the lifetime challenge. Energy efficient
8|Page
communication has also been addressed. In a research paper the authors proposed a geometrical
solution for locating the optimum sink placement for maximizing the network lifetime. Most of
the time, the research on wireless sensor networks have considered homogeneous sensor nodes.
But nowadays researchers have focused on heterogeneous sensor networks where the sensor nodes
are unlike each other in terms of their energy. In another paper the authors address the problem of
deploying relay nodes to provide fault tolerance with higher network connectivity in
heterogeneous wireless sensor networks, where sensor nodes possess different transmission radii.
New network architectures with heterogeneous devices and the recent advancement in this
technology eliminate the current limitations and expand the spectrum of possible applications for
WSNs considerably and all these are changing very rapidly.

1.2 Enabling Technologies of WSN


1.2.1 Sensors Components-
Wireless sensor networks used for typical purposes like event monitoring, fault detection,
measuring humidity etc. employ large number of sensor nodes. The sensor nodes are responsible
for sensing and processing to some extent as well.
A sensor node is made up of four basic components:
i. Sensing Unit:
● It is usually composed of two subunits: sensors and Analog-to-Digital convertors 7(ADC’s).
● Analog signals produced by sensors based on observed phenomenon are converted to digital
signals by ADC, and then fed into processing unit.
ii. Processing Unit:
● It manages the procedures that make the sensor node collaborate with other nodes to carry out
assigned sensing tasks.
● It is generally associated with a small storage unit.
iii. Transceiver:
● It connects the node to the network.

9|Page
iv. Power Unit:
● Since wireless sensor networks focus more on power conservation than ‘Quality of Service
(QoS)’, it is one of the most important components of a sensing node.
● Power units may be supported by power scavenging units such as solar cells.
● A sensor node can only be equipped with a limited power source.

Network topologies of WSN


A. Bus Topology:
In this topology, there is a node that sends a message to another node on the network that sends a
broadcast message onto the network that all other nodes see, but only the intended recipient
actually accepts and processes the message. Bus topology is easy to install but congestion of traffic
and single path communication. However, bus networks work best with a limited number of nodes.
If more than a few dozen nodes are added to a network bus, performance problems will likely
result. The proposed system architecture integrated active and passive strategies and adding a
priority classification level, can provide efficient bus priority control and minimize overall effects
to motor vehicle movements under different traffic condition.

Figure 2 Bus Topology

B. Tree Topology:
The network uses a central hub called a root node as the main communication router. In the
hierarchy, central hub is one level below from the root node. This lower level forms a star
network. The tree network can be considered a hybrid of both the Star and Peer to Peer
networking topologies as shown in Figure. In sensor network path may be single hop or multi

10 | P a g e
hop, sensor node for getting data sense the environment and sent them to the sink and sensor
forwards them to its parent after receives data messages from its children. It is important to find
an optimal shortest path tree with maximum lifetime and shorter delay but slightly high time
complexity and but more suitable for distributed implementation.

Figure 3 Tree Topology

C. Star Topology:
Star networks are connected to a centralized communication hub (sink) and the nodes cannot
communicate directly with each other. The entire communication must be routed through the
centralized hub. Each node is then a “client” while the central hub is the “server or sink” as
shown in Figure. But there is disadvantage of single path communication. Foe which there are
two algorithms implemented based on variable node updating. One is the modified sum-
product algorithm (MSPA) and the other is the simplified feedback belief propagation
algorithm (S-FBPA), both of proposed algorithms have significant complexity reduction. A
new routing method was proposed for WSNs to extend network lifetime using a combination
of a fuzzy approach and an A-star algorithm. The proposal is to determine an optimal routing
path from the source to the destination by favoring the highest remaining battery power,
minimum number of hops, and minimum traffic loads.

Figure 4 Star Topology


11 | P a g e
D. Ring Topology:

In a ring network, every node has exactly two neighbors for communication purposes. All
messages travel through a ring in the same direction (either “clockwise” or
“counterclockwise”). A failure in node breaks the loop and can take down the entire network.
In Simple Secure Logical Ring (SSLR) scheme communication and computation cost incurred
for key establishment is constant. Node compromise in the proposed schemes is handled
efficiently Algorithm performs better in reducing the energy consumption of nodes and
effectively improves the lifetime of WSNs.

Figure 5 Ring Topology

E. Mesh Topology:

Mesh topologies involve message can take any of several paths from source to destination.
(Recall that even in a ring, although two paths exist, messages can only travel in one direction.)
A mesh network in which every node connects to every other is called a full mesh and there is
partial mesh networks also exist in which some devices (nodes) connect only indirectly to
others.

Figure 6 Mesh Topology


12 | P a g e
F. Circular Topology:
In this topology, there is a circular sensing area and that the sensing area has a sink (at center).
The sensor nodes sense the event of interest and transmit these data to the sink. The nodes are
randomly deployed with uniform density all around the sink as shown in Fig.7. Depending on
the distance of a node from the sink and the transmission range of the nodes, data have to
traverse single or multiple hops before being received by the sink. The circular web topology
is easy to establish, easy to maintain, and more efficient at particular time slot only some of
the nodes are participating for communication, whereas other nodes are in sleep mode. So, it
conserves energy.

Figure 7 Circular Topology

G. Grid Topology:

The sensor network field dividing into grids as shown in Figure. The network area is partitioned
into non-overlapping square grid with same size. There should be at least one and only one node
in working state in each grid at any time. In order to extend the network life time, the nodes in a
grid should work in turn. Inside each grid, one node is selected as a grid head which is responsible
for forwarding routing information and transmitting data packets. Routing is performed in a grid-
by- grid manner. Grid-based multi-path routing protocol intended to route packets fast, utilize and
extend sensor nodes energy in addition to avoiding and handling network congestion when
happens in the network:

13 | P a g e
Figure 8 Grid topology

Applications of WSN
Some Domains where WSN is used:
● Wearables
● Smart Home Applications
● Health Care
● Smart Cities
● Agriculture
● Industrial Automation

Security Issues in Wireless Sensor Networks


Due to inherent limitations in wireless sensor networks, security is a crucial issue. While
research in WSN security is progressing at tremendous pace, no comprehensive document lists
the security issues and the threat models which pose unique threats to the wireless sensor
networks.

Security goals in sensor networks depend on the need to know what we are going to protect. We
determine four security goals in sensor networks which are Confidentiality, Integrity,
Authentication and Availability (CIAA).

14 | P a g e
Confidentiality: It is the ability to conceal messages from a passive attacker, where the message
communicated on sensor networks remains confidential.

Integrity: It refers to the ability to confirm the message has not been tampered, altered or
changed while it was on the network.

Authentication: It needs to know if the messages are from the node it claims to be from,
determining the reliability of the message's origin.

Availability: It is to determine if a node has the ability to use the resources and the network is
available for the messages to move on.

Attack types: Subversion attack, Malicious Node, Wormhole, Sinkholes, Sybil, Routing loops,
Link layer jamming, DoS and Node capture attack.

WSN design methodology


Since a large number of battery-driven nodes are deployed in a WSN, energy efficiency, fault
tolerance, and scalability should be considered in designing a WSN architecture. These factors
need to be well considered also in such a WSN as is assumed in the previous subsection.
However, in the event of emergency, urgent information must be transmitted as fast and reliable
15 | P a g e
as possible, thus reliability and low latency are primary concerns. Therefore, we need a WSN
architecture which satisfies requirements in both of normal and emergency conditions.
There have been a lot of excellent works on data gathering schemes which can be applied in
normal situations. For example, we take an approach to incorporate mechanisms for urgent
information transmission with any data gathering scheme well designed for application-oriented
communication. It means that a WSN operates on a data gathering scheme in the normal
situation. Once an emergency occurs, an appropriate series of actions take place to deliver urgent
information to the Base station. Those nodes which are not involved in the emergency should
keep their normal operation. In summary, our design objectives of a WSN architecture for
transmission of urgent sensor information are:

• High reliability and low latency. The reliability and latency of transmission of urgent
information are the most important issues. Urgent information should be differentiated from
other information and receive preferential controls according to their importance. We
consider that energy efficiency can be sacrificed to some extent for transmission of urgent
information.
• Self-organizing and localized behavior. The type and scale of an emergency and the number of
simultaneous emergency events are unpredictable and dynamically change as time passes. A
centralized architecture is infeasible in an emergency due to variations of traffic pattern and the
level of congestion. Therefore, we need an architecture which is fully-distributed, self-
organizing, and adaptive to dynamically changing conditions. As a consequence of localized
reactions of each sensor node to the surroundings and local interactions among nodes, a globally-
organized behavior of a WSN against detected emergencies emerges as a whole.

16 | P a g e
CHAPTER 2: REVIEW OF LITERATURE

Paper name Author Idea


Remote control of system of T. Zhang, Q. Li and F. Ma From this paper we got the
smart appliances based on idea that in the age of rapid
wireless sensor network. development such project-
based technologies help a lot.
We got an idea to apply
wireless technologies to even
basic household appliances.

Remote control systems of O. Starkova, K. Herasymenko From this paper we got an


household appliances and Y. Babailova idea to implement the
wireless technology to the use
of basic features.
We even got an idea to
simply apply this technology
for switching on/off
appliances.

Wireless home appliances J. Shah, B. Modi and R. We now have an idea from
controlling system Singh. this project that how wireless
control of appliances work.
We have an idea now how the
things, projects related to IOT
work with the help of various
resources.

17 | P a g e
Infrared remote-control X. Han From referring this paper we
design based on single chip got an idea to use LCD screen
microcomputer to display the current mode

IR remote control switch Tech Works & Raque From referring this paper, we
got an idea how useful IR
remote is and its uses.

18 | P a g e
CHAPTER 3: PROBLEM STATEMENT

• To make a project which helps us control the appliances in a wireless manner.


• To give the idea of a simple project which can be used at small scale and can give the idea of
making big projects.
• To build a project which helps us explore various components and various ideas related to IOT.
• To create a system which can turn the appliances switch on/off making which will take less
effort for the user.
• We can turn off the fan pressing a button via the remote.
• Using IR sensor to make it operable without any needs of wires and can be used from a certain
distance.

19 | P a g e
CHAPTER 4: OBJECTIVES

a. To make use of appliances easy.

b. To innovate new technology.

c. To make a project suitable for every age group.

d. To explore IOT via different ideas.

e. To make a system which is cost effective.

20 | P a g e
CHAPTER 5: PROJECT FLOW / DETAILS
Components used: Potentiometer 10k, Dc Motor, Arduino Uno R3,12,5 Power Supply,30,5
Power Supply, Replay SPDT, Light Bulb, LCD 16 X 2 ,220ohm Resistor, IR Sensor.

Circuit Diagram: Circuit Diagram Is Made Using Tinker cad.

Project Details: We first take all the components and arrange them properly. Connect all the
components and start the simulation.
When the simulation is started we see the LCD screen turning on and showing that the appliances
are off.
Click the power on button on the IR remote and then we see that the appliances are turned on and
the LCD screen shows ON.
Click any button from 1-6. Each button has been allocated minutes for how long the whole system
shall work. For example, when the user presses the button no. 2 the appliances will stay on for 2
minutes and then it will turn off automatically. The LCD screen will show ON 2min for the
duration of 2 mins and then it will show OFF. Same way we can do for other buttons ranging from
1 – 6.
If the user wants only the fan to stop working the user will press on the button 7 where only the
fan will stop working but the light bulb will stay on. The LCD screen will show ON for bulb but
OFF for fan.
If the user wants only the bulb to stop working the user will press button 8 where only the bulb
will stop working but the fan will stay on. The LCD screen will show ON for fan but OFF for light.
Basically button 7 & 8 will work for fan and bulb respectively.
On pressing the power button again, the whole system will stop and the LCD screen will show
OFF for both the appliances.

21 | P a g e
Block Diagram-

Figure 9 Block Diagram

22 | P a g e
CHAPTER 6: CIRCUIT DIAGRAM

Figure 10 Circuit Diagram

23 | P a g e
CHAPTER 7: REQUIREMENTS OF HARDWARE AND
SOFTWARE

HARDWARE:

1. Potentiometer 10K –

Figure 11 Potentiometer

Potentiometer is essentially a voltage divider used for measuring electric potential (voltage); the
component is an implementation of the same principle, hence its name.

2. DC motor -

Figure 12 DC Motor

24 | P a g e
DC Motor block controls the speed and direction of a DC motor connected to an
MKR Motor Carrier. The input signal determines the power supplied to the motor and the
direction of rotation of the motor.

3. Arduino Uno R3 -

Figure 13 Arduino Uno

The Arduino Uno R3 is a microcontroller board based on a removable, dual-inline-package (DIP)


ATmega328 AVR microcontroller. It has 20 digital input/output pins (of which 6 can be used as
PWM outputs and 6 can be used as analog inputs). ... The R3 is the third, and latest, revision of
the Arduino Uno.
The 14 digital input/output pins can be used as input or output pins by using pinMode(),
digitalRead() and digitalWrite() functions in Arduino programming. Each pin operates at 5V and
can provide or receive a maximum of 40mA current, and has an internal pull-up resistor of 20-50
KOhms which are disconnected by default. Out of these 14 pins, some pins have specific functions
as listed below:
● Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit TTL serial data.
They are connected with the corresponding ATmega328P USB to TTL serial chip.

25 | P a g e
● External Interrupt Pins 2 and 3: These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value.
● PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using analogWrite()
function.
● SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for SPI
communication.
● In-built LED Pin 13: This pin is connected with an built-in LED, when pin 13 is HIGH – LED
is on and when pin 13 is LOW, its off.

4. Bulb -

Figure 14 Bulb

BULB is used to indicate the process when the necessary function is performed.

26 | P a g e
5. Fan -

Figure 15 Fan

We are using a fan to show the working of IR sensor and IR remote.


We can control the fan which are used in household via IR remote that is wireless way.

6.SPDT Relay -

Figure 16 Relay SPDT

SPDT (Single-Pole Double-Throw) relays have a single set of Form C, break before make or
transfer contacts. That is, a common terminal connects to either of two others, never connecting to
both at the same time. Including two for the coil, such a relay has a total of five terminals.

27 | P a g e
7. LCD Display –

Figure 17 LCD Screen

The term LCD stands for liquid crystal display. It is one kind of electronic display module used in
an extensive range of applications like various circuits & devices like mobile phones, calculators,
computers, TV sets, etc. These displays are mainly preferred for multi-segment light-emitting
diodes and seven segments. The main benefits of using this module are inexpensive; simply
programmable, animations, and there are no limitations for displaying custom characters, special
and even animations, etc.

8. Resistor -

Figure 18 Resistor

Resistors act to reduce current flow, and, at the same time, act to lower voltage levels within
circuits. In electronic circuits, resistors are used to limit current flow, to adjust signal levels, bias
active elements, and terminate transmission lines among other uses.

28 | P a g e
9. IR Sensor -

Figure 19 IR Sensor

Infrared sensor or IR sensor is an electronic gadget which can identify the encompassing items. It
is by and large used to quantify warm or identify the movements. The infrared range transmits
some sort of nuclear power which must be recognized by IR sensors. These energies are
imperceptible to our eyes.
IR comprises of 2 sections:
1. Producer: It is an IR LED
2. Identifier: It is just a photodiode which is touchy to the IR light of same frequency which is
radiated by IR LED.

29 | P a g e
SOFTWARE:

1. Arduino IDE -

Figure 20 Arduino IDE

Figure 21 Arduino IDE 1.1

30 | P a g e
The Arduino incorporated advancement climate (IDE) is a cross-stage application (for
Windows, macOS, Linux) that is written in the programming language Java. It is utilized to
compose furthermore, transfer projects to Arduino viable sheets, yet additionally, with the
assistance of outsider centers, other seller advancement sheets. The source code for the IDE is
delivered under the GNU General Public License, form 2. The Arduino IDE upholds the dialects
C and C++ utilizing uncommon standards of code organizing. The Arduino IDE supplies a product
library from the Wiring project, which gives numerous normal info and yield methods. Client
composed code just requires two fundamental capacities, for beginning the sketch and the
fundamental program circle, that are incorporated and connected with a program stub principle()
into an executable cyclic chief program with the GNU toolchain, likewise included with the IDE
distribution. The Arduino IDE utilizes the program argued to change over the executable code into
a 29text record in hexadecimal encoding that is stacked into the Arduino board by a loader program
in the board's firmware.

2. Tinker CAD -

Figure 22 Tinker CAD

31 | P a g e
Tinker CAD uses a simplified constructive solid geometry method of constructing models. A
design is made up of primitive shapes that are either "solid" or "hole". Combining solids and holes
together, new shapes can be created, which in turn can be assigned the property of solid or
whole. In addition to the standard library of primitive shapes, a user can create custom shape
generators using a built-in JavaScript editor. Shapes can be imported in three
formats: STL and OBJ for 3D, and 2-dimensional SVG shapes for extruding into 3D shapes.
Tinker CAD exports models in STL or OBJ formats, ready for 3D printing. Tinker CAD also
includes a feature to export 3D models to Minecraft Java Edition, and also offers the ability to
design structures using Lego bricks.

32 | P a g e
CHAPTER 8: IMPLEMENTATION

#include <IRremote.h> //IR Remote library


#include <LiquidCrystal.h> //LCD library

#define button1 16582903


#define button2 16615543
#define button3 16599223
#define button4 16591063
#define button5 16623703
#define button6 16607383
#define button7 16586983
#define button8 16619623
#define both 16580863 // code power button
LiquidCrystal lcd(12,10,7,6,5,4);

int irsensor = 11; //IR sensor output pin


IRrecv irrecv(irsensor);
decode_results results;

int fan = 3; //fan pin


int bulb = 2; //bulb pin
int status[] = {0,0,0}; //initial state of appliances is OFF (zero)

void setup()
{
Serial.begin(9600);
lcd.begin(16,2); // Start the LCD

33 | P a g e
irrecv.enableIRIn(); // Start the IR receiver

pinMode(fan, OUTPUT);
pinMode(bulb, OUTPUT);

lcd.setCursor(2,1);
lcd.print("Class Project");
delay(300); //delay 0.3sec
lcd.clear();

lcd.setCursor(3,0);
lcd.print("IR Remote");
lcd.setCursor(0,1);
lcd.print("Switching On/Off");
delay(200); //delay 0.2sec
lcd.clear();

lcd.setCursor(3,0);
lcd.print("Designed by");
lcd.setCursor(4,1);
lcd.print("Neil Mehta");
delay(200); //delay 0.2sec
lcd.clear();

lcd.setCursor(0,0);
lcd.print("fan: OFF"); //intial condition
lcd.setCursor(0,1);
lcd.print("bulb: OFF");
}

34 | P a g e
void loop()
{
if (irrecv.decode(&results))
{
unsigned int value = results.value;
switch(value)
{

case button1:
digitalWrite(fan, HIGH); // turn on when button is pressed
digitalWrite(bulb, HIGH);
status[1] = 1; //set status as ON
status[2] = 1;
lcd.setCursor(6,0); //display condition on LCD
lcd.print("ON 1min");
lcd.setCursor(6,1); //display condition on LCD
lcd.print("ON 1min");
delay(60000); //delay 1min
digitalWrite(fan, LOW); //turn off devices after 1min delay
digitalWrite(bulb, LOW);
status[1] = 0; //change status to OFF
status[2] = 0;
lcd.setCursor(6,0);
lcd.print("OFF "); //print condition as OFF on LCD
lcd.setCursor(6,1);
lcd.print("OFF ");
break;

35 | P a g e
case button2:
digitalWrite(fan, HIGH); // turn on when button is pressed
digitalWrite(bulb, HIGH);
status[1] = 1; // set status as ON
status[2] = 1;
lcd.setCursor(6,0); //display condition on LCD
lcd.print("ON 2min");
lcd.setCursor(6,1); //display condition on LCD
lcd.print("ON 2min");
delay(120000); //delay 2min
digitalWrite(fan, LOW);
digitalWrite(bulb, LOW);
status[1] = 0;
status[2] = 0;
lcd.setCursor(6,0);
lcd.print("OFF ");
lcd.setCursor(6,1);
lcd.print("OFF ");
break;

case button3:
digitalWrite(fan, HIGH); // turn on when button is pressed
digitalWrite(bulb, HIGH);
status[1] = 1; // set status as ON
status[2] = 1;
lcd.setCursor(6,0); //display condition on LCD
lcd.print("ON 3min");
lcd.setCursor(6,1); //display condition on LCD
lcd.print("ON 3min");

36 | P a g e
delay(180000); //delay 3min
digitalWrite(fan, LOW);
digitalWrite(bulb, LOW);
status[1] = 0;
status[2] = 0;
lcd.setCursor(6,0);
lcd.print("OFF ");
lcd.setCursor(6,1);
lcd.print("OFF ");
break;

case button4:
digitalWrite(fan, HIGH); // turn on when button is pressed
digitalWrite(bulb, HIGH);
status[1] = 1; // set status as ON
status[2] = 1;
lcd.setCursor(6,0); //display condition on LCD
lcd.print("ON 4min");
lcd.setCursor(6,1); //display condition on LCD
lcd.print("ON 4min");
delay(240000); //delay 4min
digitalWrite(fan, LOW);
digitalWrite(bulb, LOW);
status[1] = 0;
status[2] = 0;
lcd.setCursor(6,0);
lcd.print("OFF ");
lcd.setCursor(6,1);
lcd.print("OFF ");

37 | P a g e
break;

case button5:
digitalWrite(fan, HIGH); // turn on when button is pressed
digitalWrite(bulb, HIGH);
status[1] = 1; // set status as ON
status[2] = 1;
lcd.setCursor(6,0); //display condition on LCD
lcd.print("ON 5min");
lcd.setCursor(6,1); //display condition on LCD
lcd.print("ON 5min");
delay(300000); //delay 5min
digitalWrite(fan, LOW);
digitalWrite(bulb, LOW);
status[1] = 0;
status[2] = 0;
lcd.setCursor(6,0);
lcd.print("OFF ");
lcd.setCursor(6,1);
lcd.print("OFF ");
break;

case button6:
digitalWrite(fan, HIGH); // turn on when button is pressed
digitalWrite(bulb, HIGH);
status[1] = 1; // set status as ON
status[2] = 1;
lcd.setCursor(6,0); //display condition on LCD
lcd.print("ON 6min");

38 | P a g e
lcd.setCursor(6,1); //display condition on LCD
lcd.print("ON 6min");
delay(360000); //delay 6min
digitalWrite(fan, LOW);
digitalWrite(bulb, LOW);
status[1] = 0;
status[2] = 0;
lcd.setCursor(6,0);
lcd.print("OFF ");
lcd.setCursor(6,1);
lcd.print("OFF ");
break;

case button7:
if(status[1] == 1) { // if first app is ON then
digitalWrite(fan, LOW); // turn it off when button is pressed
status[1] = 0; // and set its state as off
lcd.setCursor(6,0); //printing status on LCD
lcd.print("OFF");
}

else { // else if first app is OFF then


digitalWrite(fan, HIGH); // turn it on when the button is pressed
status[1] = 1; // and set its state as ON
lcd.setCursor(6,0); //printing status on LCD
lcd.print("ON ");
}
break;

39 | P a g e
case button8:
if(status[2] == 1) {
digitalWrite(bulb, LOW);
status[2] = 0;
lcd.setCursor(6,1); //printing status on LCD
lcd.print("OFF");
}

else {
digitalWrite(bulb, HIGH);
status[2] = 1;
lcd.setCursor(6,1); //printing status on LCD
lcd.print("ON ");
}
break;

case both:
if(status[1] == 1 && status[2] == 1) //if devices is turned on
{ digitalWrite(fan, LOW); //turn it off
status[1] = 0; //change status to low
lcd.setCursor(6,0);
lcd.print("OFF ");

digitalWrite(bulb, LOW);
status[2] = 0;
lcd.setCursor(6,1);
lcd.print("OFF "); }
else //if devices is turned off
{ digitalWrite(fan, HIGH); //turn it on

40 | P a g e
status[1] = 1; //change status to high
lcd.setCursor(6,0);
lcd.print("ON ");
digitalWrite(bulb, HIGH);
status[2] = 1;
lcd.setCursor(6,1);
lcd.print("ON "); }
}
Serial.println(value);
irrecv.resume(); // take next value
}
}

41 | P a g e
CHAPTER 9: TESTING

CASE 1: When we switch off the appliance

Figure 23 Case 1

42 | P a g e
Case 2: When we switch on the appliances. Successfully connected everything and by pressing
power on button we switch on the appliance.

Figure 24 Case 2

43 | P a g e
CASE 3: When we press 1 on the IR remote it will automatically switch off the appliance in
1minute.

Figure 25 Case 3

44 | P a g e
CASE 4: When we press 3 on the IR remote it will automatically switch off the appliance in 3
minutes.

Figure 26 Case 4

45 | P a g e
Case 5: When we press 6 on the IR remote it will automatically switch off the appliance in 6
minutes.

Figure 27 Case 5

46 | P a g e
CHAPTER 10: RESULTS

• The implementation was successfully done and we obtained the results.


• The LCD display, sensors, dc motor and all the other components were working successfully
and we obtained the desire output by performing the necessary operation.
• We got the result displayed on the LCD display and the lightning of bulb and moving of fan
was also indication that the system is working properly.
• As we press the button of IR remote for certain tasks it successfully shows the output.
• Each button has different functions mentioned below in tabular form.

Button Number Button Function


0 Power Button
1 Keep the system ON for 1 min
2 Keep the system ON for 2 min
3 Keep the system ON for 3 min
4 Keep the system ON for 4 min
5 Keep the system ON for 5 min
6 Keep the system ON for 6 min
7 Controls Fan only i.e. ON and OFF
8 Controls Bulb only i.e. ON and OFF

47 | P a g e
CHAPTER 11: CONCLUSION
This system includes controlling appliances using an IR sensor with the help of which we
can Switch on/off the appliances instantly from a certain distance by just pressing a single button.
This system will help in building smart home appliances which can be used with minimum effort.
We achieved implementing the functionalities such as keeping the system on for a specific period
of time and also switching on/off one particular appliance at a time successfully. This system could
help many people in taking their first step towards home automation.

48 | P a g e
CHAPTER 12: REFERENCES

1. O. Starkova, K. Herasymenko and Y. Babailova, "Remote control systems of


household appliances," 2017 4th International Scientific-Practical Conference
Problems of Info-communications. Science and Technology (PIC S&T), Kharkov,
Ukraine, 2017, pp. 585-588, doi: 10.1109/INFOCOMMST.2017.8246468.

2. J. Shah, B. Modi and R. Singh, "Wireless home appliances controlling system,"


2014 International Conference on Electronics and Communication Systems
(ICECS), Coimbatore, India, 2014, pp. 1-6, doi: 10.1109/ECS.2014.6892520.

3. T. Zhang, Q. Li and F. Ma, "Remote control system of smart appliances based on


wireless sensor network," 2013 25th Chinese Control and Decision Conference
(CCDC), Guiyang, China, 2013, pp. 3704-3709, doi:
10.1109/CCDC.2013.6561592.

4. X. Han, "Infrared remote-control design based on single chip microcomputer,"


2015 IEEE International Conference on Computer and Communications (ICCC),
Chengdu, China, 2015, pp. 245-249, doi: 10.1109/CompComm.2015.7387575.

5. Works, T. and raquo; M., 2021. IR Remote Control Switch. [online]


Instructables. Available at: <https://www.instructables.com/IR-Remote-
Control-Switch/>

6. https://www.edgefx.in/remote-control-for-home-appliances/

7. https://en.wikipedia.org/wiki/Wireless_sensor_network

8. https://www.youtube.com/watch?v=x3EYxZLDuro

49 | P a g e
9. https://brainly.in/question/1888567

10. https://www.indiamart.com/proddetail/infrared-remote-switch-
2772625655.html
11. https://www.elprocus.com/infrared-remote-control-switch-working-and-
applications/
12. https://www.instructables.com/Turn-any-IR-remote-control-to-a-wireless-
control-O
13. https://circuitspedia.com/remote-control-on-off-switch-circuit-
diagram/#:~:text=Remote%20Controlled%20Switch&text=TSOP1738%20i
s%20used%20in%20the,applied%20to%20PNP%20transistor%20557

50 | P a g e

You might also like