๐ ๏ธ MAKER GUIDEJul 11, 2026โขโฑ๏ธ 3 min readโข๐ณ๐ต Tested in Nepal
Smart Wi-Fi Modular Wall Switch with ESP8266 & Home Assistant Integration
Convert traditional Nepali switchboards into smart home relays with NodeMCU ESP8266, HLK-PM01 power module, and 2-channel relay modules from Ghumti Pasal.
๐ ๏ธ BILL OF MATERIALS (BOM)
Required Hardware & Component Checklist
Curated components verified for this project. Check the items you need, adjust quantities, and add straight to cart:
Estimated Total (5/5 items):
NPRย 1,750
โ Cash on Delivery across Nepal
All parts selected
NPRย 750
NPRย 600
NPRย 260
NPRย 120
(NPRย 60 ea)
NPRย 20
Smart Wi-Fi Modular Wall Switch with ESP8266 & Home Assistant Integration
Educational Notes
This project is designed to be accessible to students from Class 4 to Masters level, with complexity scalable to match different age groups and skill levels.
Learning Objectives:
- Understand basic electronics and circuitry principles
- Learn sensor applications and data collection techniques
- Develop problem-solving skills through hands-on building and troubleshooting
- Apply programming concepts to control hardware and process data
- Connect projects to real-world Nepalese contexts and challenges
Adaptability:
- For younger students (Class 4-8): Focus on assembling pre-built circuits, observing results, and understanding basic concepts
- For intermediate students (Class 9-12): Modify code, experiment with parameters, and explore underlying principles
- For advanced students (Undergraduate/Masters): Optimize designs, add features, conduct research extensions, and analyze performance
Safety Note: Always supervise younger students when working with electricity, heat, or moving parts.
Convert traditional wall switchboards into smart dual relays using NodeMCU ESP8266 and HLK-PM01 AC-DC 5V Module.
Hardware Bill of Materials:
- Microcontroller: Wireless module CH340G NodeMCU V3 ESP8266
- Power Module: HLK-PM01 AC-DC 220V to 5V mini power supply module
- Relay Board: 2 Channel 5V 10A Relay Module low level trigger with optocoupler
- Snubber Components: 2x CBB22 400V 2.2UF Film Capacitor + Heat Shrink Tube
Circuit Pinout & Wiring Connections:
| Component / Relay Pin | NodeMCU ESP8266 Pin | Function / Description |
|---|---|---|
| 2-Ch Relay IN1 | Pin D1 (GPIO 5) | Channel 1 Relay Trigger |
| 2-Ch Relay IN2 | Pin D2 (GPIO 4) | Channel 2 Relay Trigger |
| Wall Switch 1 Input | Pin D5 (GPIO 14 - INPUT_PULLUP) | Physical Toggle Switch 1 |
| Wall Switch 2 Input | Pin D6 (GPIO 12 - INPUT_PULLUP) | Physical Toggle Switch 2 |
| HLK-PM01 AC Pins | Mains AC 220V Live & Neutral | Grid Power Input |
| HLK-PM01 +5V / GND | VIN & GND | NodeMCU & Relay Power |
Firmware Source Code (ESP8266 C++)
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
// L298N Motor Driver Pin Connections
const int ENA = 5;
const int IN1 = 18;
const int IN2 = 19;
const int IN3 = 21;
const int IN4 = 22;
const int ENB = 23;
void setup() {
Serial.begin(115200);
pinMode(ENA, OUTPUT);
pinMode(ENB, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
Serial.println("Robotic Chassis & Motor Driver Controller Active.");
}
void moveForward(int speedVal) {
analogWrite(ENA, speedVal);
analogWrite(ENB, speedVal);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
void stopMotors() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
}
void loop() {
Serial.println("Executing Autonomous Drive Routine Forward...");
moveForward(200);
delay(3000);
Serial.println("Stopping Motors...");
stopMotors();
delay(2000);
}
โ Previous Guide
Multi-Level Smart Car Parking Slot Occupancy Counter with IR Sensors
Next Guide โ
Elderly Fall Detection Smart Belt with MPU6050 Accelerometer & SIM800L GPS
