See discussions, stats, and author profiles for this publication at: https://www.researchgate.
net/publication/376797189
Iot Based Home Automation using ESP8266 & Google Home
Research · December 2023
DOI: 10.13140/RG.2.2.35926.83523
CITATIONS READS
0 608
3 authors, including:
Ovi Saha Mobarak Hossen Mollah Emon
Independent University, Bangladesh Independent University, Bangladesh
5 PUBLICATIONS 0 CITATIONS 2 PUBLICATIONS 0 CITATIONS
SEE PROFILE SEE PROFILE
All content following this page was uploaded by Ovi Saha on 24 December 2023.
The user has requested enhancement of the downloaded file.
Iot Based Home Automation
using ESP8266 & Google Home
Ovi Saha; Mobarak Hossen Mollah Emon; MD Mushfiqur rahman
Department of Electrical and Electronic Engineering
Independent University, Bangladesh
2022136@iub.edu.bd; 1910091@iub.edu.bd; 1830819@iub.edu.bd
Abstract— A basic house can become a smart home with
greater automation and safety when the Internet of Things is
implemented. This paper's objective is to develop a voice/text-
controlled home application that enables users to control their
appliances from a distance. To turn appliances ON or OFF
based on their needs; users can simply send text messages or
voice instructions. The users have the ability to schedule the
equipment's status even when they are not in the vicinity
physically. They will also receive details regarding previous
schedules and have the capability to activate the appliances for
predetermined periods of time. The application has very low
implementation costs since low-cost, high-performance
technology is used. The elderly and others with disabilities who
are unable to reach the button to turn the gadget on or off will
find this software to be incredibly dependable and effective.
Keywords— IOT, Sinric pro, Google Home, Google Assistant,
Relay, Smart control, Node Mcu, Blynk , Alexa , IFTTT
Figure 1: Home Automation
I. Introduction
Automation is the technology that allows a device or II. SYSTEM METHODOLOGY
process to be controlled with little to no human interaction.
Automating domestic or household tasks is known as home A. Home Automation Equipment:
automation. It is now possible to easily access and effectively This study suggests less expensive, easier-to-implement,
operates electrical equipment. Customers can live in style and more energy-efficient options. Furthermore, as the
with home automation by controlling every aspect of their research study points out, these projects raise people's daily
home with just a few simple clicks. Examples of these productivity. Numerous low-cost and low-power solutions
commands include opening and closing doors, turning on the for home automation with the NodeMCU, IFTTT, Blynk,
fan, and more. Among other technologies, Bluetooth, Sinric Pro, Google Home, and Amazon Alexa are suggested
ZigBee, Infrared Remote (IR) controllers, and GSM-based in a number of research papers. The suggestions from
technology can be used to construct home automation NodeMCU, Sinric Pro, and Google Home are meant to save
systems. However, there are problems with these
technologies' availability of spectrum and range. These posed money at home. Proposals will work with the following
a serious issue or increased the chance of an electrical components:
mishap, like a fire. Therefore, a reliable method of remotely • NodeMCU, also called Lolin. It is a board based
controlling home appliances is required. This study aims to on the ESP8266 chip, it has Wi-Fi connectivity
demonstrate how an IoT based home automation system is (802.11 b / g / n), an analog pin, and 17 digital
implemented that uses Wi-Fi technology to solve the home pins (Figure:1).
automation issues and concerns. This programme Voice/Text • Sinric Pro is a home automation platform
controlled home appliance is available at a low cost, and (Figure:1) that allows controlling Raspberry Pi,
anyone may turn their houses into smart homes by scheduling ESP8266, ESP32, or Arduino boards. In this
the state of their devices. This implementation will address manner, they can be linked to Amazon Alexa or
the issue of having global control over appliances, improve Google Home for free [1] .
accessibility to household appliances, and boost security
Figure 2:NodeMcu v2 Structure
• Google Home Mini is a smart speaker that can be
integrated with Google's personal assistant services
through voice recognition. The gadget is integrated
with the Google Home mobile app, which enables
Figure 4:4 Channel Relay Module
voice configuration, management, and control of all
Google Home devices as well as other compatible
goods (Figure:2). • Electrical apparatus. Devices with varying voltage
• Echo Dot is an Amazon-powered smart speaker. It and current (5v to 220v) can be powered on or off
features a mobile app called Amazon Alexa that lets by voice commands with Google Home or Amazon
you configure, manage, and operate voice-activated Alexa, as well as the Sinric Pro platform. The
devices of different products (Figure:2). platform can be used to operate many devices, such
as fans, lightbulbs, switches, solenoid valves, and
landscape irrigation systems.
Figure 3:Mini Google Home and Amazon Echo dot
• A Relay Module is an electromechanical device
used to switch circuits. It is operated by an
electromagnet and functions as a switch. Any
electrical appliance in the house can be turned on or
Figure 5: Home Automation Application
off with this gadget.
The four-channel relay module allows for simple
interfacing with a microcontroller or Sensor with the
fewest possible components and connections. It has The proposals include the usage of smartphone apps for
four 5V relays in addition to the accompanying Google Home and the NodeMCU board, relay modules, and
witching and isolating components. As stated on the the Sinric Pro platform. (Figure:4)
relays' bodies, each relay's contacts are rated for
250VAC, 30VDC, and 10A in each case. There are The installation, configuration, and coding sequence for the
two relays per terminal block, and each terminal suggested changes is as follows. The options differ slightly
block has six terminals. The crew-style connectors from one another. Refer to (Figure 5). [2]
make it simple and quick to connect to the main
wiring.
b
Figure 6:Sequence of installation, configuration and coding
Figure 7: a & b Sinric pro Setup
B. Procedure Sinric Pro, NodeMCU, and App Google
Home:
First, an account must be set up in Sinric Pro [3], Three
Switch-type devices must be added to the platform, and
notifications must then be turned on. Next, the Sinricpro
libraries [4] must be included in the Arduino IDE, along with
their dependencies on Arduino JSON [5] and Arduino Web
sockets [6]. Lastly, the libraries required to create a time
system using an NTP client [7] must also be added. Next, the
NTPClient of Advanced and the Sinricpro of
MultiSwitch_advance programs need to be connected. The
password and WIFI SSID must then be changed to match the
home wifi network. Then the credentials of the APP_KEY,
APP_SECRET, and the deviceID must be placed, these are
located on the Sinric Pro platform (Figure 6). One uses the
Google Home App. After starting the application, we should
link the platform account by searching for Sinric Pro under
the home control option. Lastly, as shown in (Figure 7), we
can establish a pattern and adjust the time as needed.
Figure 8:Home App Link with sinric pro
C. Working procedure:
1. The program me or Google Home/Alexa recognizes
your voice.
2. Which command changes the status of the Sinric Pro
linked device from '0' to'1'.
3. Using the Node MCU ESP8266 microcontroller, the
Wi-Fi module determines which sets should be on.
4. When the load is switched from '0' to '1', the relay is
switched from off to on
5. Manual Switches are connected to light/fan turn on and
off.
6. NodeMcu input Voltage will be 5v so supply voltage
will be Dc 5v.
7. In relay output Author use Ac load so Author use Ac
source.
a
b
Figure 9: Connection Diagram
Figure 10: a & b Simulation
IV. HARWARE DEVELOPMENT AND TESTING
III. SYSTEM DESIGN AND SIMULATION
The circuit is pretty simple to operate the 4-channel relay A. Power Supply:
module such as 10,6,7, and 8 no pin in Arduino. The manual To activate the NodeMCU, a reliable power supply is
switches are connected to the A0, A1, and A3 to control the essential. The NodeMCU's pins are designed to support a DC
relay module manually. Instead of using pull-up resistors 5V input, and a practical solution is to utilize a mobile phone
with each witch, I used the INPUT PULLUP feature of the charger for this purpose. Mobile phone chargers commonly
Arduino IDE. The source code states that the relevant relay provide a regulated DC supply at 5V, making them
will activate when the relay module's control pins receive a compatible with the NodeMCU's power requirements.
LOW signal, and it will deactivate when it receives a HIGH Instead of purchasing a separate power adapter, one can
signal. In simulation use Ac load that’s why ac voltage source repurpose an existing mobile charger. Typically, these
use in relay output. But Arduino pin can operate only 5-9v chargers convert the 220 AC supply to a 5V regulated DC
range so we use dc source [8] [9] [10] . supply. With this project, we’ve successfully adapted a
standard mobile charger to function as a power supply by
simply replacing the transformer. This approach not only
ensures compatibility with the NodeMCU but also eliminates
the need for acquiring a new power charger, promoting cost-
effectiveness and ease of integration into various projects.
(Figure 9)
Figure 11: Mobile Charger
B. Load:
Loads are the electrical appliances that are connected to
the system and have remote management capabilities. This
includes any electrical appliance, like a refrigerator,
lightbulb, or television, that needs to be powered by an AC
220/240V 50Hz source. These slots accommodate two
bulbs, and there is an extra socket outlet for connecting
a other electrical devices.
C. Mannual controll: The IN1, IN2, IN3, and IN4 are linked to the GPIO pins
In this project authors integrated a manual switch as a SD3, D8, TX, and RX of the NodeMCU development board,
backup option for instances of system malfunction. In respectively, to manage the state of the load connected to the
addition to acting as a fail-safe, the manual switch gives users system using the classic switches, which were effective in
the ability to manually manage the load. This ensures that both offline and online modes. An electromagnetic switch is
individuals have the option to manually operate the switch, called a relay. When a little current of a few microamperes is
allowing them to control and adjust the load even in situations applied, it becomes active. Relays are frequently used as
of technical problems or outages. When automated or remote automatic switches or switches. The voltage that will activate
control may not be possible, this extra function offers users the relay must be taken into account while designing a circuit
flexibility and control over the linked devices as a dependable because different relays function at different voltages. The
and workable substitute. relay circuit is used by this system to turn the appliances on
and off. the NodeMCU microcontroller's supply of high and
low signals. The microcontroller interfaces D6, D4, D2, and
D. Google Home Control: D0 were connected to the load switching relays RL1, RL2,
Leveraging the Google Home app's immense popularity, RL3, and RL4 by Relay module. [11] [12]
the author has chosen to administer the entire project with it.
Google Home offers two primary options for control:
a) Virtual Switch Control:
This involves the use of virtual switches within
applications, allowing users to exert virtual control over
lights or fans. People can use their electronic devices using
these apps without having to engage with them physically.
b) Google assistant control:
This feature taps into Google's voice recognition system.
Users can issue voice commands, and upon recognition by
Google Assistant, the designated lights or fans will be
remotely controlled. This voice-activated control fits in with
the current smart home automation trend by adding a layer of
convenience to the project.
E. Hardware Setup:
The system's central processing unit is the ESP8266. It is Figure 13: Pin Diagram
employed to supervise and manage the system as a whole.
The ESP8266 is a popular open-source single-board
microcontroller. A 2.4GHz, 32-bit, 30-pin CPU powers the
board. Of the 4MB of flash memory, 62KB are used by the
boot loader. The ESP8266 is equipped with a 1KB EEPROM V. RESULT AND DISCUSSION
and 64KB SRAM. This board has seventeen digital I/O ports,
six of which can produce PWM signals. For the ESP8266 A. Testing:
board to function, 5V is needed. It has one flash pin, two
ground pins, two reset pins, and two supply voltage pins. The
Arduino IDE software is used to write, generate, and upload
codes on the pre-burned ESP8266 microcontroller. Usually,
this is done via a computer. The general hardware circuit for
the home automation system is seen in Figure 12.
Figure 14: Prototype Design and Google home Setup
Figure 12: Hardware Setup
[3] "Proceedings, 4th International Conference on Smart
Systems and Inventive Technology: ICSSIT 2022 :
20-22, January 2022. 2021.".
[4] "Sinricpro, “GitHub - sinricpro/esp8266-esp32-sdk:
Library for https://sinric.pro - simple way to connect
your device to Alexa, Google Home, SmartThings and
cloud,” GitHub. https://github.com/sinricpro/esp8266-
esp32-sdk".
[5] "Bblanchon, “GitHub - bblanchon/ArduinoJson:
JSON library for Arduino and embedded C++. Simple
and efficient.,” GitHub.
https://github.com/bblanchon/ArduinoJson".
Figure 15: Light turn on according to the command [6] "Links, “GitHub - Links2004/arduinoWebSockets:
arduinoWebSockets,” GitHub.
https://github.com/Links2004/arduinoWebSockets".
Table 1: Data Table [7] "Arduino-Libraries, “GitHub - arduino-
libraries/NTPClient: Connect to a NTP server,”
S/N Load output Control (Manual, GitHub. https://github.com/arduino-
Virtual, Voice libraries/NTPClient".
command) [8] "Artificial intelligence and evolutionary computations
1 Bulb on ok ok ok in engineering systems. 2018. doi: 10.1007/978-981-
10-7868-2.".
[9] "Y. Irawan and R. Wahyuni, “Electronic Equipment
Control System for Households by using Android
2 Bulb on ok ok ok Based on IoT (Internet of Things),” Journal of
Physics, vol. 1783, p. 012094, Feb. 2021, doi:
10.1088/1742-6596/1783/1/012094.".
3 Fan on ok ok ok
[10] "W. Al-Zaidi, F. A. Shaban, and D. Q. M, “Internet of
Things in Enhancing Competitive Capabilities: An
Exploratory study,” International Journal of
Management Science and Business Administration,
VI. CONCLUSION vol. 8, no. 2, pp. 25–32, Jan. 2022, doi:
This paper presents the implementation of a cloud- 10.18775/ijmsba.18".
based home automation system. With the use of home [11] "M. Lab, “ESP8266 pinout reference and how to use
automation technology, electrical equipment like lights, GPIO pins,” Microcontrollers Lab, Apr. 04, 2021.
refrigerators, and water heaters that need a 220/240V 50Hz https://microcontrollerslab.com/esp8266-pinout-
power source can be remotely controlled from any location reference-gpio-pins/".
in the globe. The microcontroller (ESP8266) is given a [12] "Subhajit, “Smart Home with Google Assistant &
voice command or physical switch instruction to accomplish Alexa using NodeMCU ESP8266 - IotCircuitHub,”
this. This study described the design, manufacture, and IotCircuitHub, Nov. 18, 2022.
installation of a lightweight, user-friendly, and portable https://iotcircuithub.com/smart-home-with-google-
automation system. The Internet of Things A home system assistant-alexa/".
can be easily installed in a real house to allow for real-time
home condition monitoring and appliance management.
VII. REFERENCES
[1] "W. A. Jabbar et al., "Design and Fabrication of Smart
Home With Internet of Things Enabled Automation
System," in IEEE Access, vol. 7, pp. 144059-144074,
2019, doi: 10.1109/ACCESS.2019.2942846.".
[2] "J. E. Tejada and J. C. Copa-Pineda, “Low-Cost and
Energy-Efficient Alternatives for Home Automation
using IoT,” International Journal of Interactive Mobile
Technologies, vol. 16, no. 05, pp. 153–168, Mar.
2022, doi: 10.3991/ijim.v16i05.25575.".
View publication stats