Research Paper for Smart Home Automation System using ESP32 with Blynk, IR Remote & Manual control Relay, IoT Project

Author: Anjali Shrivastav

Affiliation: Final year UG student B. Tech Madhav Institute of Technology and Science, Gwalior

Journal: International Journal of Innovative Research in Electrical, Electronics, Instrumentation and Control Engineering

Volume: 9, Issue: 5, Date: May 2021

DOI: 10.17148/IJIREEICE.2021.9565

ISSN: Online 2321-2004, Print 2321-5526

Abstract

This paper presents an idea or a concept for home automation using ESP32 with Blynk, IR remote and manual switch to control 8 relays with and without internet and monitor the real-time feedback in the Blynk app. Automation of devices has a wide scope for this generation as well as for the forthcoming generation. In this context, mobile communication technology is playing a major role in the world of automation. This article is fully based on a low-cost and reliable home control monitoring system for accessing and controlling devices and appliances remotely using an Android-based smartphone application. While using this technology, the system improves the living standard at home, reduces human effort, is energy-efficient, and time-saving, thus creating a smart home. It is also very helpful for providing support to disabled people and fulfilling their needs at home, enabling them to lead a normal life. This proposed system consists of an Android mobile using ESP32 with Blynk app, IR remote & Manual control relays. We are using Wi-Fi technology to monitor the devices because of its accuracy, high range, and instant connectivity. This module controls home appliances with ease of installation and is user-friendly.

Keywords

ESP32 with IR remote & manual control relays

1. INTRODUCTION

Home automation has become more beneficial because of its safety and security. Nowadays, home automation has become more advanced and precise in monitoring all home appliances. A home automation system becomes energy-efficient and highly approachable as a smart home technique. It involves basic features to maintain user satisfaction and comfort.

Home automation is a unique system that can control and communicate between nearly all aspects of your house. Home automation is a term used to describe the working together of all household amenities and appliances. For example, a centrally microcontroller panel can have the capability to control everything from heating and overall electrical appliances. Home automation can include controlling aspects of our home remotely through a computer or any mobile equipment, programming electronic devices for specific conditions or scenarios, or centralizing the control of a variety of appliances into a single control center. It is essential that different controllable appliances be interconnected and communicate with each other. The main purpose of home automation is to control or monitor signals from different appliances or basic services. A smartphone can be used to control or monitor the home automation system.

(a) Proposed system

This is an IoT project aimed at creating a simple ESP32 IoT smart home automation system using Blynk & IR remote to control 8 relays with and without the internet. With this ESP32 project, it can control 8 home appliances from the smartphone, IR remote, and manual switches. If there is no internet available, it can still control the relay module from the IR remote and manual switches.

(b) Proposed system functions

The required components for this ESP32 home automation system and smart relay module PCB are:

  • ESP32 DEV KIT V1
  • 8-channel 5v SPDT relay module
  • TSOP1838 IR receiver (with metallic casing)
  • Switches or Push Buttons
  • Any IR remote

PCB for the ESP32 Projects

(1) Printed circuit board (PCB) layout for the ESP32 IoT smart home automation project. It features multiple electronic components including an ESP32 module, an array of 8-channel relays, transistors (BC547), optocouplers (PC817), resistors, LEDs, diodes (1N4007), and push buttons, arranged for compact integration.

To give the project a professional look and make the circuit compact, a PCB for this ESP32 IoT-based home automation project has been designed. Required components for the Smart relay module PCB include:

IMPLEMENTATION

(a) Working process in project

This is an IoT project that makes an ESP32 IoT smart home automation system using Blynk & IR remote to control 8 relays with and without internet. With this ESP32 project, it can control 8 home appliances from the smartphone, IR remote, and manual switches. If there is no internet available, it can still control the relay module from the IR remote and manual switches. With this IoT-based smart home system, if the ESP32 is connected with each other via Wi-Fi, then it can also monitor the real-time feedback of the relays in the Blynk app. If Wi-Fi is available, the ESP32 will automatically connect with the Wi-Fi.

(b) Circuit of the IOT Projects using ESP32

