SlideShare a Scribd company logo
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 1 S.R.G.P.T.C Thriprayar
CHAPTER 1
INTRODUCTION
The main objective of this project is to develop a home automation system
using an Arduino board with Bluetooth being remotely controlled by any Android OS
Smartphone. Modern houses are gradually shifting from conventional switches to
centralized control system, involving remote controlled switches. Ever thought of a
life where you could just command your home appliances to work as you need just by
using your mobile phone? In this short tutorial I’m going to show you how you can
control your electronic appliances like T.V, fans, light set cover the internet with your
mobile phone and that to under a low budget. You can follow this tutorial even if you
have no prior knowledge about Programming or Node MCU.
So let’s begin learning Home Automation Using NodeMCU and sinric pro.
Home automation is anything that enables you to use your home’s lighting, heating
and appliances more conveniently and efficiently. It can be as simple as remote or
automatic control of a few lights, or it can be a complete system that controls all
major parts of your home. Custom set to your own personal preference. It focuses on
wireless home automation technologies - these are easy to retrofit into existing homes
now need for new wiring and no ripping up the carpets or drilling holes in the walls.
Each technology has its own unique features and benefits that makes some more
suited to particular applications, whilst others can be seen for all general home
automation installations.
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 2 S.R.G.P.T.C Thriprayar
CHAPTER 2
CIRCUIT DIAGRAM
Fig.2.1 Circuit Diagram
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 3 S.R.G.P.T.C Thriprayar
2.1 WORKING
The Home Automation System is operating with NodeMCU ESP8266
controller and the command is given by the sinric pro application in a mobile phone
using the WiFi network. The NodeMCU ESP8266 has an inbuilt WiFi module and the
devices connected with Home Automation System. Both WiFi is connected with an
authentication token. The heart of today’s project is the WiFi enabled board that needs
no introduction to the ESP8266 based NodeMCU_development board. It is an open
source platform for developing WiFi based embedded systems and it is based on the
popular ESP8266 WiFi module, running the NodeMCU firmware. NodeMCU was
born out of the desire to overcome the limitations associated with the first versions of
the ESP8266 module which was not compatible with breadboards. It was difficult to
power and even more difficult to program. The NodeMCU board is easy to use. Low
cost and that quickly endeared it to the heart of makers and it is one of the most
popular boards today. For this project two channel relay modules are added to the
ESP8266 board. The project flow involves the control of NodeMCU’s GPIO
from a webpage on any device connected on the same network as the board. The
status of the GPIO’s control the coil of the relays and causes the relay to alternate
between normally open(NO) and normally close(NC) condition depending on the
state of the GPIO, thus effectively turning the connected appliance “ ON” or “ OFF”.
Now the operation is gone by giving supply either Micro USB or Vin, GND. It can
operate by sinric pro application in mobile phone. The Hardware is well operated
according to our action.
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 4 S.R.G.P.T.C Thriprayar
CHAPTER 3
COMPONENTS USED
 ESP8266
 Relay
 Connecting wires
 Mobile phone
 Sinric Pro
 Wi-Fi router or mobile Hotpost
 Bulb
