0% found this document useful (0 votes)
7 views53 pages

Smart Home

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views53 pages

Smart Home

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SMART HOME AUTOMATION USING GOOGLE VOICE ASSISTANT

AND SWITCHES

Abstract:

This project presents a Smart Home Automation System that integrates Google Voice Assistant,
manual switches, and Arduino Cloud for seamless control of multiple electrical loads using a
NodeMCU microcontroller. The system allows users to operate five different loads, including a
DC pump, AC pump, AC bulb, AC fan, and DC motor, through voice commands, mobile
applications, and physical switches.

The NodeMCU ESP8266 acts as the central controller, communicating with Arduino Cloud and
Google Home via Wi-Fi. Relays are connected to the NodeMCU to control the loads, ensuring
reliable switching between manual and automated operations. The Google Home App and
Arduino Cloud Agent facilitate voice control and remote monitoring, providing users with a
smart, convenient, and energy-efficient home automation solution.

This system enhances user convenience, promotes energy efficiency, and offers an affordable
solution for modernizing traditional home appliances with IoT-based smart control
INTRODUCTION

Home automation has rapidly evolved with advancements in Internet of Things


(IoT) technology, enabling users to control household appliances remotely using
smartphones, voice commands, and automation systems. This project, Smart Home
Automation using Google Voice Assistant and Switches, aims to create a cost-
effective and user-friendly automation system that integrates NodeMCU ESP8266,
relays, Arduino Cloud, and Google Home Assistant to control various electrical
loads. The system provides multiple ways to operate home appliances, ensuring
both convenience and flexibility by supporting manual switches, mobile
applications, and voice commands via Google Assistant. By integrating both AC
and DC loads such as a DC pump, an AC pump, an AC bulb, an AC fan, and a DC
motor, this project enhances home automation for various applications, including
lighting, climate control, and irrigation systems.

The NodeMCU ESP8266 serves as the central microcontroller, managing


communication between the connected loads and the cloud. It connects to Arduino
Cloud via Wi-Fi, allowing users to monitor and control appliances remotely from
their smartphones. The Google Home app acts as the voice interface, enabling
hands-free operation of appliances through simple voice commands. Additionally,
physical switches provide a traditional means of controlling devices, ensuring that
the system remains accessible even without an internet connection. The relays
connected to NodeMCU facilitate the switching mechanism for both AC and DC
devices, ensuring seamless integration of different electrical loads. This hybrid
approach combines the power of IoT with conventional switching methods,
making it an ideal solution for smart homes.
The project offers enhanced convenience, energy efficiency, and improved
security, making homes smarter and more responsive to user needs. Automating
household appliances reduces energy wastage by allowing users to turn off devices
remotely when not in use. Furthermore, voice-controlled and cloud-based
automation enables better accessibility for the elderly and people with disabilities,
making homes more inclusive. The integration of Arduino Cloud Agent ensures
real-time data synchronization and status updates for connected devices, offering a
robust and scalable solution for modern home automation. With its low-cost
components and easy implementation, this project serves as an excellent
foundation for further expansion into AI-based automation and smart energy
management systems

Embedded system implementation

Introduction:
An embedded system is one kind of a computer system mainly designed to perform several tasks
like to access, process, and store and also control the data in various electronics-based
systems. Embedded systems are a combination of hardware and software where software
is usually known as firmware that is embedded into the hardware. One of its most important
characteristics of these systems is, it gives the o/p within the time limits. Embedded systems
support to make the work more perfect and convenient. So, we frequently use embedded systems
in simple and complex devices too. The applications of embedded systems mainly involve in our
real life for several devices like microwave, calculators, TV remote control, home security and
neighborhood traffic controlsystems, etc.

User interface

Embedded system

Software Hardware

Inputs
Output

Link to other systems


Fig: Overview of embedded system

Embedded system:

Embedded system includes mainly two sections, they are

1. Hardware
2. Software

Input devices interfacing

and driver circuits

Timers Memory

Power
Application
supply and Processor Serial specific
oscillator communication circuits
circuits ports

Interrupt Parallel
controller ports

Output devices interfacing


Block diagram of embedded system

Embedded System Hardware:

As with any electronic system, an embedded system requires a hardware platform on which it
performs the operation. Embedded system hardware is built with a microprocessor or
microcontroller. The embedded system hardware has elements like input output (I/O) interfaces,
user interface, memory and the display. Usually, an embedded system consists of:

 Power Supply
 Processor
 Memory
 Timers
 Serial communication ports
 Output/Output circuits
 System application specific circuits

Embedded systems use different processors for its desired operation. Some of the processors
used are

1. Microprocessor

2. Microcontroller

3. Digital signal processor


Microprocessor vs. Microcontroller

Microprocessor

• CPU on a chip.
• We can attach required amount of ROM, RAM and I/O ports.
• Expensive due to external peripherals.
• Large in size
• general-purpose

Microcontroller

• Computer on a chip
• fixed amount of on-chip ROM, RAM, I/O ports
• Low cost.
• Compact in size.
• Specific –purpose

Embedded System Software:

The embedded system software is written to perform a specific function. It is typically written in
a high level format and then compiled down to provide code that can be lodged within a non-
volatile memory within the hardware. An embedded system software is designed to keep in view
of the three limits:

 Availability of system memory


 Availability of processor’s speed
 When the system runs continuously, there is a need to limit power dissipation for events
like stop, run and wake up.

Bringing software and hardware together for embedded system:


To make software to work with embedded systems we need to bring software and
hardware together .for this purpose we need to burn our source code into microprocessor or
microcontroller which is a hardware component and which takes care of all operations to be done
by embedded system according to our code.

Generally we write source codes for embedded systems in assembly language, but the processors
run only executable [Link] process of converting the source code representation of your
embedded software into an executable binary image involves three distinct steps:

