ESP8266 NodeMCU-Based Smart Home Automation with Environmental Monitoring
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit in question appears to be a smart control system designed to interface with various sensors and actuators. It includes an ESP8266 NodeMCU microcontroller, which is likely the central processing unit of the system, capable of reading sensor data and controlling devices such as relays, an AC bulb, and a fan. The circuit features a 5V 2-Relay module for switching high-power devices, a DHT11 humidity and temperature sensor, a PIR motion sensor, an MQ-4 gas sensor, and power supply components. The circuit is powered by an AC source, which is converted to DC for the low-voltage components.
Component List
ESP8266 NodeMCU
- Microcontroller with WiFi capability
- Digital I/O pins: D0-D8, RX, TX
- Analog input: A0
- Power pins: 3V3, GND, VIN
5V 2-Relay Module (JD-VCC)
- Two-channel relay module for controlling high-power devices
- Control pins: IN1, IN2
- Relay outputs: NO (Normally Open), COM (Common), NC (Normally Closed)
- Power pins: JD-VCC, VCC, GND
DHT11 Humidity and Temperature Sensor
- Sensor for measuring ambient temperature and humidity
- Data pin: DATA
- Power pins: VDD, GND
PIR Sensor
- Passive Infrared sensor for detecting motion
- Signal pin: SIG
- Power pins: VDD, GND
MQ-4 Gas Sensor
- Sensor for detecting methane and natural gas concentrations
- Digital output: D0
- Analog output: A0
- Power pins: VCC, GND
AC Bulb
- Standard AC-powered light bulb
- Power pins: P, N
AC Source
- Power source for AC components
- Power pins: + (Live), - (Neutral)
AC to DC Converter (actodc)
- Converts AC power to 5V DC and 12V DC
- DC outputs: 5v, 12v
- AC inputs: live, neutral
220V AC Fan
- Standard AC-powered fan
- Power pins: L (Live), N (Neutral)
Wiring Details
ESP8266 NodeMCU
- GND connected to common ground
- VIN connected to 5V from the AC to DC converter
- D1 controls Relay IN1
- D2 controls Relay IN2
- D5 reads digital output from MQ-4
- D6 reads signal from PIR sensor
- D7 reads data from DHT11
5V 2-Relay Module (JD-VCC)
- GND connected to common ground
- VCC connected to 5V from the AC to DC converter
- IN1 controlled by ESP8266 NodeMCU D1
- IN2 controlled by ESP8266 NodeMCU D2
- NO of Relay 1 connected to AC Bulb P
- COM of Relay 1 connected to AC Source +
- NO of Relay 2 connected to 220V AC Fan L
- COM of Relay 2 connected to AC Source +
DHT11 Humidity and Temperature Sensor
- DATA connected to ESP8266 NodeMCU D7
- VDD connected to 5V from the AC to DC converter
- GND connected to common ground
PIR Sensor
- SIG connected to ESP8266 NodeMCU D6
- VDD connected to 5V from the AC to DC converter
- GND connected to common ground
MQ-4 Gas Sensor
- D0 connected to ESP8266 NodeMCU D5
- VCC connected to 5V from the AC to DC converter
- GND connected to common ground
AC Bulb
- P connected to NO of Relay 1
- N connected to AC Source -
AC Source
-
- connected to COM of Relay 1 and Relay 2
-
- connected to AC Bulb N and 220V AC Fan N
AC to DC Converter (actodc)
- 5v connected to 5V power rail for low-voltage components
- 12v not used in this circuit
- live connected to AC Source +
- neutral connected to AC Source -
220V AC Fan
- L connected to NO of Relay 2
- N connected to AC Source -
Documented Code
No code was provided for the microcontroller. The expected functionality would include reading sensor data from the DHT11, PIR, and MQ-4 sensors, and controlling the relay states based on sensor inputs or external commands, possibly received over WiFi given the capabilities of the ESP8266 NodeMCU.