Smart Home Automation Using Blynk & ESP32 IoT Projects | WiFi & Manual

By techstudycell

Introduction

This IoT project demonstrates how to create an IoT-based Smart Home Automation system using Blynk and ESP32. It allows control of an 8-channel relay module via manual switches and the Blynk smartphone app. If internet connectivity is unavailable, home appliances can still be controlled using manual switches. The project details all necessary steps for building this home automation system.

Key Features

  • Control home appliances with WiFi via the Blynk App.
  • Control home appliances using manual switches.
  • Monitor real-time feedback of relay status in the Blynk App.
  • Manually control home appliances even without an internet connection.

The project requires an 8-channel relay module and an ESP32 board.

Required Components

  • 5V Relays (SPDT) (8 units)
  • BC547 Transistors (8 units)
  • PC817 Optocouplers (8 units)
  • 510-ohm 0.25-watt Resistors (8 units, R1 - R8)
  • 1k 0.25-watt Resistors (10 units, R9 - R18)
  • 5-mm LEDs (10 units)
  • 1N4007 Diodes (8 units, D1 - D8)
  • Push Buttons (8 units)
  • Terminal Connectors
  • 5V DC Power Supply

Project Steps

Step 1: Circuit Diagram

The circuit diagram outlines the complete setup for this home automation project. The ESP32's GPIO pins D23, D22, D21, D19, D18, D5, D25, and D26 are used to control the 8 relays. Manual control is achieved via push buttons connected to GPIO pins D13, D12, D14, D27, D33, D32, D15, and D4. The INPUT_PULLUP function in the Arduino IDE is utilized, negating the need for external pull-up resistors. A 5V mobile charger is used to power the smart relay module.

A tutorial video explaining the circuit is available at: YouTube Tutorial Video.

Step 2: Control Relays With Internet Using Blynk

When the ESP32 module is connected to WiFi, home appliances can be controlled remotely via the Blynk App and the pushbuttons. The Blynk App allows for control and real-time monitoring of the relay statuses from anywhere globally.

Step 3: Control Relays Without Internet Using Push-buttons

In the absence of WiFi, relays can be operated using the connected pushbuttons. The ESP32 periodically checks for WiFi availability (every 3 seconds) and automatically reconnects when the network becomes accessible.

Step 4: Configure the Blynk App for ESP32

Install the Blynk App from your device's app store. Create an account and start a new project. Name the project, select "ESP32 Dev Board" as the board, and "WiFi" as the connection type. Tap "Create". Blynk will send an authentication token to your registered email address.

Step 5: Add Button Widgets in Blynk App

Add eight button widgets to the Blynk app interface to control the eight relays. Assign virtual pins V1 through V8 to these buttons, setting their mode to "Switch". Detailed instructions are provided in the tutorial video.

Step 6: Code for Blynk ESP32 Home Automation

The tutorial video guides through programming the ESP32 DEV KIT V1 using the Arduino IDE. Before uploading, ensure the ESP32 board support package and the Blynk library are installed. Input your WiFi network name, password, and the Blynk Authentication Token into the code. Select the "DOIT ESP32 DEVKIT V1" board and the correct COM port, then upload the code to the ESP32 board.

The source code is available at: Source Code (.ino file).

Step 7: Program the ESP32 With Arduino IDE

If the Arduino IDE displays "Connecting....___" during code upload, press and hold the BOOT button on the ESP32 board until the connection is established.

Step 8: Designing the PCB

To achieve a compact and professional appearance, a Printed Circuit Board (PCB) was designed after testing all functionalities on a breadboard. The PCB Gerber files for this home automation project can be downloaded from the provided link.

Gerber file download link: Download PCB Gerber Files.

Step 9: Order the PCB

After downloading the Gerber files, PCBs can be ordered from manufacturers like JLCPCB. Visit the website, sign in or sign up, and click "QUOTE NOW".

Step 10: Uploading the Gerber File and Set the Parameters

Upload your downloaded Gerber file by clicking "Add your Gerber file". Configure the necessary parameters such as the quantity of PCBs and the PCB masking color. After selecting all options, click "SAVE TO CART".

Step 11: Select Shipping Address and Payment Mode

Enter your shipping address and choose a suitable shipping method. Submit the order and proceed to payment. Order tracking is available on the manufacturer's website. The PCBs were manufactured within two days and arrived within a week via DHL, noted for good quality and affordability.

Step 12: Solder All the Components on PCB

Solder all electronic components onto the PCB according to the circuit diagram. Subsequently, connect the ESP32 development board to the PCB.

Step 13: Testing the ESP32 Home Automation Circuit

Once the code is uploaded and the ESP32 connects to WiFi, the blue LED will illuminate. The relay module can then be controlled using both the Blynk app and the physical pushbuttons.

Step 14: Connect the Home Appliances

Connect the eight home appliances to the relay module as indicated in the circuit diagram. It is crucial to exercise proper safety precautions when working with high-voltage connections.

Step 15: Turn ON the Supply

Connect the 5V DC power supply (e.g., from an old mobile charger) to the PCB. Then, turn on the main 110V/230V AC supply and the 5V DC supply.

Step 16: Finally!!

Your home appliances can now be controlled in a smart, automated manner. This project provides a comprehensive solution for smart home integration. Feedback and queries are welcome in the comment section. Happy Learning!

PDF preview unavailable. Download the PDF instead.

Smart-Home-Automation-Using-Blynk-ESP32-IoT-Projec wkhtmltopdf 0.12.6 Qt 4.8.7

Related Documents

Preview Smart Home Automation System using ESP32, Blynk, and IR Remote
Research paper detailing the design and implementation of an IoT-based smart home automation system using ESP32, Blynk, IR remote, and manual controls for efficient appliance management.
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 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 DIY Weather Station with ESP32: Build Your Own Smart Weather Monitor
Learn how to build a DIY smart weather station using the ESP32 microcontroller. This guide covers sensor integration, 3D printing, and connecting to Home Assistant for real-time data and forecasting.
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 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 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.
Preview ESP32 Solar Power System Diagram
Diagram illustrating a solar-powered system for an ESP32 microcontroller, featuring a battery, a 'Babysitter' power management unit, and a buck converter for voltage regulation.