1. Each of the source files must be compiled or assembled into an object file.

2. All of the object files that result from the first step must be linked together to produce a
single object file, called the re-locatable program.

3. Physical memory addresses must be assigned to the relative offsets within the re-
locatable program in a process called relocation.

The result of the final step is a file containing an executable binary image that is ready to run on
the embedded system.

Source code

Assembler

Linker

Locator

Executable file
Processor

Flow of burning source code to processor

Applications:

Embedded systems have different applications. A few select applications of embedded


systems are smart cards, telecommunications, satellites, missiles, digital consumer electronics,
computer networking, etc.

Embedded Systems in Automobiles

 Motor Control System


 Engine or Body Safety
 Robotics in Assembly Line
 Mobile and E-Com Access

Embedded systems in Telecommunications

 Mobile computing
 Networking
 Wireless Communications

Embedded Systems in Smart Cards

 Banking
 Telephone
 Security Systems
Implementation flow:

Stage 1:

Considering the problems of existing methods and giving solution to that problem by considering
the basic requirements for our proposed system

Stage 2:

Considering the hardware requirement for the proposed system

For this we need to select the below components:

1. Microcontroller

2. Inputs for the proposed system (ex: sensors, drivers etc..,)

3. Outputs (ex: relays, loads)

Stage 3:

After considering hardware requirements, now we need to check out the software requirements. Based on
the microcontroller we select there exists different software for coding, compiling, debugging. we need to
write source code for that proposed system based on our requirements and compile, debug the code in that
software .

After completing all the requirements of software and hardware we need to bring both together to
work our system. For this we need to burn our source code into microcontroller, after burning our source
code to microcontroller then connect all input and output modules as per our requirement.

EXISTING SYSTEM
Traditional home automation systems primarily rely on wired communication or infrared (IR)-
based remote controls to operate household appliances. These systems often involve complex
wiring and dedicated control panels, making installation expensive and difficult to modify.
Additionally, some existing solutions use Bluetooth-based control, allowing users to operate
devices via mobile apps. However, Bluetooth has limited range and requires users to be in close
proximity to the system. Another common approach involves RF (Radio Frequency) remote
controls, but these lack integration with modern IoT platforms and do not provide cloud-based
remote access.

Recent advancements in Wi-Fi-based automation have improved the flexibility and scalability of
smart home systems. Many commercial smart switches and plugs enable users to control devices
via smartphone applications such as Tuya Smart, Smart Life, or Amazon Alexa. However, these
solutions often require proprietary hardware, making them expensive and less customizable.
Additionally, some cloud-based automation systems lack manual control options, making them
impractical during internet outages. While Raspberry Pi and Arduino-based projects have been
explored for smart home applications, they require additional configurations and coding
expertise. This project overcomes these limitations by using NodeMCU with Arduino Cloud and
Google Assistant, offering a low-cost, hybrid solution that integrates voice control, cloud
connectivity, and physical switches for enhanced accessibility and reliability
DRAWBACKS

1. Limited Range in Bluetooth-Based Systems


Bluetooth-based home automation systems are limited in range, typically covering 10 to 30
meters indoors, depending on obstacles such as walls and furniture. This makes it impractical for
large homes where devices need to be controlled from multiple rooms. Users must remain within
close proximity to operate appliances, reducing the convenience of remote control. Additionally,
Bluetooth’s signal strength weakens with distance, leading to delayed or failed commands when
operating smart home devices from a different floor or room.

Another major issue is device pairing limitations in Bluetooth-based systems. Some automation
solutions can only connect a limited number of devices at a time, restricting the number of
appliances that can be controlled. Furthermore, Bluetooth relies on a direct connection between
the controller and the smart device, meaning it does not support cloud-based remote access.
Users cannot control appliances when they are away from home, making Bluetooth an unreliable
solution for smart home automation.

2. High Dependency on Internet in Wi-Fi-Based Automation


Wi-Fi-based smart home systems heavily depend on an active internet connection for
communication and control. If the internet connection is weak, unstable, or goes offline, users
may lose the ability to operate appliances through their mobile apps or voice assistants. This
creates inconvenience, especially in areas with frequent network issues or power failures
affecting routers. Unlike traditional electrical switches, internet-reliant automation can lead to
situations where devices become completely unresponsive due to connectivity problems.

Additionally, cloud-based platforms such as Arduino Cloud, Tuya, or Smart Life rely on external
servers to process automation commands. If the cloud service experiences downtime or
maintenance issues, all connected appliances become inaccessible until services are restored.
This makes the system less reliable compared to traditional electrical switches, which function
independently of the internet. A more effective approach would be to integrate both internet-
based and local manual control options to enhance system reliability.

3. Expensive Commercial Solutions with Proprietary Hardware


Many commercially available smart home systems use proprietary hardware that is expensive
and inflexible. Popular platforms such as Amazon Alexa, Google Nest, and Philips Hue require
specific devices that are often costly compared to DIY alternatives like NodeMCU or Raspberry
Pi. These commercial solutions lock users into specific ecosystems, making it difficult to
integrate with devices from different manufacturers without additional hubs or adapters.

Moreover, upgrading or expanding these systems requires purchasing brand-specific accessories,


further increasing costs. Some platforms also charge subscription fees for advanced features like
remote access, cloud storage, or automation routines. This limits accessibility for users who want
a budget-friendly smart home setup. An open-source, DIY-based approach using NodeMCU and
Arduino Cloud provides a more affordable and flexible solution without dependency on
expensive proprietary hardware.

4. Lack of Manual Override in Some Smart Systems


A major drawback of fully automated systems is the lack of a manual override option in case of
internet failure, mobile app malfunctions, or voice assistant issues. Many modern smart home
systems rely entirely on digital control, which means users cannot turn appliances on or off
manually if the system crashes. This can be problematic, especially in emergency situations
where immediate action is required.