(2) Circuit diagram illustrating the ESP32 IoT project with switches. It shows an ESP32 DEVKIT V1 microcontroller connected to an 8-channel relay module. GPIO pins D13, D14, D27, D33, D32, D15, D4 are used for manual control via switches connected to the relay module. An IR receiver (TSOP1838) is connected to GPIO D35. The diagram also indicates connections for 5V DC supply.
(3) Circuit diagram similar to the one with switches, but demonstrating the connection of push buttons to the ESP32 DEVKIT V1 for manual control of the 8-channel relay module. The push buttons are connected to GPIO pins D13, D14, D27, D33, D32, D15, D4, and the IR receiver is connected to GPIO D35.

The circuit is very effortless. It's applied D23, D22, D21, D20, D19, D18, D5, D25 & D26 GPIO to control the 8-channel relays module. And the GPIO D13, D14, D27, D33, D32, D15, D4 are connected with switches to control the relay module manually. The output pin of the IR receiver is connected with D35. It is used the INPUT_PULLUP function in Arduino IDE instead of using pull-up resistors with each switch. As per the source code, when the control pins of the relays module receive a LOW signal, the relay will turn on, and the relay will turn off for a HIGH signal on the control pin. It's used a 5V mobile charge to supply the circuit. If one wants to use push buttons instead of switches, then they have to connect the push buttons across the GPIO pins and GND pin as shown in the above circuits.

Program ESP32 with Arduino IDE

To set up the ESP32 for the home automation project using the Blynk app, follow these steps:

  1. Update the Preferences -> Boards Manager URLs with:
  2. Then install the ESP32 board.

The Codes for this ESP32 IoT Projects

First, upload the code for getting HEX codes to ESP32 and connect the IR receiver with GPIO-35.

Code: Code_IR_Button_HEX_Code.ino

#include <IRremote.h>

int IR_RECV_PIN = 35;
IRrecv irrecv(IR_RECV_PIN);
decode_results results;

void setup() {
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX); // print the HEX code
    irrecv.resume();
  }
}

After that, open the serial monitor, select the baud rate at 9600.

Now, press all the remote buttons (one by one) that you want to control the relays. Save all the HEX codes.

Modify the main code with these HEX codes.

Code: C++ (Wi-Fi Credentials and Authentication)

// Enter Auth Token.
#define AUTH "AUTH TOKEN"
// Enter Wifi Name
#define WIFI_SSID "WIFI NAME"
// Enter wifi Password
#define WIFI_PASS "WIFI PASSWORD"

Auth Token sent by Blynk at “AUTH TOKEN“
WiFi Name at "WIFI NAME"
WiFi Password at "WIFI PASSWORD"

Code: C++ (HEX Code Mapping for Relays)

case 0x80BF49B6: relayOnOff(1); break;
case 0x80BFC936: relayOnOff(2); break;
case 0x80BF33CC: relayOnOff(3); break;
case 0x80BF718E: relayOnOff(4); break;
case 0x80BFF10E: relayOnOff(5); break;
case 0x80BF13EC: relayOnOff(6); break;
case 0x80BF51AE: relayOnOff(7); break;
case 0x80BFD12E: relayOnOff(8); break;
case 0x80BF3BC4: all_SwitchOff(); break;

For this ESP32 project, 9 HEX codes are needed. Copy paste the HEX code after 0x.

After making these changes, go to Tools and select the board as “DOIT ESP32 DEVKIT V1" and the proper PORT in Arduino IDE.

Then click on the upload button to program the ESP32 board.

Connect Home Appliances with Relay Module

(4) Diagram illustrating how to connect home appliances to the 8-channel relay module. It shows AC power lines (110V/230V AC) being switched by the relays to control the appliances, alongside the necessary 5V DC power supply for the ESP32 and relay module.

Connect the home appliances with the relay module as per the circuit diagram. Take proper safety precautions while working with high voltage. Now, turn on the 5V DC supply and 110V/220V AC supply.

Control Methods

(3) ESP32 CONTROL RELAY WITH BLYNK APP

If the ESP32 is connected with Wi-Fi, then we can control the relay module with the Blynk App. We can control and monitor the current status of the relays from anywhere in the world via the Blynk App. When the internet comes back, the ESP32 will fetch the previous state of the switches from the Blynk IoT server and accordingly turn on and off the relays.

