Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP8266 NodeMCU Controlled Relay Module for Smart AC Lighting

View and Edit Project In Cirkit DesignerImage of ESP8266 NodeMCU Controlled Relay Module for Smart AC Lighting

Circuit Documentation

Summary

This circuit is designed to control multiple AC-powered LED bulbs using an ESP8266 NodeMCU microcontroller and a 6-relay module. The ESP8266 NodeMCU is interfaced with the relay module to switch the LED bulbs on and off. The power for the NodeMCU and the relay module is supplied by a 5V adapter. The AC power source is connected to the relay module and LED bulbs through two-way electrical switches, allowing manual control over the lighting in addition to the microcontroller's control.

Component List

ESP8266 NodeMCU

6 Relays Module

5V Adapter

LED Bulb AC / Bombillo AC

AC Source

Two-Way Electrical Switch

Wiring Details

ESP8266 NodeMCU

6 Relays Module

5V Adapter

LED Bulb AC / Bombillo AC

AC Source

Two-Way Electrical Switch

Documented Code

The code for the ESP8266 NodeMCU is not provided in the input. However, the typical code structure for controlling a relay module with an ESP8266 NodeMCU would include setting up the GPIO pins as outputs and toggling them to control the state of the relays. The code would also include WiFi setup to allow remote control through a network.

// Placeholder for actual ESP8266 NodeMCU code
void setup() {
  // Initialize digital pins as outputs
  pinMode(D0, OUTPUT);
  pinMode(D1, OUTPUT);
  pinMode(D2, OUTPUT);
  pinMode(D3, OUTPUT);
  pinMode(D4, OUTPUT);
  pinMode(D5, OUTPUT);
  // Initialize all relays to OFF state
  digitalWrite(D0, LOW);
  digitalWrite(D1, LOW);
  digitalWrite(D2, LOW);
  digitalWrite(D3, LOW);
  digitalWrite(D4, LOW);
  digitalWrite(D5, LOW);
}

void loop() {
  // Code to control relays based on some conditions or inputs
}

Please note that the actual code would need to be written and uploaded to the ESP8266 NodeMCU to control the relays based on the desired logic and conditions.