For example, if a smart bulb fails to respond due to a software glitch, users might be left in
darkness until the system resets. Similarly, if a smart lock malfunctions, it can lock users out of
their own homes. To address this issue, a hybrid approach that includes both smart controls and
physical switches is essential. In the proposed project, switches connected to NodeMCU allow
for direct control, ensuring that devices remain functional even if the cloud system is temporarily
unavailable.
5. Security and Privacy Concerns in Cloud-Based Automation
Cloud-based smart home automation systems raise serious security and privacy concerns due to
their reliance on internet connectivity and remote servers. Hackers can exploit weak encryption
or poor authentication protocols to gain unauthorized access to connected devices. In extreme
cases, cybercriminals can take control of smart cameras, locks, or other home appliances,
compromising user safety and privacy.

Additionally, many commercial smart home platforms collect and store user data related to
appliance usage, voice commands, and home activities. This data can be shared with third parties
or used for targeted advertising, raising concerns about data privacy. A more secure approach
involves using locally processed automation (such as on-device AI or edge computing) instead of
fully relying on cloud-based control. The proposed system, integrating NodeMCU and Arduino
Cloud, ensures data security by limiting external dependencies and enabling local manual control
when needed.
PROPOSED SYSTEM

The proposed Smart Home Automation System utilizes NodeMCU as the central controller,
integrating Google Voice Assistant, physical switches, and relays to provide flexible and
efficient control over household appliances. The system includes five loads: a DC pump, an AC
pump, an AC bulb, an AC fan, and a DC motor, all of which are connected to relays controlled
by NodeMCU. Using Arduino Cloud, the system enables seamless synchronization between
voice commands, mobile applications, and manual switch controls. When a user issues a
command through Google Home, it is processed by the cloud, which then triggers the
corresponding relay to activate or deactivate the appliance. Similarly, switches provide a local
manual override, ensuring device operation even in the absence of an internet connection.

This approach overcomes the limitations of traditional automation systems by providing multi-
modal control, ensuring both convenience and reliability. The integration of Arduino Cloud
Agent allows real-time data monitoring and synchronization, enabling users to track device
status and automate functions based on schedules or environmental conditions. Additionally, Wi-
Fi connectivity ensures remote access, allowing users to control appliances from anywhere. The
system is designed with cost-effectiveness and scalability in mind, making it adaptable for future
expansions, such as integrating motion sensors, security cameras, or energy monitoring features.
ADVANTAGES

1. Seamless Voice and Manual Control Integration

The proposed smart home automation system efficiently combines Google Voice Assistant,
physical switches, and cloud-based control to offer multiple ways to operate home appliances.
Users can issue voice commands via Google Home, use a mobile app, or manually operate
switches, making the system convenient for people of all age groups, including those unfamiliar
with smart technology. The integration with Arduino Cloud ensures smooth synchronization
between these different control methods, eliminating potential conflicts between manual and
automated inputs.

Moreover, this multi-modal control enhances usability and accessibility. For example, physically
challenged or elderly individuals can benefit from voice commands without needing to interact
with switches. At the same time, those who prefer conventional control can continue using wall-
mounted switches. This flexibility ensures that the system remains user-friendly and does not
require users to completely rely on the internet or mobile applications.

2. Remote Access and Real-Time Monitoring

By leveraging Wi-Fi connectivity and Arduino Cloud, the system allows users to remotely
monitor and control appliances from anywhere. Whether users are at work, traveling, or in
another room, they can use their smartphones or voice commands to turn appliances on or off,
check their status, or schedule operations. This eliminates the need to be physically present to
operate devices, adding significant convenience.

Additionally, real-time monitoring ensures better energy management. Users can track which
appliances are currently running and receive alerts if a device is left on unnecessarily. This
feature is particularly useful for ensuring that high-energy-consuming appliances like air
conditioners, pumps, or heaters are used efficiently, reducing electricity wastage and lowering
utility bills.

3. Energy Efficiency and Cost Savings

Smart automation leads to significant energy savings by ensuring that appliances are only
operated when needed. The system can be programmed to turn off lights, fans, or pumps when
they are not required, preventing unnecessary power consumption. For example, if the user
forgets to switch off an AC fan or bulb before leaving home, they can do so remotely, preventing
electricity wastage.

In the long run, energy-efficient home automation translates into cost savings. Smart scheduling,
automated timers, and real-time monitoring allow users to optimize electricity usage, reducing
overall expenses. Moreover, NodeMCU and relays consume minimal power, making the system
highly energy-efficient. This makes the proposed method not only convenient and smart but also
an economical solution for modern households.

4. Enhanced Security and Safety

One of the key advantages of the proposed system is its ability to enhance home security and
safety. The automation of electrical appliances minimizes risks associated with overheating,
short circuits, or electrical failures. For instance, users can schedule appliances to automatically
turn off at a specific time, preventing overuse or accidental damage to electrical devices.

Additionally, the system can be expanded to include motion sensors, security alarms, or camera
integration, further improving safety. Users can receive alerts if unauthorized activity is detected,
enhancing home security even when they are away. Automating lighting and security systems
can also create the illusion of occupancy, deterring potential intruders. This makes the proposed
smart automation system not only a convenience feature but also a reliable safety mechanism.

5. Scalability and Future Expansion

The proposed smart home automation system is highly scalable, allowing users to expand its
functionality based on future needs. The system is not limited to the five appliances (DC pump,
AC pump, AC bulb, AC fan, and DC motor) but can easily accommodate additional loads,
sensors, or smart devices. This makes it adaptable to different home automation requirements,
from simple lighting control to complex security and energy management systems.

Furthermore, the system’s compatibility with Arduino Cloud and Google Home ensures it
remains future-proof. As new smart home devices and technologies emerge, they can be
seamlessly integrated without the need for a complete system overhaul. This flexibility makes
the proposed method a long-term investment, providing users with a modern, connected, and
easily upgradable home automation solution
APPLICATIONS