3.1 ESP8266
ESP8266 board is a low cost Wi-Fi module, is a self contained System-On-
Chip with integrated TCP/IP protocol stack that can give any microcontroller access
to your WiFi network. The ESP8266 is capable of either hosting an application or
offloading all Wi-Fi networking functions from another application processor.
Fig.3.1 Pin Diagram of Node MCU
The chip first came to the attention of Western makers in August 2014 with
the ESP- 01 module, made by a third-party manufacturer Ai-Thinker. This small
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 5 S.R.G.P.T.C Thriprayar
module allows microcontroller to connect to a Wi-Fi network and make simple
TCP/IP connections using Hayes style commands. However, at first there was almost
no English-language documentation on the chip and the commands it accepted. The
very low price and the fact that there were very few external components on the
module, which suggested that it could eventually be very inexpensive in volume,
attracted many hackers to explore the module, the chip, and the software on it, as well
as to translate the Chinese documentation.
3.2 RELAY
Relay is an electrically operated switch. It consists of a set of input terminals
for a signal or multiple control signals, and a set of operating contact terminals. The
switch may have any number of contacts or multiple contact forms, such as make
contacts, break contacts, or combinations thereof.
Fig.3.2 Relay
Fig.3.3 Top View of 8-Channel Relay
Relay are used where it is necessary to control a circuit by an independent
low-power signal, or where several circuits must be controlled by one signal. Relays
were first used in long-distance telegraph circuits as signal repeaters: they refresh the
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 6 S.R.G.P.T.C Thriprayar
signal coming in from one circuit by transmitting it on another circuit. Relays were
used extensively in telephone exchanges and early computers to perform logical
operations.
3.3 CONNECTING WIRES
Connecting wires, allows an electrical current or signal to travel from one
point on a circuit to another because signal or current needs a medium through which
to move. In basic circuits, the wire comes from one terminal of a power source, such
as a battery.
Fig.3.4 Jumper Wire
3.4 WiFi HOTSPOT
WiFi hotspot is simply an area with an accessible wireless network. The term
is most often used to refer to wireless networks in public areas like airports and coffee
shops. Users can even create their own mobile hotspot using a cell phone or an
external device that can connect to a cellular network.
Fig.3.5 WiFi Hotspot
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 7 S.R.G.P.T.C Thriprayar
3.5 SINRIC PRO
Fig.3.6 Sinric Pro
First Create account in www.SinricPro.com. Now, create a dashboard at Sinric
Pro. This dashboard is a user interface to control things remotely. Then add the
devices required to operate and it now shows the devices and their state(i.e., Offline /
Online
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 8 S.R.G.P.T.C Thriprayar
CHAPTER 4
FLOWCHART
Fig.4.1 Flowchart
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 9 S.R.G.P.T.C Thriprayar
4.1 PRODUCT PHOTO
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 10 S.R.G.P.T.C Thriprayar
CHAPTER 5
APPLICATIONS
 Lighting control
 Lawn/Gardening management
 Smart home appliances
 Improved home safety and security
 Home air quality and water quality monitoring
 Better infotainment delivery
 Most preferable language based voice assistant
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 11 S.R.G.P.T.C Thriprayar
CHAPTER 6
ADVANTAGES & DISADVANTAGES
6.1 ADVANTAGES
 It can operate anywhere through the world.
 Security against burglars.
 It is available at low cost.
 Managing all of your home devices from one place. The convenience factor
here is enormous.
 Flexibility for new devices and appliances.
 Maximizing home security.
 Remote control of home functions.
 Increased energy efficiency.
 Improved appliance functionality.
 Home management insight.
6.2 DISADVANTAGES
 Due to improper network connection may lead to failure of working.
 Those who don’t afford WiFi connection bills, they can’t buy these products.
 Cost, The disadvantage of a smart home system or Home automation system is
the cost. There are quite a number or companies that provide smart home
systems, but all of them are quite expensive. This also might be expensive.
 Dependency on the internet, the basic requirement for the smart home system
is the internet.
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 12 S.R.G.P.T.C Thriprayar
CHAPTER 7
FUTURE SCOPE
The system can be expanded to include various other options which could
include home security features like capturing the photo of a person moving around the
house and storing it onto the cloud. This will reduce the data storage that using the
CCTV camera which will record all the time and stores it. The system can be
expanded for energy monitoring or weather stations. This kind of a system with
respective changes can be implemented in the hospitals for disable people or in
industries where human invasion is impossible or dangerous and it can also be
implemented for environmental monitoring. Future scope for the home automation
systems involves making homes even smarter. Homes can be interfaced with sensors
including motion sensors, light sensors and temperature sensors and provide
automated toggling of devices based on conditions. Home automation offers a global
standard for interoperable products. The home automation market is primarily driven
by growing need for effective solutions in various domestic applications such as
lighting, safety and security, energy management, entertainment, heating, ventilation,
and air conditioning
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 13 S.R.G.P.T.C Thriprayar
CHAPTER 8
CONCLUSION
The system as the name indicates “Home automation” makes the system more
flexible and provides attractive user interface compared to other home automation
systems. In this system we integrate mobile devices into home automation systems. A
novel architecture for a home automation system is proposed using the relatively new
communication technologies. We hide the complexity of the notions involved in the
home automation system by including them into a simple, but comprehensive set of
related concepts. This simplification is needed to fit as much of the functionality on
the limited space offered by a mobile device’s display. This paper proposes a low
cost, secure, ubiquitously accessible, auto configurable, remotely controlled solution.
The approach discussed in the paper is novel and has achieved the target to control
home appliances remotely using the WiFi technology to connects system parts,
satisfying user needs and requirements. WiFi technology capable solution has proved
to be controlled remotely, provide home security and is cost-effective as compared to
the previously existing systems. Hence we can conclude that the required goals and
objectives of home automation system have been achieved. The system design and
architecture were discussed, and prototype presents the basic level of home appliance
control and remote monitoring has been implemented. Finally, the proposed system is
better from the scalability and flexibility point of view than the commercially
available home automation systems.
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 14 S.R.G.P.T.C Thriprayar
CHAPTER 9
REFERENCE
1. Andrea Zanella, Nicola Bui, Angelo Catellani, Lorenzo Vangelista, Michle
Zorzi, “Internet of Things for Smart Cities,” in IEEE Internet of Things
journal, Vol.1, No.1, February, 2014.
2. Sean Dieter, Tebje Kelly, Nagender Kumar Suryadevara, And Subhas Chandra
mukhopadhyay, “towards the Implemtation of IOT for environmental
condition and Monitoring in home” in IEEE sensors Journal Vol.13, No.10,
2013.
3. Internet of Things. https://en.wikipedia.org/wiki/Internet_of_Things.
4. Gopinath Marrapan. (2015). an inexpensive IOT enabler using ESP8266.
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 15 S.R.G.P.T.C Thriprayar
CHAPTER 10
PROGRAM CODE
/*
* ADVANCED example for: how to use up to N SinricPro Switch devices on one
ESP module
* to control N relays and N flipSwitches for manually control:
* - setup N SinricPro switch devices
* - setup N relays
* - setup N flipSwitches to control relays manually
* (flipSwitch can be a tactile button or a toggle switch and is setup in line #52)
*
* - handle request using just one callback to switch relay
* - handle flipSwitches to switch relays manually and send event to sinricPro server
*
* - SinricPro deviceId and PIN configuration for relays and buttins is done in
std::map<String, deviceConfig_t> devices
*
* If you encounter any issues:
* - check the readme.md at https://github.com/sinricpro/esp8266-esp32-
sdk/blob/master/README.md
* - ensure all dependent libraries are installed
* - see https://github.com/sinricpro/esp8266-esp32-
sdk/blob/master/README.md#arduinoide
* - see https://github.com/sinricpro/esp8266-esp32-
sdk/blob/master/README.md#dependencies
* - open serial monitor and check whats happening
* - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
* - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing
issues or open a new one
*/
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 16 S.R.G.P.T.C Thriprayar
#define ENABLE_DEBUG
#ifdef ENABLE_DEBUG
#define DEBUG_ESP_PORT Serial
#define NODEBUG_WEBSOCKETS
#define NDEBUG
#endif
#include <Arduino.h>
#ifdef ESP8266
#include <ESP8266WiFi.h>
#endif
#ifdef ESP32
#include <WiFi.h>
#endif
#include "SinricPro.h"
#include "SinricProSwitch.h"
#include <map>
#define WIFI_SSID "MCU"
#define WIFI_PASS "r1wgh4k6"
#define APP_KEY "7ad4db40-56b8-4454-a90e-fe64c4e502a3"
#define APP_SECRET "47ae5cc8-9631-4689-8623-515f1ff9f6f2-d7b1e37a-
1884-4a44-8e17-2c777a4ffe99"
// comment the following line if you use a toggle switches instead of tactile buttons
#define BAUD_RATE 115200
#define DEBOUNCE_TIME 250
#define RELAYPIN_1 GP
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 17 S.R.G.P.T.C Thriprayar
typedef struct { // struct for the std::map below
int relayPIN;
int flipSwitchPIN;
bool activeLow;
} deviceConfig_t;
// this is the main configuration
// please put in your deviceId, the PIN for Relay and PIN for flipSwitch
// this can be up to N devices...depending on how much pin's available on your device
;)
// right now we have 4 devicesIds going to 4 relays and 4 flip switches to switch the
relay manually
std::map<String, deviceConfig_t> devices = {
//{deviceId, {relayPIN, flipSwitchPIN, activeLow}}
{"62c3271bad95bfbcdf35e064", { D1, D8, false }},
};
typedef struct { // struct for the std::map below
String deviceId;
bool lastFlipSwitchState;
unsigned long lastFlipSwitchChange;
bool activeLow;
} flipSwitchConfig_t;
std::map<int, flipSwitchConfig_t> flipSwitches; // this map is used to map
flipSwitch PINs to deviceId and handling debounce and last flipSwitch state checks
// it will be setup in "setupFlipSwitches" function,
using informations from devices map
void setupRelays() {
for (auto &device : devices) { // for each device (relay, flipSwitch
combination)
int relayPIN = device.second.relayPIN; // get the relay pin
pinMode(relayPIN, OUTPUT); // set relay pin to OUTPUT
}
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 18 S.R.G.P.T.C Thriprayar
}
void setupFlipSwitches() {
for (auto &device : devices) { // for each device (relay / flipSwitch
combination)
flipSwitchConfig_t flipSwitchConfig; // create a new flipSwitch
configuration
flipSwitchConfig.deviceId = device.first; // set the deviceId
flipSwitchConfig.lastFlipSwitchChange = 0; // set debounce time
flipSwitchConfig.lastFlipSwitchState = false; // set lastFlipSwitchState to false
(LOW)
int flipSwitchPIN = device.second.flipSwitchPIN; // get the flipSwitchPIN
bool activeLow = device.second.activeLow; // set the activeLow
flipSwitchConfig.activeLow = activeLow;
flipSwitches[flipSwitchPIN] = flipSwitchConfig; // save the flipSwitch config to
flipSwitches map
if(activeLow) {
pinMode(flipSwitchPIN, INPUT_PULLUP); // set the flipSwitch pin to
INPUT_PULLUP
}
else {
pinMode(flipSwitchPIN, INPUT); // set the flipSwitch pin to INPUT
}
}
}
bool onPowerState(String deviceId, bool &state) {
Serial.printf("%s: %srn", deviceId.c_str(), state ? "on" : "off");
int relayPIN = devices[deviceId].relayPIN; // get the relay pin for corresponding
device
digitalWrite(relayPIN, state); // set the new relay state
return true;
}
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 19 S.R.G.P.T.C Thriprayar
void handleFlipSwitches() {
unsigned long actualMillis = millis(); // get actual millis
for (auto &flipSwitch : flipSwitches) { // for each
flipSwitch in flipSwitches map
unsigned long lastFlipSwitchChange = flipSwitch.second.lastFlipSwitchChange; //
get the timestamp when flipSwitch was pressed last time (used to debounce / limit
events)
if (actualMillis - lastFlipSwitchChange > DEBOUNCE_TIME) { // if
time is > debounce time...
int flipSwitchPIN = flipSwitch.first; // get the flipSwitch
pin from configuration
bool lastFlipSwitchState = flipSwitch.second.lastFlipSwitchState; // get the
lastFlipSwitchState
bool activeLow = flipSwitch.second.activeLow;
bool flipSwitchState = digitalRead(flipSwitchPIN); // read the
current flipSwitch state
if(activeLow) flipSwitchState = !flipSwitchState;
if (flipSwitchState != lastFlipSwitchState) { // if the
flipSwitchState has changed...
#ifdef TACTILE_BUTTON
if (flipSwitchState) { // if the tactile button is
pressed
#endif
flipSwitch.second.lastFlipSwitchChange = actualMillis; // update
lastFlipSwitchChange time
String deviceId = flipSwitch.second.deviceId; // get the
deviceId from config
int relayPIN = devices[deviceId].relayPIN; // get the relayPIN
from config
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 20 S.R.G.P.T.C Thriprayar
bool newRelayState = !digitalRead(relayPIN); // set the new
relay State
digitalWrite(relayPIN, newRelayState); // set the trelay to
the new state
SinricProSwitch &mySwitch = SinricPro[deviceId]; // get Switch
device from SinricPro
mySwitch.sendPowerStateEvent(newRelayState); // send the
event
#ifdef TACTILE_BUTTON
}
#endif
flipSwitch.second.lastFlipSwitchState = flipSwitchState; // update
lastFlipSwitchState
}
}
}
}
void setupWiFi() {
Serial.printf("rn[Wifi]: Connecting");
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED)
{
Serial.printf(".");
delay(250);
}
Serial.printf("connected!rn[WiFi]: IP-Address is %srn",
WiFi.localIP().toString().c_str());
}
void setupSinricPro() {
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 21 S.R.G.P.T.C Thriprayar
for (auto &device : devices) {
const char *deviceId = device.first.c_str();
SinricProSwitch &mySwitch = SinricPro[deviceId];
mySwitch.onPowerState(onPowerState);
}
SinricPro.restoreDeviceStates(true); // restore the last known state from the server.
SinricPro.begin(APP_KEY, APP_SECRET);
}
void setup() {
Serial.begin(BAUD_RATE);
setupRelays();
setupFlipSwitches();
setupWiFi();
setupSinricPro();
}
void loop() {
SinricPro.handle();
handleFlipSwitches();
}
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 22 S.R.G.P.T.C Thriprayar
CHAPTER 11
5S (SEIRI, SEITON, SEISO, SEIKETSU, SHITSUKE)
5S creates the foundation for a visual work place
5S is a method of creating a self-sustaining culture which perpetuates a neat,
clean, efficient workplace; a method for removing all excess materials and tools from
the workplace and organizing the required items such that they are easy to find, use,
and maintain.
The term 5S comes from five Japanese words: Seiri, Seiton, Seiso, Seiketsu
Shitsuke. In English, these words are often translated to Sort, Set in Order, Shine,
Standardize, Sustain.
Sort (Seiri) :- No unnecessary items at the workplace.
 Set in Order (Seiton) :- Anyone can instantly find, take, and return any needed
