Arduino Mega 2560 Smart Irrigation System with Wi-Fi and GSM Connectivity
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to integrate various sensors and actuators with an Arduino Mega 2560 microcontroller. The system includes a temperature sensor, a PIR motion sensor, a capacitive soil moisture sensor, an LED, resistors, a water pump, a SIM900A module, a relay, a buzzer, a LiPo battery, and an ESP-8266 controller. The Arduino Mega 2560 serves as the central controller, interfacing with all the components to perform various tasks such as sensing environmental conditions, controlling actuators, and communicating wirelessly.
Component List
Temperature Sensor (LM35)
- Description: Measures temperature and outputs an analog voltage proportional to the temperature.
- Pins: +Vs, Vout, GND
HC-SR501 PIR Motion Sensor
- Description: Detects motion using passive infrared technology.
- Pins: Output, Ground, Power Supply
Capacitive Soil Moisture Sensor V1.2
- Description: Measures soil moisture levels.
- Pins: GND, VCC, AOUT
LED: Two Pin (Red)
- Description: Emits red light when powered.
- Pins: Cathode, Anode
Resistor (220 Ohms)
- Description: Limits current flow.
- Pins: Pin1, Pin2
- Properties: Resistance: 220 Ohms
Resistor (10k Ohms)
- Description: Limits current flow.
- Pins: Pin1, Pin2
- Properties: Resistance: 10k Ohms
Arduino Mega 2560
- Description: Microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, AREF, SDA, SCL
5V Mini Water Pump
- Description: Pumps water when powered.
- Pins: Positive Pin, Negative Pin
SIM900A
- Description: GSM/GPRS module for communication.
- Pins: GND, DB9-3 (RXD), DB9-2 (TXD), 5V, 3VR, 5VR, 3VT, 5VT, VCC, Ring, RESTART, RESET, STATUS
12V Single Channel Relay
- Description: Electrically operated switch.
- Pins: NC, COM, NO, IN, GND, VCC
Buzzer
- Description: Emits sound when powered.
- Pins: Positive, Negative
LiPo Battery 2200mAH 30C
- Description: Provides power to the circuit.
- Pins: VCC, GND
ESP-8266 Controller
- Description: Wi-Fi module for wireless communication.
- Pins: A0, RSV, SD3, SD5, SD1, CMD, D0-D8, 3V3, GND, RX, TX, Vin, 5V
Wiring Details
Temperature Sensor (LM35)
- +Vs to Arduino Mega 2560 5V
- Vout to Arduino Mega 2560 A1
- GND to Arduino Mega 2560 GND
HC-SR501 PIR Motion Sensor
- Power Supply to Arduino Mega 2560 D11 PWM
- Output to SIM900A VCC
- Ground to Arduino Mega 2560 GND
Capacitive Soil Moisture Sensor V1.2
- GND to Arduino Mega 2560 GND
- VCC to Arduino Mega 2560 5V
- AOUT to Arduino Mega 2560 A0
LED: Two Pin (Red)
- Cathode to Arduino Mega 2560 GND
- Anode to Resistor (220 Ohms) Pin2
Resistor (220 Ohms)
- Pin1 to Arduino Mega 2560 D10 PWM
- Pin2 to LED Anode
Resistor (10k Ohms)
- Pin1 to Arduino Mega 2560 3V3
- Pin2 to ESP-8266 Controller EN
Arduino Mega 2560
- 3V3 to Resistor (10k Ohms) Pin1
- 5V to SIM900A VCC, Capacitive Soil Moisture Sensor VCC, 12V Single Channel Relay VCC
- GND to LiPo Battery GND, 5V Mini Water Pump Negative Pin, SIM900A GND, HC-SR501 PIR Motion Sensor Ground, ESP-8266 Controller GND, LED Cathode, Buzzer Negative, Temperature Sensor GND, Capacitive Soil Moisture Sensor GND, 12V Single Channel Relay GND
- VIN to LiPo Battery VCC
- A0 to Capacitive Soil Moisture Sensor AOUT
- A1 to Temperature Sensor Vout
- D8 PWM to 12V Single Channel Relay IN
- D9 PWM to Buzzer Positive
- D10 PWM to Resistor (220 Ohms) Pin1
- D11 PWM to HC-SR501 PIR Motion Sensor Power Supply
- D17 PWM/RX2 to SIM900A DB9-2 (TXD)
- D16 PWM/TX2 to SIM900A DB9-3 (RXD)
- D18/TX1 to ESP-8266 Controller RX
- D19/RX1 to ESP-8266 Controller TX
5V Mini Water Pump
- Positive Pin to 12V Single Channel Relay NO
- Negative Pin to Arduino Mega 2560 GND
SIM900A
- GND to Arduino Mega 2560 GND
- DB9-3 (RXD) to Arduino Mega 2560 D16 PWM/TX2
- DB9-2 (TXD) to Arduino Mega 2560 D17 PWM/RX2
- VCC to Arduino Mega 2560 5V
12V Single Channel Relay
- COM to LiPo Battery VCC
- NO to 5V Mini Water Pump Positive Pin
- IN to Arduino Mega 2560 D8 PWM
- GND to Arduino Mega 2560 GND
- VCC to Arduino Mega 2560 5V
Buzzer
- Positive to Arduino Mega 2560 D9 PWM
- Negative to Arduino Mega 2560 GND
LiPo Battery 2200mAH 30C
- VCC to Arduino Mega 2560 VIN, 12V Single Channel Relay COM
- GND to Arduino Mega 2560 GND, 5V Mini Water Pump Negative Pin
ESP-8266 Controller
- TX to Arduino Mega 2560 D19/RX1
- RX to Arduino Mega 2560 D18/TX1
- GND to Arduino Mega 2560 GND
- Vin to Arduino Mega 2560 5V
- EN to Resistor (10k Ohms) Pin2
Documented Code
Arduino Mega 2560 Code
sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
documentation.txt