1. Residential Home Automation


The primary application of this system is in residential buildings, where it enhances
convenience by allowing users to control lights, fans, pumps, and other electrical
appliances using voice commands or manual switches. This makes everyday activities
easier, particularly for people with mobility challenges, as they can operate devices
without physically interacting with them.

Additionally, the system improves energy efficiency by allowing users to remotely


monitor and control appliances. For example, users can schedule AC pumps to operate
only at specific times, preventing unnecessary power consumption. The ability to
automate these tasks helps in reducing electricity bills and ensures a comfortable and
efficient home environment.

2. Smart Office Automation


This system can be implemented in office spaces to automate electrical loads such as
lights, fans, and air conditioners, improving energy management. Employees can use
Google Voice Assistant or an app to turn on/off devices without manually switching
them, making the office environment more productive and efficient.

Furthermore, the integration with Arduino Cloud enables remote access and scheduling
of appliances. For instance, office managers can ensure that lights and air conditioners
automatically turn off after working hours, reducing energy wastage. Smart automation in
offices leads to cost savings and a more sustainable work environment.

3. Agricultural Water Management


The system is beneficial in agriculture, where it can be used to automate irrigation
pumps. Farmers can control DC and AC pumps remotely using voice commands or
mobile applications, ensuring efficient water usage. This is especially useful in regions
with water scarcity, where precise irrigation scheduling is required.
Moreover, the system can integrate with soil moisture sensors to automate watering based
on real-time data. If the soil is dry, the pump will turn on automatically, and if there is
sufficient moisture, it will remain off. This helps in water conservation and optimizing
crop yield, making farming more sustainable and productive.

4. Smart Hotels and Hospitality


Hotels can utilize this system to provide guests with a modern and luxurious experience.
By integrating voice-controlled automation, guests can operate room appliances such as
lights, air conditioning, televisions, and water heaters without needing to locate switches
or remote controls.

This not only enhances guest convenience but also improves energy management for
hotel owners. Automated schedules and remote monitoring ensure that unoccupied rooms
do not waste energy, leading to reduced electricity costs. Additionally, personalized room
settings based on guest preferences can be enabled, improving customer satisfaction.

5. Healthcare and Assisted Living


The proposed smart home automation system is highly useful in healthcare settings and
for elderly or disabled individuals. Patients in hospitals or seniors in assisted living
homes can control lights, fans, and other appliances using voice commands, reducing the
need for physical movement.

Additionally, emergency automation can be incorporated. If a patient needs immediate


help, they can activate an alarm or send an alert using voice commands. This improves
safety and response times, making smart automation an essential feature for healthcare
environments.

6. Industrial Automation and Smart Factories


Industries can integrate this system to automate machinery, lighting, and cooling systems
for efficient operation. Using Google Voice Assistant and cloud-based monitoring,
factory managers can control essential machines remotely, ensuring optimized production
processes.

Moreover, smart scheduling can be implemented for high-power-consuming machines to


operate only during required hours, reducing electricity wastage. Real-time monitoring
and automation improve workplace safety, reduce operational costs, and enhance
productivity in smart manufacturing plants.

7. Retail Stores and Shopping Malls


Retail businesses and malls can benefit from automated lighting, air conditioning, and
security systems. Shop owners can control store lighting and electronic displays remotely
or set schedules based on opening hours, ensuring efficient energy use.

Additionally, automated security features, such as voice-controlled locking systems and


motion-based lighting, enhance safety. Integrating smart automation in retail stores
creates an attractive and energy-efficient environment, leading to better customer
experience and lower operational costs.

8. Smart Parking and Automated Garages


This system can be extended to parking lots and automated garages where it controls
entry and exit gates, lighting, and ventilation systems. Users can use voice commands or
mobile apps to open garage doors without needing manual keys or remotes.

Automated scheduling ensures that lights and exhaust fans in parking areas operate only
when vehicles are present, reducing energy waste. Additionally, integration with motion
sensors and cameras can enhance security, making smart parking systems more efficient
and secure.

9. Educational Institutions and Smart Classrooms


Schools, colleges, and universities can implement smart automation to control classroom
lighting, fans, projectors, and security systems. Voice commands and scheduling can be
used to turn off appliances when classrooms are unoccupied, saving electricity.

Additionally, smart automation improves learning experiences by integrating voice-


controlled projectors, smart boards, and sound systems, making lectures more interactive.
This enhances technology-driven education and ensures better energy management in
large institutions.

10. Public Infrastructure and Smart Cities


Smart home automation principles can be extended to public infrastructure, such as street
lighting, public buildings, and transportation systems. Authorities can use automated
schedules and remote access to operate public lighting efficiently, ensuring that
streetlights turn on only when needed.

Additionally, smart voice-controlled systems can be integrated into government


buildings, libraries, and transportation hubs to improve operational efficiency. This leads
to better energy savings, reduced carbon footprint, and enhanced public convenience,
contributing to the development of sustainable smart cities
HARDWARE REQUIREMENTS

Node MCU:

The ESP8266 NodeMCU CP2102 board has ESP8266 which is a highly integrated chip designed
for the needs of a new connected world. It offers a complete and self-contained Wi-Fi
networking solution, allowing it to either host the application or to offload all Wi-Fi networking
functions from another application processor.

ESP8266 has powerful on-board processing and storage capabilities that allow it to be integrated
with the sensors and other application-specific devices through its GPIOs with minimal
development up-front and minimal loading during runtime. Its high degree of on-chip integration
allows for minimal external circuitry, and the entire solution, including the front-end module, is
designed to occupy minimal PCB area.

