ESP8266 NodeMCU Controlled Smart Irrigation System with Soil Moisture Sensing and DHT22 Temperature/Humidity Monitoring
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit is designed to monitor environmental parameters such as soil moisture and temperature/humidity, and control a water pump based on the sensor readings. It uses an ESP8266 NodeMCU microcontroller to read data from a DHT22 temperature and humidity sensor and a SparkFun Soil Moisture Sensor. The ESP8266 also controls a 12V single-channel relay that powers a water pump. The power for the circuit is provided by a 12V power supply, which is regulated to 5V by an LM340T5 7805 voltage regulator to power the ESP8266 and sensors. An IRFZ44N MOSFET is used to switch the water pump on and off, and a resistor is used to pull up the data line from the DHT22 sensor.
Component List
LM340T5 7805 (Voltage Regulator)
- Pins: Vout, Vin, GND
- Description: A voltage regulator that outputs a steady 5V from a higher voltage input.
12V Power Supply
- Pins: +, -
- Description: Provides the 12V power required for the circuit.
2.1mm Barrel Jack with Terminal Block
- Pins: POS, NEG
- Description: Connects the 12V power supply to the circuit.
ESP8266 NodeMCU (Microcontroller)
- Pins: D0, D1, D2, D3, D4, 3V3, GND, D5, D6, D7, D8, RX, TX, A0, RSV, SD3, SD2, SD1, CMD, SD0, CLK, EN, RST, VIN
- Description: The main microcontroller unit that controls the sensors and the relay.
DHT22 (Temperature and Humidity Sensor)
- Pins: +, Out, -
- Description: Measures the temperature and humidity of the environment.
SparkFun Soil Moisture Sensor
- Pins: VCC, GND, SIG
- Description: Measures the moisture level in the soil.
12V Single Channel Relay
- Pins: NC, COM, NO, IN, GND, VCC
- Description: An electromechanical switch used to control the water pump.
Water Pump
- Pins: VCC, GND
- Description: Pumps water when activated by the relay.
IRFZ44N (MOSFET)
- Pins: Gate, Drain, Source
- Description: A transistor used for switching electronic signals.
Resistor
- Pins: pin1, pin2
- Properties: Resistance: 200 Ohms
- Description: Used to pull up the data line from the DHT22 sensor.
Wiring Details
LM340T5 7805 (Voltage Regulator)
- Vin connected to the positive terminal of the 12V power supply, relay COM, and barrel jack POS.
- GND connected to the ground network of the circuit.
- Vout connected to the 5V network of the circuit.
12V Power Supply
-
- connected to the input of the voltage regulator, relay COM, and barrel jack POS.
-
- connected to the ground network of the circuit.
2.1mm Barrel Jack with Terminal Block
- POS connected to the positive terminal of the 12V power supply and relay COM.
- NEG connected to the ground network of the circuit.
ESP8266 NodeMCU (Microcontroller)
- VIN connected to the 5V network of the circuit.
- GND connected to the ground network of the circuit.
- D1 connected to the DHT22 sensor data line through a resistor.
- D4 connected to the gate of the IRFZ44N MOSFET.
- D2 connected to the relay IN.
- A0 connected to the soil moisture sensor SIG.
DHT22 (Temperature and Humidity Sensor)
-
- connected to the 5V network of the circuit.
- Out connected to the ESP8266 NodeMCU D1 through a resistor.
-
- connected to the ground network of the circuit.
SparkFun Soil Moisture Sensor
- VCC connected to the 5V network of the circuit.
- GND connected to the ground network of the circuit.
- SIG connected to the ESP8266 NodeMCU A0.
12V Single Channel Relay
- VCC connected to the 5V network of the circuit.
- GND connected to the ground network of the circuit.
- IN connected to the ESP8266 NodeMCU D2.
- COM connected to the positive terminal of the 12V power supply.
- NO connected to the water pump VCC.
Water Pump
- VCC connected to the relay NO.
- GND connected to the drain of the IRFZ44N MOSFET.
IRFZ44N (MOSFET)
- Gate connected to the ESP8266 NodeMCU D4.
- Drain connected to the water pump GND.
- Source connected to the ground network of the circuit.
Resistor
- One end connected to the DHT22 sensor data line.
- The other end connected to the ESP8266 NodeMCU D1.
Documented Code
Since no code was provided, this section is left blank. The code would typically include the initialization of the microcontroller's I/O pins, the setup of the sensor libraries, the main loop to read sensor data, and the logic to control the relay and water pump based on the sensor readings.