ESP8266 and Arduino UNO Controlled Environment Monitoring and Motor Automation System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates various components to perform multiple functions, including environmental sensing, timekeeping, motor control, and relay switching for AC load control. The core of the circuit is based on an ESP8266 NodeMCU and an Arduino UNO microcontroller, which are responsible for processing data and controlling the peripherals. The circuit includes sensors like the DHT11 for temperature and humidity readings, an IR sensor for object detection, and an HC-SR04 ultrasonic sensor for distance measurement. A DS1302 RTC module provides timekeeping functionality. Motor control is achieved through an L298N Motor Driver that interfaces with a stepper motor. Power management is handled by a 12V power supply and a 5V relay module for controlling an AC bulb. The circuit is designed to be versatile and can be applied to various automation and control applications.
Component List
DHT11 Temperature and Humidity Sensor
- Pins: DATA, GND, VCC
- Description: Provides ambient temperature and humidity readings.
ESP8266 NodeMCU
- Pins: D0-D8, RX, TX, A0, RSV, SD3, SD2, SD1, CMD, SD0, CLK, EN, RST, VIN, 3V3, GND
- Description: A microcontroller with Wi-Fi capabilities for IoT applications.
IR Sensor
- Pins: out, gnd, vcc
- Description: Detects the presence of objects or motion within its range.
DS1302 RTC (Real-Time Clock)
- Pins: VCC, GND, CLK, DATA, RST
- Description: Keeps track of the current time even when the main microcontroller is powered off.
L298N Motor Driver Controller Board Module
- Pins: Output A/B, +12V Power, +5V Power, Ground, Input 1-4
- Description: Controls the direction and speed of motors, specifically designed for driving a stepper motor in this circuit.
12V Power Supply
- Pins: +, -
- Description: Provides the necessary power for the motor driver and potentially other 12V components.
HC-SR04 Ultrasonic Distance Sensor
- Pins: VCC, TRIG, ECHO, GND
- Description: Measures distances by emitting ultrasonic waves and timing their return.
5V 2-Relay Module
- Pins: JD-VCC, VCC, GND, IN1, IN2, NO, COM, NC
- Description: Allows for control of high voltage/high current devices, such as an AC bulb.
AC Bulb
- Pins: P, N
- Description: A standard AC bulb used for lighting applications.
Power 220V
- Pins: hot wire, neutral wire
- Description: Provides the main AC power source for the relay-controlled AC bulb.
Water Pump
- Pins: VCC, GND
- Description: An electric pump for moving water, controlled by the circuit.
Arduino UNO
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13
- Description: A versatile microcontroller used for a wide range of applications, including sensor data processing and peripheral control.
Stepper Motor (Unipolar)
- Pins: A, B, C, D, COMMON_1, COMMON_2
- Description: A type of electric motor that is driven by sequentially energizing the coils, allowing for precise control of angular position.
Diode
- Pins: cathode, anode
- Description: A semiconductor device that allows current to flow in one direction only, often used for protection or rectification.
Wiring Details
DHT11 Temperature and Humidity Sensor
- DATA connected to ESP8266 NodeMCU D3
- GND connected to common ground
- VCC connected to common 3.3V or 5V supply
ESP8266 NodeMCU
- 3V3 connected to sensors requiring 3.3V
- GND connected to common ground
- D1 connected to HC-SR04 TRIG
- D2 connected to HC-SR04 ECHO
- D3 connected to DHT11 DATA
- D4 connected to IR sensor out
- RX connected to Arduino UNO D1 (TX)
- TX connected to Arduino UNO D0 (RX)
IR Sensor
- out connected to ESP8266 NodeMCU D4
- gnd connected to common ground
- vcc connected to common 3.3V or 5V supply
DS1302 RTC
- VCC connected to Arduino UNO 3.3V
- GND connected to common ground
- CLK connected to Arduino UNO D2
- DATA connected to Arduino UNO D3
- RST connected to Arduino UNO D4
L298N Motor Driver Controller Board Module
- Ground connected to common ground
- +12V Power connected to 12V power supply +
- Output A/B connected to Stepper Motor A/B
- Input 1-4 connected to Arduino UNO D7-D10
12V Power Supply
-
- connected to L298N Motor Driver +12V Power
-
- connected to common ground
HC-SR04 Ultrasonic Distance Sensor
- VCC connected to common 3.3V or 5V supply
- TRIG connected to ESP8266 NodeMCU D1
- ECHO connected to ESP8266 NodeMCU D2
- GND connected to common ground
5V 2-Relay Module
- JD-VCC connected to external 5V supply if isolated operation is required
- VCC connected to Arduino UNO 5V
- GND connected to common ground
- IN1 connected to Arduino UNO D6
- IN2 connected to Arduino UNO D5
- COM connected to AC Bulb N
- NC connected to power 220V hot wire
AC Bulb
- P connected to power 220V neutral wire
- N connected to 5V 2-Relay Module COM
Power 220V
- hot wire connected to 5V 2-Relay Module NC
- neutral wire connected to AC Bulb P
Water Pump
- VCC connected to a suitable power source
- GND connected to common ground
Arduino UNO
- GND connected to common ground
- 3.3V connected to DS1302 RTC VCC
- 5V connected to 5V 2-Relay Module VCC
- D0-D13 connected to various components as per the wiring details
Stepper Motor (Unipolar)
- A/B/C/D connected to L298N Motor Driver Output A/B
Diode
- cathode/anode connected in series with a load to allow current flow in one direction
Documented Code
Arduino UNO Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The provided code for the Arduino UNO is a template and does not contain any functional code. It is expected that the user will fill in the setup and loop functions with the necessary code to control the circuit's components.
ESP8266 NodeMCU Code
No code was provided for the ESP8266 NodeMCU. It is assumed that the user will develop the code to handle Wi-Fi connectivity, sensor readings, and control signals for the circuit's components.