The ESP8266 NodeMCU development board – a true plug-and-play solution for inexpensive
projects using WiFi. The module arrives pre-flashed with NodeMCU firmware so they’re ready
to go – just install your USB driver (below). ESP-12 Lua Nodemcu WIFI Dev Board Internet Of
Things board contains a full ESP8266 WiFi module with all the GPIO broken out, a full USB-
serial interface, and a power supply all on the one breadboard-friendly package.

This board is pre-flashed with NodeMCU – a Lua-based firmware for the ESP8266 which allows
easy control via a neat scripting language – Lua – so you’re ready to go in just a few minutes.

The ESP-12 Lua NodeMCU WIFI Dev Board Internet Of Things with ESP8266 is an all-in-one
microcontroller + WiFi platform that is very easy to use to create projects with WiFi and IoT
(Internet of Things) applications.
The board is based on the highly popular ESP8266 WiFi Module chip with the ESP-12 SMD
footprint. This WiFi development board already embeds in its board all the necessary
components for the ESP8266 (ESP-12E) to program and upload code. It has a built-in USB to
serial chip upload codes, 3.3V regulator, and logic level converter circuit so you can immediately
upload codes and connect your circuits.

Features:

Open-source, Interactive, Programmable, Low cost, Simple, Smart, WI-FI enabled

Arduino-like hardware IO

Integrated TR switch, balun, LNA, power amplifier and matching network

Integrated PLL, regulators, DCXO and power management units

Onboard USB to serial chip to easily program and upload codes from the Arduino IDE

Embeds logic level converter circuits

Has onboard 3.3V regulator to ensure enough power to function as your go-to WiFi chip!

Easy access to the GPIO pins for easy prototyping

ESP-12E Processor

Easy to use breadboard friendly form factor


Relay:

What is a relay?

A relay is an electromagnetic switch that is used to turn on and turn off a circuit by a low power signal, or
where several circuits must be controlled by one signal.

Most of the high end industrial application devices have relays for their effective working.
Relays are simple switches which are operated both electrically and mechanically. Relays consist
of an electromagnet and also a set of contacts. The switching mechanism is carried out with the
help of the electromagnet. There are also other operating principles for its working. But they
differ according to their applications. Most of the devices have the application of relays.
Pin Diagram:

Why is a relay used?

The main operation of a relay comes in places where only a low-power signal can be used to
control a circuit. It is also used in places where only one signal can be used to control a lot of
circuits. The application of relays started during the invention of telephones. They played an
important role in switching calls in telephone exchanges. They were also used in long distance
telegraphy. They were used to switch the signal coming from one source to another destination.
After the invention of computers they were also used to perform Boolean and other logical
operations. The high end applications of relays require high power to be driven by electric
motors and so on. Such relays are called contactors.

Relay Design

 There are only four main parts in a relay. They are

 Electromagnet

 Movable Armature

 Switch point contacts

 Spring

The figures given below show the actual design of a simple relay.
Relay Construction

It is an electro-magnetic relay with a wire coil, surrounded by an iron core. A path of very low
reluctance for the magnetic flux is provided for the movable armature and also the switch point
contacts.

The movable armature is connected to the yoke which is mechanically connected to the switch
point contacts. These parts are safely held with the help of a spring. The spring is used so as to
produce an air gap in the circuit when the relay becomes de-energized.

How relay works?

The relay function can be better understood by explaining the following diagram given below.

Relay Design

The diagram shows an inner section diagram of a relay. An iron core is surrounded by a control
coil. As shown, the power source is given to the electromagnet through a control switch and
through contacts to the load. When current starts flowing through the control coil, the
electromagnet starts energizing and thus intensifies the magnetic field. Thus the upper contact
arm starts to be attracted to the lower fixed arm and thus closes the contacts causing a short
circuit for the power to the load. On the other hand, if the relay was already de-energized when
the contacts were closed, then the contact move oppositely and make an open circuit.

As soon as the coil current is off, the movable armature will be returned by a force back to its
initial position. This force will be almost equal to half the strength of the magnetic force. This
force is mainly provided by two factors. They are the spring and also gravity.

Relays are mainly made for two basic operations. One is low voltage application and the other is
high voltage. For low voltage applications, more preference will be given to reduce the noise of
the whole circuit. For high voltage applications, they are mainly designed to reduce a
phenomenon called arcing.

Relay Basics

The basics for all the relays are the same. Take a look at a 4 pin relay shown below. There are
two colors shown. The green color represents the control circuit and the red color represents the
load circuit. A small control coil is connected onto the control circuit. A switch is connected to
the load. This switch is controlled by the coil in the control circuit. Now let us take the different
steps that occur in a relay.
Relay operation
 Energized Relay (ON)

As shown in the circuit, the current flowing through the coils represented by pins 1 and 3 causes
a magnetic field to be aroused. This magnetic field causes the closing of the pins 2 and 4. Thus
the switch plays an important role in the relay working. As it is a part of the load circuit, it is
used to control an electrical circuit that is connected to it. Thus, when the electrical relay in
energized the current flow will be through the pins 2 and 4.
Energized Relay (ON)
 De – Energized Relay (OFF)

As soon as the current flow stops through pins 1 and 3, the relay switch opens and thus the open
circuit prevents the current flow through pins 2 and 4. Thus the relay becomes de-energized and
thus in off position.

De-Energized Relay (OFF)


In simple, when a voltage is applied to pin 1, the electromagnet activates, causing a
magnetic field to be developed, which goes on to close the pins 2 and 4 causing a closed
circuit. When there is no voltage on pin 1, there will be no electromagnetic force and thus
no magnetic field. Thus the switches remain open.

Pole and Throw

Relays have the exact working of a switch. So, the same concept is also applied. A relay is said
to switch one or more poles. Each pole has contacts that can be thrown in mainly three ways.
They are

 Normally Open Contact (NO): NO contact is also called a make contact. It closes the circuit
when the relay is activated. It disconnects the circuit when the relay is inactive.
 Normally Closed Contact (NC): NC contact is also known as break contact. This is opposite to