item: “A place for everything, and everything in its place”.
 Shine (Seiso):- Deviations become visual by cleaning.
 Standardize (Seiketsu):- Visualize the 5S standards in the workplace.
 Sustain (Shitsuke):- Everybody follows the standard until we have a better one
.
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 23 S.R.G.P.T.C Thriprayar
Why implement 5S?
 Improves safety
 Improves productivity
 Promotes flow
 Eliminates distractions
 Reduces searching
 Reduces space
 Reduces unplanned downtime
 Improve quality
 Exposes problems
 Encourages visual control
 Tackles waste
 Enhances teamwork
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 24 S.R.G.P.T.C Thriprayar
11.1 SORT
Sort means that you remove all items from the workplace that are not needed for
current production or transactional operations. This essentially involves segregating
items of immediate use from items that are not needed.
Examples of Sort:-
 Defective or excess unneeded items that accumulate
 Outdated or broken jigs and dies
 Worn-out bits,
 Outdated or broken tools or inspection equipment
 Old rags and other cleaning supplies
 Electrical tools/equipment with broken cords
 Outdated posters, signs and notices
Red Tag Method:-A method of identifying and removing all unneeded items from
the workplace through the use of red tags as a visual control.
 Attach a red tag to each item that is unneeded or does not belong in the area.
 Attach a red tag to each item that belongs in the area but DOES NOT have an