(4) ESP32 CONTROL RELAY WITH IR REMOTE

We can always control the appliances from the IR remote. If the ESP32 is connected with Wi-Fi, then it will send real-time feedback to the Blynk server.

(5) CONTROL RELAYS WITH SWITCHES OR PUSH BUTTONS

We can also manually control the appliances from the switches. If the ESP32 is connected with Wi-Fi, then it will send real-time feedback to the Blynk server.

CONCLUSION

In this paper, an internet-based smart home system that can be controlled upon user authentication is proposed and implemented. The home automation using IoT has experimentally proven to work by connecting effortless appliances to it. The designed system instigates a process according to the user's requirements. The Android-based smart home app communicates with ESP32 via Blynk app, IR remote, and manual control relays.

REFERENCES

  1. S. Kumar, "Ubiquitous Smart home System Using Android Application," International Journal of Computer Networks & Communications, vol. 6, pp. 33-43, January 2014.
  2. R. Piyare, “Ubiquitous Home Control and Monitoring System using Android based smart phone," International Journal of Internet of Things, volume. 2, pp. 5-11, 2013.
  3. A. Rajabzadeh, A. R. Management, and Z. F. Jahromi, "A Mobile Application for Smart House Remote Control System," World Academy of Science, Engineering and Technology, vol. 62, 2010.
  4. N-S. Liang, L-C. Fu, and C.- L. Wu, "An integrated, flexible, and Internet-based control architecture for home automation system in the Internet era," in IEEE International Conference on Robotics and Automation, Washington, DC 2002, pp. 1101 – 1106.
  5. Mamata Khatu, Neetu Kaimal, Pratik Jadhav, Syedali Adnan Rizvi, "Implementation of Internet of Things for Home Automation", International Journal of Technology, Volume 3, Issue 2, February 2015.

PDF preview unavailable. Download the PDF instead.

IJIREEICE.2021.9565 Microsoft Word 2019 Microsoft Word 2019

Related Documents

Preview Smart Home Automation with Blynk and ESP32: WiFi and Manual Control Guide
Learn to build a smart home automation system using an ESP32 microcontroller and the Blynk app for WiFi control. This guide covers integrating manual switches for backup, monitoring relay status, and setting up the project step-by-step.
Preview DIY Automatic Plant Watering System with ESP32 and Blynk
A comprehensive guide to building a smart, automated plant watering device using an ESP32 microcontroller, various sensors, and the Blynk IoT platform. Learn about component selection, assembly, wiring, and software setup for effortless plant care.
Preview ESP32 Practical Guide: Projects and Applications
A comprehensive guide to the ESP32 microcontroller, covering its fundamentals, installation, and practical application through various projects. Learn about GPIO, sensors, Bluetooth, web servers, MQTT, and more.
Preview ESP32 Development Board Setup Guide for Arduino IDE
A comprehensive guide to setting up the ESP32 development environment within the Arduino IDE. Learn how to add board manager URLs, install ESP32 support, select the correct board and port, and enter download mode for ESP32-C3 modules.
Preview 2.8inch ESP32-32E Display Module User Manual
User manual for the 2.8-inch ESP32-32E Display Module, covering resource description, software and hardware instructions, and precautions for use. Details include ESP32-WROOM-32E module, ILI9341 LCD controller, SPI communication, USB-to-serial conversion, and various circuit diagrams.
Preview Build an ESP32 Pool Thermometer for HomeKit and Alexa
A comprehensive DIY guide to creating an ESP32-based pool thermometer that seamlessly integrates with Apple HomeKit and Amazon Alexa. Learn how to build a low-power, solar-charged device with deep sleep functionality for real-time pool temperature monitoring.
Preview ESP32 Development with MSP4030/MSP4031 Display Module: Demo Instructions
A comprehensive guide to using the MSP4030 and MSP4031 display modules with ESP32 development boards, covering setup, pin connections, sample programs, library configuration, and compilation.
Preview DIY ESP32 Soil Moisture Sensors and Automatic Watering System
Learn how to build a DIY automatic plant watering system using ESP32 soil moisture sensors and Home Assistant. This guide covers sensor setup, software configuration, and automation for efficient water usage.