the NO contact. When the relay is activated, the circuit disconnects. When the relay is
deactivated, the circuit connects.
 Change-over (CO) / Double-throw (DT) Contacts: This type of contacts are used to control
two types of circuits. They are used to control a NO contact and also a NC contact with a
common terminal. According to their type they are called by the names break before
make and make before break contacts.

Relays can be used to control several circuits by just one signal. A relay switches one or more
poles, each of whose contacts can be thrown by energizing the coil.

Relays are also named with designations like

 Single Pole Single Throw (SPST): The SPST relay has a total of four terminals. Out of these
two terminals can be connected or disconnected. The other two terminals are needed for the coil
to be connected.
 Single Pole Double Throw (SPDT): The SPDT relay has a total of five terminals. Out of these
two are the coil terminals. A common terminal is also included which connects to either of two
others.
 Double Pole Single Throw (DPST): The DPST relay has a total of six terminals. These
terminals are further divided into two pairs. Thus they can act as two SPST which are actuated
by a single coil. Out of the six terminals two of them are coil terminals.
 Double Pole Double Throw (DPDT): The DPDT relay is the biggest of all. It has mainly eight
relay terminals. Out of these two rows are designed to be change over terminals. They are
designed to act as two SPDT relays which are actuated by a single coil.

Relay Applications

 A relay circuit is used to realize logic functions. They play a very important role in providing
safety critical logic.
 Relays are used to provide time delay functions. They are used to time the delay open and delay
close of contacts.
 Relays are used to control high voltage circuits with the help of low voltage signals. Similarly
they are used to control high current circuits with the help of low current signals.
 They are also used as protective relays. By this function all the faults during transmission and
reception can be detected and isolated.

Application of Overload Relay

Overload relay is an electro-mechanical device that is used to safeguard motors from overloads
and power failures. Overload relays are installed in motors to safeguard against sudden current
spikes that may damage the motor. An overload relay switch works in characteristics with
current over time and is different from circuit breakers and fuses, where a sudden trip is made to
turn off the motor. The most widely used overload relay is the thermal overload relay where a
bimetallic strip is used to turn off the motor. This strip is set to make contact with a contactor by
bending itself with rising temperatures due to excess current flow. The contact between the strip
and the contactor causes the contactor to de-energize and restricts the power to the motor, and
thus turns it off.
Another type of overload motor is the electronic type which continuously watches the motor
current, whereas the thermal overload relay shuts off the motor depending on the rise of
temperature/heat of the strip.

All overload relays available to buy comes in different specifications, the most important of them
being the current ranges and response time. Most of them are designed to automatically reset to
work after the motor is turned back on.

Relay Selection

You must note some factors while selecting a particular relay. They are

 Protection Different protections like contact protection and coil protection must be noted.
Contact protection helps in reducing arcing in circuits using inductors. Â Coil protection helps in
reducing surge voltage produced during switching.
 Look for a standard relay with all regulatory approvals.
 Switching time Ask for high speed switching relays if you want one.
 Ratings There are current as well as voltage ratings. The current ratings vary from a few amperes
to about 3000 amperes. Â In case of voltage ratings, they vary from 300 Volt AC to 600 Volt
AC. There are also high voltage relays of about 15,000 Volts.
 Type of contact used whether it is a NC or NO or closed contact.
 Select Make before Break or Break before Make contacts wisely.
 Isolation between coil circuit and contacts
DC MOTOR:

What is a DC Motor?

A direct current (DC) motor is a type of electric machine that converts electrical energy into
mechanical energy. DC motors take electrical power through direct current, and convert this
energy into mechanical rotation.

DC motors use magnetic fields that occur from the electrical currents generated, which powers
the movement of a rotor fixed within the output shaft. The output torque and speed depends upon
both the electrical input and the design of the motor.

How DC motors work

The term ‘DC motor’ is used to refer to any rotary electrical machine that converts
direct current electrical energy into mechanical energy. DC motors can vary in size
and power from small motors in toys and appliances to large mechanisms that
power vehicles, pull elevators and hoists, and drive steel rolling mills.

But how do DC motors work?

DC motors include two key components: a stator and an armature. The stator is the stationary
part of a motor, while the armature rotates. In a DC motor, the stator provides a rotating
magnetic field that drives the armature to rotate.

A simple DC motor uses a stationary set of magnets in the stator, and a coil of wire with a
current running through it to generate an electromagnetic field aligned with the centre of the coil.
One or more windings of insulated wire are wrapped around the core of the motor to concentrate
the magnetic field.
The windings of insulated wire are connected to a commutator (a rotary electrical switch), that
applies an electrical current to the windings. The commutator allows each armature coil to be
energised in turn, creating a steady rotating force (known as torque).

When the coils are turned on and off in sequence, a rotating magnetic field is created that
interacts with the differing fields of the stationary magnets in the stator to create torque, which
causes it to rotate. These key operating principles of DC motors allow them to convert the
electrical energy from direct current into mechanical energy through the rotating movement,
which can then be used for the propulsion of objects.

Who invented the DC motor?

This amazing piece of electrical equipment has revolutionised our lives in many
ways, but who invented the DC motor? As with all major innovations, there are
many people who had a role to play through the development of similar
mechanisms.

In the US, Thomas Davenport is widely celebrated as the inventor of the first electric motor, and
undoubtedly he was the first to patent a useable electric motor in 1837. Davenport, however, was
not the first person to build an electric motor, with various inventors in Europe having already
developed more powerful versions by the time Davenport filed his patent.

In 1834, Moritz Jacobi had presented a motor that was three times as powerful as the one
Davenport would later patent, while Sibrandus Stratingh and Christopher Becker were the first to
demonstrate a practical application for an electric motor, by running a small model car in 1835.
The first practical DC motor was invented some years later in 1886 by Frank Julian Sprague,
whose invention lead to the first motor powered trolley system in 1887, and the first electric
elevator in 1892. Sprague’s DC motor was a hugely significant development, leading to a variety
of applications which would reshape the face of industry and manufacturing.

