Home Automation with NodeMCU

Control your home appliances with your smartphone

Project Overview

Home Automation System

Smart Home Control System

This project demonstrates how to build a home automation system using NodeMCU ESP8266 that allows you to control lights, fans, and even your PC remotely from your smartphone.

The system uses Wi-Fi connectivity to communicate between your smartphone and the NodeMCU, which in turn controls the connected appliances through relays.

  • Control multiple appliances remotely
  • Easy-to-use mobile interface
  • Cost-effective solution
  • Expandable to include more devices
  • Energy monitoring capabilities

Implementation Steps

Step 1: Hardware Setup

Hardware Setup

Gather all the necessary components and set up the hardware connections.

Components Needed:

  • NodeMCU ESP8266 Development Board
  • 5V Relay Module (4-channel)
  • Jumper Wires
  • Breadboard (optional)
  • Power Supply (5V)

Step 2: Circuit Connections

Circuit Connections

Connect the NodeMCU to the relay module and set up the control circuit.

Connection Details:

  • Connect NodeMCU Vin to 5V power supply
  • Connect NodeMCU GND to power supply GND
  • Connect NodeMCU D1 to Relay IN1
  • Connect NodeMCU D2 to Relay IN2
  • Connect NodeMCU D3 to Relay IN3
  • Connect NodeMCU D4 to Relay IN4

Step 3: Programming the NodeMCU

Programming the NodeMCU

Upload the Arduino code to the NodeMCU to enable Wi-Fi communication and relay control.

Code Implementation:

  • Include ESP8266WiFi and ESP8266WebServer libraries
  • Set up Wi-Fi credentials and server
  • Define GPIO pins for relay control
  • Create HTML interface for control
  • Implement server handlers for ON/OFF commands

Step 4: Appliance Connections

Appliance Connections

Connect the appliances to the relay module, ensuring proper safety measures.

Connection Guide:

  • Connect Light to Relay 1 COM and NO terminals
  • Connect Fan to Relay 2 COM and NO terminals
  • Connect PC to Relay 3 COM and NO terminals
  • Ensure proper insulation for all connections
  • Use appropriate fuse protection for each appliance

Step 5: Mobile App Setup

Mobile App Setup

Set up the mobile app interface to control the appliances remotely.

App Configuration:

  • Open a web browser on your smartphone
  • Enter the IP address of the NodeMCU
  • Save the bookmark for easy access
  • Alternatively, use a dedicated IoT app like Blynk
  • Configure the app with the NodeMCU credentials

Step 6: Testing and Troubleshooting

Testing and Troubleshooting

Test the system functionality and troubleshoot any issues that arise.

Testing Procedures:

  • Test each appliance individually
  • Check Wi-Fi connectivity and signal strength
  • Verify relay operation with LED indicators
  • Test remote control from different locations
  • Monitor system stability over time

Key Components

NodeMCU ESP8266

The brain of the home automation system, providing Wi-Fi connectivity and processing capabilities.

NodeMCU ESP8266

5V Relay Module

Allows the NodeMCU to control high-voltage appliances safely by acting as an electrically operated switch.

5V Relay Module

Jumper Wires

Used to establish electrical connections between the NodeMCU and the relay module.

Jumper Wires

Power Supply

Provides the necessary 5V power to operate the NodeMCU and relay module.

Power Supply