identified storage area.
 Fill out each tag to describe what each item is and why it was tagged.
 Record all the tags and their description in the “5S Tag Log.”
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 25 S.R.G.P.T.C Thriprayar
11.2 SET IN ORDER
Set in order means that you arrange the items that are needed in the area and
identify them or label them so that anyone can find them or put them away.
Benefits of Set in Order:-
 Person sent to find something, finds it easily
 Time spent looking for things is reduced
 Wrong parts are not retrieved in error
 Adequate space is allocated for storage of items
 Items have “their place” and not not left in walkways, etc.
Implementing Set in Order:-
 Store items together if they are used together, and store them in the sequence they
are used.
 If tools are being set in order, design a system that keeps the tools in their
location.
 Store infrequently used items away from the point of use. Example of Set in Order
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 26 S.R.G.P.T.C Thriprayar
11.3 SHINE
Shine emphasizes removing the dirt, grime, and dust from the work area. This is a
program of keeping the work area swept and clean of debris. Floors are swept,
machinery is clean and wiped off and everything in the work area is kept clean.
Benefits of Shine:-
 Defects are easier to see in a well-lit and clean environment
 A work area clean of debris is less likely to cause a tripping hazard.
 Machines that are clean and maintained work more efficiently and break down
less often.
 A clean work area promotes improved morale and instills pride in the team
members
Implementing Shine:-
 Determine the shine targets: what are we going to clean?
 Set a schedule and assign individuals
 Create procedures for continued daily shine processes.
 Set periodic machine inspection and maintenance targets.
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 27 S.R.G.P.T.C Thriprayar
11.4 STANDARDIZE
Creating a consistent way of implementing the tasks that are performed on a daily
basis including “Sort,” “Set in Order,” and “Shine” “Do the right things the right way,
every time!”
Benefits of Standardization:-
 Easier to train new employees
 Less room for errors and scrap
 Work area is more organized
 Work area is safer
Implementing Standardization:-
 Integrate the benefits found through Sort, Set in Order, and Shine into the
 everyday work activity
 Make it a way of life
 It should be easily noticed when items are not in their place
 Keep it “visual”
 All 5S activities should be scheduled at the frequency rate necessary to
maintain a clean, orderly, and safe work environment.
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 28 S.R.G.P.T.C Thriprayar
11.5 SUSTAIN
Sustain means that the 5S mentality is ingrained in everyday work life and
procedures. It means that the 5S program has a discipline that ensures its continued
success .Sustain involves making a habit of maintaining correct procedures.
Benefits of Sustain:-
 Cleaner, safer, working environment
 Detailed tasks are documented to make processes more efficient
 Work place is maintained in an organized fashion without clutter
 Tools and materials are easier to find
 Higher employee morale
Implementing Sustain:
 Keep everyone aware of 5S and its benefits
 Make time each day to perform daily tasks
 Make it structured
 Give recognition where it is due
 Establish audit for 5S review
Mini Project Report 2022 Home Automation using NodeMCU
Dept. of Electronics Engineering 29 S.R.G.P.T.C Thriprayar
11.6 5S SUMMARY
5S is a process and method for creating and maintaining an organized, clean, and high
performance workplace. It enables anyone to distinguish between normal and
abnormal conditions at a glance. It is the foundation for continuous improvement,
zero defects, cost reduction, and a safe work area. It is a systematic way to improve
the workplace, our processes, and our products through production line employee
involvement. It must become part of everyone's job.

More Related Content

PPTX
P, PI AND PID CONTROLLER
PPTX
Presentation on Ethical Hacking ppt
PPTX
Density based traffic signal system
PDF
Automatic Power Factor Corrector Using Arduino report
PDF
Project Report
PPTX
Single AXIs Smart SOLAR TRACKING SYSTEM USING ARDUINO
PPT
Interview skills
PPTX
Motion for class 9th
P, PI AND PID CONTROLLER
Presentation on Ethical Hacking ppt
Density based traffic signal system
Automatic Power Factor Corrector Using Arduino report
Project Report
Single AXIs Smart SOLAR TRACKING SYSTEM USING ARDUINO
Interview skills
Motion for class 9th

What's hot (20)

PDF
Iot projects 2021-2022
PPTX
IOT PPT
PPTX
Iot based home automation
PPTX
Home automation using wifi
PPTX
Smart metering infrastructure Architecture and analytics
PPTX
Iot operated wheel chair / smart wheelchair
PPTX
Home automation using arduino
PPTX
SMART HOME AUTOMATION USING MOBILE APPLICATION
PPTX
Home automation
PDF
Driver Drowsiness Detection report
PPTX
Sources of IoT (JNTUK - UNIT 1)
PPTX
Home automation using IOT
PPTX
Home automation
PPTX
Drowsiness detection ppt
PPT
THE INTERNET OF THINGS
PPTX
Driver drowsiness detection
PPTX
Home automation using IoT literature review ppt
PPTX
Drowsiness State Detection of Driver using Eyelid Movement- IRE Journal Confe...
PPTX
IoT BASED SMART HOME USING ARDUINO
PDF
IoT ecosystem
Iot projects 2021-2022
IOT PPT
Iot based home automation
Home automation using wifi
Smart metering infrastructure Architecture and analytics
Iot operated wheel chair / smart wheelchair
Home automation using arduino
SMART HOME AUTOMATION USING MOBILE APPLICATION
Home automation
Driver Drowsiness Detection report
Sources of IoT (JNTUK - UNIT 1)
Home automation using IOT
Home automation
Drowsiness detection ppt
THE INTERNET OF THINGS
Driver drowsiness detection
Home automation using IoT literature review ppt
Drowsiness State Detection of Driver using Eyelid Movement- IRE Journal Confe...
IoT BASED SMART HOME USING ARDUINO
IoT ecosystem
Ad

Similar to Home Automation using NodeMCU .docx (20)