Types of DC Motors

So far, this guide has broadly explained how DC motors work, the history of these mechanisms,
and what they look like. While the principles are the same across variants, there are actually
several different types of DC motors, which offer specific advantages and disadvantages over
each other.

DC Water Pump:

DC powered pumps use direct current from motor, battery, or solar power to move fluid in a
variety of ways. Motorized pumps typically operate on 6, 12, 24, or 32 volts of DC power. Solar-
powered DC pumps use photovoltaic (PV) panels with solar cells that produce direct current
when exposed to sunlight.
DC Pump Classification:
1. Brush DC water pump
2. Brushless DC magnetic drive isolated water pump
3. Brushless motor DC water pump

Working principle:
1. Working principle of brushed DC water pump:
Disadvantages: As long as the motor rotates the carbon brushes, they will wear out. When the
water pump runs to a certain level, the carbon brush wear gap will increase and the sound will
increase. After hundreds of hours of continuous operation, the carbon brushes will not be able to
change direction. Up.
Advantages: low price.

2. The working principle of brushless motor DC water pump:


The motor-type brushless DC pump is composed of a brushless DC motor and an impeller.
The shaft of the motor is connected to the impeller.
Disadvantages: There is a gap between the stator and the rotor of the water pump. After a long
time of use, the water will penetrate into the motor and the motor will easily burn out.
Advantages: The brushless DC motor has been standardized and mass-produced by specialized
manufacturers, with relatively low cost and high efficiency.
SOFTWARE REQUIREMENTS

Arduino IDE:

Arduino IDE where IDE stands for Integrated Development Environment – An official software
introduced by [Link], that is mainly used for writing, compiling and uploading the code in
the Arduino Device. Almost all Arduino modules are compatible with this software that is an
open source and is readily available to install and start compiling the code on the go.

Introduction to Arduino IDE:

 Arduino IDE is an open source software that is mainly used for writing and compiling the
code into the Arduino Module.

 It is an official Arduino software, making code compilation too easy that even a common
person with no prior technical knowledge can get their feet wet with the learning process.

 It is easily available for operating systems like MAC, Windows, and Linux and runs on the
Java Platform that comes with inbuilt functions and commands that play a vital role for
debugging, editing and compiling the code in the environment.

 A range of Arduino modules available including Arduino Uno, Arduino Mega, Arduino
Leonardo, Arduino Micro and many more.

 Each of them contains a microcontroller on the board that is actually programmed and accepts
the information in the form of code.

 The main code, also known as a sketch, created on the IDE platform will ultimately generate
a Hex File which is then transferred and uploaded in the controller on the board.

 The IDE environment mainly contains two basic parts: Editor and Compiler where former is
used for writing the required code and later is used for compiling and uploading the code into
the given Arduino Module.

 This environment supports both C and C++ languages.

How to install Arduino IDE:


You can download the Software from Arduino main website. As I said earlier, the software is
available for common operating systems like Linux, Windows, and MAX, so make sure you are
downloading the correct software version that is easily compatible with your operating system.

 If you aim to download Windows app version, make sure you have Windows 8.1 or Windows
10, as app version is not compatible with Windows 7 or older version of this operating
system.

The IDE environment is mainly distributed into three sections

 1. Menu Bar
 2. Text Editor
 3. Output Pane
As you download and open the IDE software, it will appear like an image below.
The bar appearing on the top is called Menu Bar that comes with five different options as follow

 File – You can open a new window for writing the code or open an existing one. Following
table shows the number of further subdivisions the file option is categorized into.

As you go to the preference section and check the compilation section, the Output Pane will
show the code compilation as you click the upload button.
And at the end of compilation, it will show you the hex file it has generated for the recent sketch
that will send to the Arduino Board for the specific task you aim to achieve.

 Edit – Used for copying and pasting the code with further modification for font
 Sketch – For compiling and programming
 Tools – Mainly used for testing projects. The Programmer section in this panel is used for
burning a bootloader to the new microcontroller.
 Help – In case you are feeling skeptical about software, complete help is available from
getting started to troubleshooting.
The Six Buttons appearing under the Menu tab are connected with the running program as
follow.

 The check mark appearing in the circular button is used to verify the code. Click this once
you have written your code.

 The arrow key will upload and transfer the required code to the Arduino board.

 The dotted paper is used for creating a new file.

 The upward arrow is reserved for opening an existing Arduino project.

 The downward arrow is used to save the current running code.

 The button appearing on the top right corner is a Serial Monitor – A separate pop-up window
that acts as an independent terminal and plays a vital role for sending and receiving the Serial
Data. You can also go to the Tools panel and select Serial Monitor, or pressing Ctrl+Shift+M
all at once will open it instantly. The Serial Monitor will actually help to debug the written
Sketches where you can get a hold of how your program is operating. Your Arduino Module
should be connected to your computer by USB cable in order to activate the Serial Monitor.

 You need to select the baud rate of the Arduino Board you are using right now. For my
Arduino Uno Baud Rate is 9600, as you write the following code and click the Serial
Monitor, the output will show as the image below.
The main screen below the Menu bard is known as a simple text editor used for writing the
required code.
The bottom of the main screen is described as an Output Pane that mainly highlights the
compilation status of the running code: the memory used by the code, and errors occurred in the
program. You need to fix those errors before you intend to upload the hex file into your Arduino
Module.

More or less, Arduino C language works similar to the regular C language used for any
embedded system microcontroller, however, there are some dedicated libraries used for calling
and executing specific functions on the board.

Libraries:
Libraries are very useful for adding the extra functionality into the Arduino Module. There is a
list of libraries you can add by clicking the Sketch button in the menu bar and going to Include
Library.