PPTX
Deigne and Construction Smart Remote(Smart Phone ) base Home appliance contr...
PDF
IRJET- Designing of Smart Switch for Home Automation
PDF
IRJET- Android based Home Automation using Bluetooth Technology
PDF
IRJET- Android based Home Automation using Bluetooth Technology
PDF
Home Automation Using NodeMCU ESP8266 project
PDF
IRJET - Bluetooth based Digital Notice Board with Solar
PDF
btect ece branch pdf for project report of home automation .pdf
PPTX
Presentation 2.pptx
PPTX
Home automation using blynk app with fan direction control and displaying sta...
PDF
Domotics – A Cost Effective Smart Home Automation System Using Wifi as Networ...
PDF
GOOGLE ASSISTANCE BASED HOME AUTOMATION
PDF
2. UJRRA_22_03.pdf
PDF
IRJET - Bluetooth based Digital Notice Board with Solar
PPTX
Home automation
PDF
IRJET - Home Automation using GSM
PDF
IRJET-Wireless Controlling of Remote Electrical Device using Android Smartphone
PDF
Connecting Home Appliances via Bluetooth using IoT
PDF
Communication Methods to build Smart Home Monitoring System: A Survey
PDF
Communication Methods to build Smart Home Monitoring System: A Survey
PDF
Bluetooth based home automation system
Deigne and Construction Smart Remote(Smart Phone ) base Home appliance contr...
IRJET- Designing of Smart Switch for Home Automation
IRJET- Android based Home Automation using Bluetooth Technology
IRJET- Android based Home Automation using Bluetooth Technology
Home Automation Using NodeMCU ESP8266 project
IRJET - Bluetooth based Digital Notice Board with Solar
btect ece branch pdf for project report of home automation .pdf
Presentation 2.pptx
Home automation using blynk app with fan direction control and displaying sta...
Domotics – A Cost Effective Smart Home Automation System Using Wifi as Networ...
GOOGLE ASSISTANCE BASED HOME AUTOMATION
2. UJRRA_22_03.pdf
IRJET - Bluetooth based Digital Notice Board with Solar
Home automation
IRJET - Home Automation using GSM
IRJET-Wireless Controlling of Remote Electrical Device using Android Smartphone
Connecting Home Appliances via Bluetooth using IoT
Communication Methods to build Smart Home Monitoring System: A Survey
Communication Methods to build Smart Home Monitoring System: A Survey
Bluetooth based home automation system
Ad

Recently uploaded (20)

PDF
PPT on Performance Review to get promotions
PPTX
additive manufacturing of ss316l using mig welding
DOCX
573137875-Attendance-Management-System-original
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Lecture Notes Electrical Wiring System Components
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Well-logging-methods_new................
PPTX
Welding lecture in detail for understanding
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPT on Performance Review to get promotions
additive manufacturing of ss316l using mig welding
573137875-Attendance-Management-System-original
UNIT 4 Total Quality Management .pptx
CH1 Production IntroductoryConcepts.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Lecture Notes Electrical Wiring System Components
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Well-logging-methods_new................
Welding lecture in detail for understanding
OOP with Java - Java Introduction (Basics)
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
R24 SURVEYING LAB MANUAL for civil enggi