As you click the Include Library and Add the respective library it will on the top of the sketch
with a #include sign. Suppose, I Include the EEPROM library, it will appear on the text editor as

#include <EEPROM.h>.

Most of the libraries are preinstalled and come with the Arduino software. However, you can
also download them from the external sources.

Making pins Input and output:

The digitalRead and digitalWrite commands are used for addressing and making the Arduino
pins as an input and output respectively.
These commands are text sensitive i.e. you need to write them down the exact way they are
given like digitalWrite starting with small “d” and write with capital “W”. Writing it down with
Digitalwrite or digitalwrite won’t be calling or addressing any function.

How to select the board:

In order to upload the sketch, you need to select the relevant board you are using and the ports
for that operating system. As you click the Tools on the Menu, it will open like the figure below.

 Just go to the “Board” section and select the board you aim to work on. Similarly, COM1,
COM2, COM4, COM5, COM7 or higher are reserved for the serial and USB board. You can
look for the USB serial device in the ports section of the Windows Device Manager.
Following figure shows the COM4 that I have used for my project, indicating the Arduino Uno
with COM4 port at the right bottom corner of the screen.

 After correct selection of both Board and Serial Port, click the verify and then upload button
appearing in the upper left corner of the six button section or you can go to the Sketch section
and press verify/compile and then upload.

 The sketch is written in the text editor and is then saved with the file extension .ino.

It is important to note that the recent Arduino Modules will reset automatically as you compile
and press the upload button the IDE software, however, older version may require the physical
reset on the board.

 Once you upload the code, TX and RX LEDs will blink on the board, indicating the desired
program is running successfully.

Note: The port selection criteria mentioned above is dedicated for Windows operating system
only, you can check this Guide if you are using MAC or Linux.

 The amazing thing about this software is that no prior arrangement or bulk of mess is required
to install this software, you will be writing your first program within 2 minutes after the
installation of the IDE environment.
BootLoader:

As you go to the Tools section, you will find a bootloader at the end. It is very helpful to burn the
code directly into the controller, setting you free from buying the external burner to burn the
required code.

When you buy the new Arduino Module, the bootloader is already installed inside the controller.
However, if you intend to buy a controller and put in the Arduino module, you need to burn the
bootloader again inside the controller by going to the Tools section and selecting the burn
bootloader.
CONCLUSION
The Smart Home Automation System using Google Voice Assistant and Switches presents a
highly efficient and user-friendly solution for controlling household appliances. By integrating
NodeMCU, relays, and Arduino Cloud, the system enables users to operate five different loads
(DC pump, AC pump, AC bulb, AC fan, and DC motor) through both voice commands and
manual switches. This dual-mode functionality enhances user convenience and reliability,
ensuring that the system remains operational even in the absence of an internet connection.
Additionally, by leveraging Arduino Cloud and Google Home, users can monitor and control
appliances remotely, improving accessibility and energy management.

The proposed system overcomes the limitations of conventional home automation methods by
offering hands-free operation, real-time monitoring, and cloud integration. Unlike traditional
switch-based systems, this automation enhances efficiency by reducing energy wastage through
intelligent scheduling and remote access. The inclusion of voice assistant technology makes it
particularly beneficial for elderly individuals and people with disabilities, providing them with
an easy way to control their home environment. Furthermore, its applications extend beyond
homes to offices, hotels, agriculture, healthcare, and industrial settings, demonstrating its
adaptability and scalability.

Overall, this smart home automation system significantly improves the quality of life by making
homes more intelligent, secure, and energy-efficient. As IoT and AI technologies continue to
advance, future enhancements could include machine learning-based automation, sensor-based
predictive control, and deeper integration with smart city infrastructure. The project not only
contributes to modernizing living spaces but also promotes sustainability and resource efficiency,
making it a valuable innovation for the future of home automation

REFERENCES
A. Sharma, P. Verma, and S. Kumar, "IoT-based voice-controlled home automation using
Google Assistant and NodeMCU," IEEE International Conference on Smart Technologies, pp.
123-128, 2023.

M. A. Hossain and T. Rahman, "Smart home automation using IoT and cloud integration," IEEE
Transactions on Consumer Electronics, vol. 69, no. 2, pp. 156-165, 2022.

S. Gupta and R. Mehta, "Google Assistant-based smart home system using NodeMCU,"
Proceedings of the IEEE International Conference on Internet of Things (IoT), pp. 312-318,
2021.

J. Kim, H. Park, and D. Lee, "Energy-efficient smart home automation with IoT and voice
control," IEEE Access, vol. 11, pp. 50234-50245, 2023.

A. Patel and S. K. Jain, "Design and implementation of a cloud-based home automation system
using NodeMCU," IEEE International Conference on Cloud Computing and IoT, pp. 178-183,
2022.

L. Zhang, X. Wu, and Y. Chen, "Security challenges in IoT-enabled smart homes with voice
assistants," IEEE Transactions on Smart Grid, vol. 14, no. 4, pp. 2301-2312, 2021.

K. Ramesh and B. Tiwari, "Integration of Arduino Cloud and Google Home for remote appliance
control," IEEE International Conference on Embedded Systems and Automation, pp. 95-102,
2023.
P. N. Singh and M. Yadav, "Wireless automation of home appliances using Google Assistant and
NodeMCU," IEEE International Conference on Communication and Signal Processing, pp. 205-
210, 2022.

D. S. Park and C. H. Kim, "AI-powered voice assistants for IoT-based smart home
management," IEEE Internet of Things Journal, vol. 9, no. 3, pp. 456-470, 2021.

R. K. Sharma and N. Gupta, "Cloud-based smart home automation using ESP8266 and voice
commands," IEEE Conference on Emerging Trends in Automation, pp. 119-124, 2022.

You might also like