Home Automation using NodeMCU .docx

  • 1. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 1 S.R.G.P.T.C Thriprayar CHAPTER 1 INTRODUCTION The main objective of this project is to develop a home automation system using an Arduino board with Bluetooth being remotely controlled by any Android OS Smartphone. Modern houses are gradually shifting from conventional switches to centralized control system, involving remote controlled switches. Ever thought of a life where you could just command your home appliances to work as you need just by using your mobile phone? In this short tutorial I’m going to show you how you can control your electronic appliances like T.V, fans, light set cover the internet with your mobile phone and that to under a low budget. You can follow this tutorial even if you have no prior knowledge about Programming or Node MCU. So let’s begin learning Home Automation Using NodeMCU and sinric pro. Home automation is anything that enables you to use your home’s lighting, heating and appliances more conveniently and efficiently. It can be as simple as remote or automatic control of a few lights, or it can be a complete system that controls all major parts of your home. Custom set to your own personal preference. It focuses on wireless home automation technologies - these are easy to retrofit into existing homes now need for new wiring and no ripping up the carpets or drilling holes in the walls. Each technology has its own unique features and benefits that makes some more suited to particular applications, whilst others can be seen for all general home automation installations.
  • 2. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 2 S.R.G.P.T.C Thriprayar CHAPTER 2 CIRCUIT DIAGRAM Fig.2.1 Circuit Diagram
  • 3. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 3 S.R.G.P.T.C Thriprayar 2.1 WORKING The Home Automation System is operating with NodeMCU ESP8266 controller and the command is given by the sinric pro application in a mobile phone using the WiFi network. The NodeMCU ESP8266 has an inbuilt WiFi module and the devices connected with Home Automation System. Both WiFi is connected with an authentication token. The heart of today’s project is the WiFi enabled board that needs no introduction to the ESP8266 based NodeMCU_development board. It is an open source platform for developing WiFi based embedded systems and it is based on the popular ESP8266 WiFi module, running the NodeMCU firmware. NodeMCU was born out of the desire to overcome the limitations associated with the first versions of the ESP8266 module which was not compatible with breadboards. It was difficult to power and even more difficult to program. The NodeMCU board is easy to use. Low cost and that quickly endeared it to the heart of makers and it is one of the most popular boards today. For this project two channel relay modules are added to the ESP8266 board. The project flow involves the control of NodeMCU’s GPIO from a webpage on any device connected on the same network as the board. The status of the GPIO’s control the coil of the relays and causes the relay to alternate between normally open(NO) and normally close(NC) condition depending on the state of the GPIO, thus effectively turning the connected appliance “ ON” or “ OFF”. Now the operation is gone by giving supply either Micro USB or Vin, GND. It can operate by sinric pro application in mobile phone. The Hardware is well operated according to our action.
  • 4. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 4 S.R.G.P.T.C Thriprayar CHAPTER 3 COMPONENTS USED  ESP8266  Relay  Connecting wires  Mobile phone  Sinric Pro  Wi-Fi router or mobile Hotpost  Bulb 3.1 ESP8266 ESP8266 board is a low cost Wi-Fi module, is a self contained System-On- Chip with integrated TCP/IP protocol stack that can give any microcontroller access to your WiFi network. The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor. Fig.3.1 Pin Diagram of Node MCU The chip first came to the attention of Western makers in August 2014 with the ESP- 01 module, made by a third-party manufacturer Ai-Thinker. This small
  • 5. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 5 S.R.G.P.T.C Thriprayar module allows microcontroller to connect to a Wi-Fi network and make simple TCP/IP connections using Hayes style commands. However, at first there was almost no English-language documentation on the chip and the commands it accepted. The very low price and the fact that there were very few external components on the module, which suggested that it could eventually be very inexpensive in volume, attracted many hackers to explore the module, the chip, and the software on it, as well as to translate the Chinese documentation. 3.2 RELAY Relay is an electrically operated switch. It consists of a set of input terminals for a signal or multiple control signals, and a set of operating contact terminals. The switch may have any number of contacts or multiple contact forms, such as make contacts, break contacts, or combinations thereof. Fig.3.2 Relay Fig.3.3 Top View of 8-Channel Relay Relay are used where it is necessary to control a circuit by an independent low-power signal, or where several circuits must be controlled by one signal. Relays were first used in long-distance telegraph circuits as signal repeaters: they refresh the
  • 6. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 6 S.R.G.P.T.C Thriprayar signal coming in from one circuit by transmitting it on another circuit. Relays were used extensively in telephone exchanges and early computers to perform logical operations. 3.3 CONNECTING WIRES Connecting wires, allows an electrical current or signal to travel from one point on a circuit to another because signal or current needs a medium through which to move. In basic circuits, the wire comes from one terminal of a power source, such as a battery. Fig.3.4 Jumper Wire 3.4 WiFi HOTSPOT WiFi hotspot is simply an area with an accessible wireless network. The term is most often used to refer to wireless networks in public areas like airports and coffee shops. Users can even create their own mobile hotspot using a cell phone or an external device that can connect to a cellular network. Fig.3.5 WiFi Hotspot
  • 7. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 7 S.R.G.P.T.C Thriprayar 3.5 SINRIC PRO Fig.3.6 Sinric Pro First Create account in www.SinricPro.com. Now, create a dashboard at Sinric Pro. This dashboard is a user interface to control things remotely. Then add the devices required to operate and it now shows the devices and their state(i.e., Offline / Online
  • 8. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 8 S.R.G.P.T.C Thriprayar CHAPTER 4 FLOWCHART Fig.4.1 Flowchart
  • 9. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 9 S.R.G.P.T.C Thriprayar 4.1 PRODUCT PHOTO
  • 10. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 10 S.R.G.P.T.C Thriprayar CHAPTER 5 APPLICATIONS  Lighting control  Lawn/Gardening management  Smart home appliances  Improved home safety and security  Home air quality and water quality monitoring  Better infotainment delivery  Most preferable language based voice assistant
  • 11. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 11 S.R.G.P.T.C Thriprayar CHAPTER 6 ADVANTAGES & DISADVANTAGES 6.1 ADVANTAGES  It can operate anywhere through the world.  Security against burglars.  It is available at low cost.  Managing all of your home devices from one place. The convenience factor here is enormous.  Flexibility for new devices and appliances.  Maximizing home security.  Remote control of home functions.  Increased energy efficiency.  Improved appliance functionality.  Home management insight. 6.2 DISADVANTAGES  Due to improper network connection may lead to failure of working.  Those who don’t afford WiFi connection bills, they can’t buy these products.  Cost, The disadvantage of a smart home system or Home automation system is the cost. There are quite a number or companies that provide smart home systems, but all of them are quite expensive. This also might be expensive.  Dependency on the internet, the basic requirement for the smart home system is the internet.
  • 12. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 12 S.R.G.P.T.C Thriprayar CHAPTER 7 FUTURE SCOPE The system can be expanded to include various other options which could include home security features like capturing the photo of a person moving around the house and storing it onto the cloud. This will reduce the data storage that using the CCTV camera which will record all the time and stores it. The system can be expanded for energy monitoring or weather stations. This kind of a system with respective changes can be implemented in the hospitals for disable people or in industries where human invasion is impossible or dangerous and it can also be implemented for environmental monitoring. Future scope for the home automation systems involves making homes even smarter. Homes can be interfaced with sensors including motion sensors, light sensors and temperature sensors and provide automated toggling of devices based on conditions. Home automation offers a global standard for interoperable products. The home automation market is primarily driven by growing need for effective solutions in various domestic applications such as lighting, safety and security, energy management, entertainment, heating, ventilation, and air conditioning
  • 13. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 13 S.R.G.P.T.C Thriprayar CHAPTER 8 CONCLUSION The system as the name indicates “Home automation” makes the system more flexible and provides attractive user interface compared to other home automation systems. In this system we integrate mobile devices into home automation systems. A novel architecture for a home automation system is proposed using the relatively new communication technologies. We hide the complexity of the notions involved in the home automation system by including them into a simple, but comprehensive set of related concepts. This simplification is needed to fit as much of the functionality on the limited space offered by a mobile device’s display. This paper proposes a low cost, secure, ubiquitously accessible, auto configurable, remotely controlled solution. The approach discussed in the paper is novel and has achieved the target to control home appliances remotely using the WiFi technology to connects system parts, satisfying user needs and requirements. WiFi technology capable solution has proved to be controlled remotely, provide home security and is cost-effective as compared to the previously existing systems. Hence we can conclude that the required goals and objectives of home automation system have been achieved. The system design and architecture were discussed, and prototype presents the basic level of home appliance control and remote monitoring has been implemented. Finally, the proposed system is better from the scalability and flexibility point of view than the commercially available home automation systems.
  • 14. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 14 S.R.G.P.T.C Thriprayar CHAPTER 9 REFERENCE 1. Andrea Zanella, Nicola Bui, Angelo Catellani, Lorenzo Vangelista, Michle Zorzi, “Internet of Things for Smart Cities,” in IEEE Internet of Things journal, Vol.1, No.1, February, 2014. 2. Sean Dieter, Tebje Kelly, Nagender Kumar Suryadevara, And Subhas Chandra mukhopadhyay, “towards the Implemtation of IOT for environmental condition and Monitoring in home” in IEEE sensors Journal Vol.13, No.10, 2013. 3. Internet of Things. https://en.wikipedia.org/wiki/Internet_of_Things. 4. Gopinath Marrapan. (2015). an inexpensive IOT enabler using ESP8266.
  • 15. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 15 S.R.G.P.T.C Thriprayar CHAPTER 10 PROGRAM CODE /* * ADVANCED example for: how to use up to N SinricPro Switch devices on one ESP module * to control N relays and N flipSwitches for manually control: * - setup N SinricPro switch devices * - setup N relays * - setup N flipSwitches to control relays manually * (flipSwitch can be a tactile button or a toggle switch and is setup in line #52) * * - handle request using just one callback to switch relay * - handle flipSwitches to switch relays manually and send event to sinricPro server * * - SinricPro deviceId and PIN configuration for relays and buttins is done in std::map<String, deviceConfig_t> devices * * If you encounter any issues: * - check the readme.md at https://github.com/sinricpro/esp8266-esp32- sdk/blob/master/README.md * - ensure all dependent libraries are installed * - see https://github.com/sinricpro/esp8266-esp32- sdk/blob/master/README.md#arduinoide * - see https://github.com/sinricpro/esp8266-esp32- sdk/blob/master/README.md#dependencies * - open serial monitor and check whats happening * - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk * - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one */
  • 16. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 16 S.R.G.P.T.C Thriprayar #define ENABLE_DEBUG #ifdef ENABLE_DEBUG #define DEBUG_ESP_PORT Serial #define NODEBUG_WEBSOCKETS #define NDEBUG #endif #include <Arduino.h> #ifdef ESP8266 #include <ESP8266WiFi.h> #endif #ifdef ESP32 #include <WiFi.h> #endif #include "SinricPro.h" #include "SinricProSwitch.h" #include <map> #define WIFI_SSID "MCU" #define WIFI_PASS "r1wgh4k6" #define APP_KEY "7ad4db40-56b8-4454-a90e-fe64c4e502a3" #define APP_SECRET "47ae5cc8-9631-4689-8623-515f1ff9f6f2-d7b1e37a- 1884-4a44-8e17-2c777a4ffe99" // comment the following line if you use a toggle switches instead of tactile buttons #define BAUD_RATE 115200 #define DEBOUNCE_TIME 250 #define RELAYPIN_1 GP
  • 17. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 17 S.R.G.P.T.C Thriprayar typedef struct { // struct for the std::map below int relayPIN; int flipSwitchPIN; bool activeLow; } deviceConfig_t; // this is the main configuration // please put in your deviceId, the PIN for Relay and PIN for flipSwitch // this can be up to N devices...depending on how much pin's available on your device ;) // right now we have 4 devicesIds going to 4 relays and 4 flip switches to switch the relay manually std::map<String, deviceConfig_t> devices = { //{deviceId, {relayPIN, flipSwitchPIN, activeLow}} {"62c3271bad95bfbcdf35e064", { D1, D8, false }}, }; typedef struct { // struct for the std::map below String deviceId; bool lastFlipSwitchState; unsigned long lastFlipSwitchChange; bool activeLow; } flipSwitchConfig_t; std::map<int, flipSwitchConfig_t> flipSwitches; // this map is used to map flipSwitch PINs to deviceId and handling debounce and last flipSwitch state checks // it will be setup in "setupFlipSwitches" function, using informations from devices map void setupRelays() { for (auto &device : devices) { // for each device (relay, flipSwitch combination) int relayPIN = device.second.relayPIN; // get the relay pin pinMode(relayPIN, OUTPUT); // set relay pin to OUTPUT }
  • 18. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 18 S.R.G.P.T.C Thriprayar } void setupFlipSwitches() { for (auto &device : devices) { // for each device (relay / flipSwitch combination) flipSwitchConfig_t flipSwitchConfig; // create a new flipSwitch configuration flipSwitchConfig.deviceId = device.first; // set the deviceId flipSwitchConfig.lastFlipSwitchChange = 0; // set debounce time flipSwitchConfig.lastFlipSwitchState = false; // set lastFlipSwitchState to false (LOW) int flipSwitchPIN = device.second.flipSwitchPIN; // get the flipSwitchPIN bool activeLow = device.second.activeLow; // set the activeLow flipSwitchConfig.activeLow = activeLow; flipSwitches[flipSwitchPIN] = flipSwitchConfig; // save the flipSwitch config to flipSwitches map if(activeLow) { pinMode(flipSwitchPIN, INPUT_PULLUP); // set the flipSwitch pin to INPUT_PULLUP } else { pinMode(flipSwitchPIN, INPUT); // set the flipSwitch pin to INPUT } } } bool onPowerState(String deviceId, bool &state) { Serial.printf("%s: %srn", deviceId.c_str(), state ? "on" : "off"); int relayPIN = devices[deviceId].relayPIN; // get the relay pin for corresponding device digitalWrite(relayPIN, state); // set the new relay state return true; }
  • 19. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 19 S.R.G.P.T.C Thriprayar void handleFlipSwitches() { unsigned long actualMillis = millis(); // get actual millis for (auto &flipSwitch : flipSwitches) { // for each flipSwitch in flipSwitches map unsigned long lastFlipSwitchChange = flipSwitch.second.lastFlipSwitchChange; // get the timestamp when flipSwitch was pressed last time (used to debounce / limit events) if (actualMillis - lastFlipSwitchChange > DEBOUNCE_TIME) { // if time is > debounce time... int flipSwitchPIN = flipSwitch.first; // get the flipSwitch pin from configuration bool lastFlipSwitchState = flipSwitch.second.lastFlipSwitchState; // get the lastFlipSwitchState bool activeLow = flipSwitch.second.activeLow; bool flipSwitchState = digitalRead(flipSwitchPIN); // read the current flipSwitch state if(activeLow) flipSwitchState = !flipSwitchState; if (flipSwitchState != lastFlipSwitchState) { // if the flipSwitchState has changed... #ifdef TACTILE_BUTTON if (flipSwitchState) { // if the tactile button is pressed #endif flipSwitch.second.lastFlipSwitchChange = actualMillis; // update lastFlipSwitchChange time String deviceId = flipSwitch.second.deviceId; // get the deviceId from config int relayPIN = devices[deviceId].relayPIN; // get the relayPIN from config
  • 20. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 20 S.R.G.P.T.C Thriprayar bool newRelayState = !digitalRead(relayPIN); // set the new relay State digitalWrite(relayPIN, newRelayState); // set the trelay to the new state SinricProSwitch &mySwitch = SinricPro[deviceId]; // get Switch device from SinricPro mySwitch.sendPowerStateEvent(newRelayState); // send the event #ifdef TACTILE_BUTTON } #endif flipSwitch.second.lastFlipSwitchState = flipSwitchState; // update lastFlipSwitchState } } } } void setupWiFi() { Serial.printf("rn[Wifi]: Connecting"); WiFi.begin(WIFI_SSID, WIFI_PASS); while (WiFi.status() != WL_CONNECTED) { Serial.printf("."); delay(250); } Serial.printf("connected!rn[WiFi]: IP-Address is %srn", WiFi.localIP().toString().c_str()); } void setupSinricPro() {
  • 21. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 21 S.R.G.P.T.C Thriprayar for (auto &device : devices) { const char *deviceId = device.first.c_str(); SinricProSwitch &mySwitch = SinricPro[deviceId]; mySwitch.onPowerState(onPowerState); } SinricPro.restoreDeviceStates(true); // restore the last known state from the server. SinricPro.begin(APP_KEY, APP_SECRET); } void setup() { Serial.begin(BAUD_RATE); setupRelays(); setupFlipSwitches(); setupWiFi(); setupSinricPro(); } void loop() { SinricPro.handle(); handleFlipSwitches(); }
  • 22. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 22 S.R.G.P.T.C Thriprayar CHAPTER 11 5S (SEIRI, SEITON, SEISO, SEIKETSU, SHITSUKE) 5S creates the foundation for a visual work place 5S is a method of creating a self-sustaining culture which perpetuates a neat, clean, efficient workplace; a method for removing all excess materials and tools from the workplace and organizing the required items such that they are easy to find, use, and maintain. The term 5S comes from five Japanese words: Seiri, Seiton, Seiso, Seiketsu Shitsuke. In English, these words are often translated to Sort, Set in Order, Shine, Standardize, Sustain. Sort (Seiri) :- No unnecessary items at the workplace.  Set in Order (Seiton) :- Anyone can instantly find, take, and return any needed item: “A place for everything, and everything in its place”.  Shine (Seiso):- Deviations become visual by cleaning.  Standardize (Seiketsu):- Visualize the 5S standards in the workplace.  Sustain (Shitsuke):- Everybody follows the standard until we have a better one .
  • 23. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 23 S.R.G.P.T.C Thriprayar Why implement 5S?  Improves safety  Improves productivity  Promotes flow  Eliminates distractions  Reduces searching  Reduces space  Reduces unplanned downtime  Improve quality  Exposes problems  Encourages visual control  Tackles waste  Enhances teamwork
  • 24. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 24 S.R.G.P.T.C Thriprayar 11.1 SORT Sort means that you remove all items from the workplace that are not needed for current production or transactional operations. This essentially involves segregating items of immediate use from items that are not needed. Examples of Sort:-  Defective or excess unneeded items that accumulate  Outdated or broken jigs and dies  Worn-out bits,  Outdated or broken tools or inspection equipment  Old rags and other cleaning supplies  Electrical tools/equipment with broken cords  Outdated posters, signs and notices Red Tag Method:-A method of identifying and removing all unneeded items from the workplace through the use of red tags as a visual control.  Attach a red tag to each item that is unneeded or does not belong in the area.  Attach a red tag to each item that belongs in the area but DOES NOT have an identified storage area.  Fill out each tag to describe what each item is and why it was tagged.  Record all the tags and their description in the “5S Tag Log.”
  • 25. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 25 S.R.G.P.T.C Thriprayar 11.2 SET IN ORDER Set in order means that you arrange the items that are needed in the area and identify them or label them so that anyone can find them or put them away. Benefits of Set in Order:-  Person sent to find something, finds it easily  Time spent looking for things is reduced  Wrong parts are not retrieved in error  Adequate space is allocated for storage of items  Items have “their place” and not not left in walkways, etc. Implementing Set in Order:-  Store items together if they are used together, and store them in the sequence they are used.  If tools are being set in order, design a system that keeps the tools in their location.  Store infrequently used items away from the point of use. Example of Set in Order
  • 26. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 26 S.R.G.P.T.C Thriprayar 11.3 SHINE Shine emphasizes removing the dirt, grime, and dust from the work area. This is a program of keeping the work area swept and clean of debris. Floors are swept, machinery is clean and wiped off and everything in the work area is kept clean. Benefits of Shine:-  Defects are easier to see in a well-lit and clean environment  A work area clean of debris is less likely to cause a tripping hazard.  Machines that are clean and maintained work more efficiently and break down less often.  A clean work area promotes improved morale and instills pride in the team members Implementing Shine:-  Determine the shine targets: what are we going to clean?  Set a schedule and assign individuals  Create procedures for continued daily shine processes.  Set periodic machine inspection and maintenance targets.
  • 27. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 27 S.R.G.P.T.C Thriprayar 11.4 STANDARDIZE Creating a consistent way of implementing the tasks that are performed on a daily basis including “Sort,” “Set in Order,” and “Shine” “Do the right things the right way, every time!” Benefits of Standardization:-  Easier to train new employees  Less room for errors and scrap  Work area is more organized  Work area is safer Implementing Standardization:-  Integrate the benefits found through Sort, Set in Order, and Shine into the  everyday work activity  Make it a way of life  It should be easily noticed when items are not in their place  Keep it “visual”  All 5S activities should be scheduled at the frequency rate necessary to maintain a clean, orderly, and safe work environment.
  • 28. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 28 S.R.G.P.T.C Thriprayar 11.5 SUSTAIN Sustain means that the 5S mentality is ingrained in everyday work life and procedures. It means that the 5S program has a discipline that ensures its continued success .Sustain involves making a habit of maintaining correct procedures. Benefits of Sustain:-  Cleaner, safer, working environment  Detailed tasks are documented to make processes more efficient  Work place is maintained in an organized fashion without clutter  Tools and materials are easier to find  Higher employee morale Implementing Sustain:  Keep everyone aware of 5S and its benefits  Make time each day to perform daily tasks  Make it structured  Give recognition where it is due  Establish audit for 5S review
  • 29. Mini Project Report 2022 Home Automation using NodeMCU Dept. of Electronics Engineering 29 S.R.G.P.T.C Thriprayar 11.6 5S SUMMARY 5S is a process and method for creating and maintaining an organized, clean, and high performance workplace. It enables anyone to distinguish between normal and abnormal conditions at a glance. It is the foundation for continuous improvement, zero defects, cost reduction, and a safe work area. It is a systematic way to improve the workplace, our processes, and our products through production line employee involvement. It must become part of everyone's job.