Arduino Mega 2560 Smart Irrigation System with Bluetooth Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to interface various sensors and modules with an Arduino Mega 2560 microcontroller. The components include a DHT11 temperature and humidity sensor, an MQ-2 gas sensor, an HC-05 Bluetooth module, a 5V relay, a water pump, a 12V battery, a rain/snow sensor, a soil moisture sensor, and a soil moisture interceptor. The Arduino Mega 2560 serves as the central controller, reading data from the sensors and controlling the relay and water pump.
Component List
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, AREF, SDA, SCL
DHT11
- Description: A temperature and humidity sensor.
- Pins: DATA, GND, VCC
MQ-2
- Description: A gas sensor for detecting LPG, i-butane, propane, methane, alcohol, hydrogen, and smoke.
- Pins: GND, VCC, ANALOG, Digital
HC-05 Bluetooth Module
- Description: A Bluetooth module for wireless communication.
- Pins: Key, VCC, GND, TXD, RXD, State
5V Relay
- Description: A relay module for switching high voltage devices.
- Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC
Water Pump
- Description: A pump for moving water.
- Pins: VCC, GND
Battery 12V
- Description: A 12V battery for powering the water pump.
- Pins: +, -
Rain/Snow Sensor - Board
- Description: A sensor board for detecting rain or snow.
- Pins: 1, 2, A0 (Analog), D0 (Digital), GND, VCC (5V)
YL-83 Rain Sensor - Detection Board
- Description: A detection board for the rain sensor.
- Pins: POS, NEG
SparkFun Soil Moisture Sensor
- Description: A sensor for measuring soil moisture.
- Pins: VCC, GND, SIG
Soil Moisture Interceptor
- Description: A module for interfacing with the soil moisture sensor.
- Pins: AO, DO, GND, VCC
Wiring Details
Arduino Mega 2560
- 5V: Connected to VCC (5V) of Rain/Snow Sensor - Board, VCC of DHT11, VCC of Soil Moisture Interceptor, VCC of MQ-2, VCC of HC-05 Bluetooth Module, VCC of 5V Relay
- GND: Connected to GND of Rain/Snow Sensor - Board, GND of DHT11, GND of MQ-2, GND of HC-05 Bluetooth Module, GND of Soil Moisture Interceptor, GND of 5V Relay
- D2 PWM: Connected to DATA of DHT11
- D3 PWM: Connected to Digital of MQ-2
- D4 PWM: Connected to DO of Soil Moisture Interceptor
- D5 PWM: Connected to D0 (Digital) of Rain/Snow Sensor - Board
- D6 PWM: Connected to In of 5V Relay
- D10 PWM: Connected to TXD of HC-05 Bluetooth Module
- D11 PWM: Connected to RXD of HC-05 Bluetooth Module
DHT11
- DATA: Connected to D2 PWM of Arduino Mega 2560
- GND: Connected to GND of Arduino Mega 2560
- VCC: Connected to 5V of Arduino Mega 2560
MQ-2
- Digital: Connected to D3 PWM of Arduino Mega 2560
- GND: Connected to GND of Arduino Mega 2560
- VCC: Connected to 5V of Arduino Mega 2560
HC-05 Bluetooth Module
- TXD: Connected to D10 PWM of Arduino Mega 2560
- RXD: Connected to D11 PWM of Arduino Mega 2560
- GND: Connected to GND of Arduino Mega 2560
- VCC: Connected to 5V of Arduino Mega 2560
5V Relay
- In: Connected to D6 PWM of Arduino Mega 2560
- GND: Connected to GND of Arduino Mega 2560
- VCC: Connected to 5V of Arduino Mega 2560
- Common terminal: Connected to + of Battery 12V
- Normally Closed: Connected to VCC of Water Pump
Water Pump
- VCC: Connected to Normally Closed of 5V Relay
- GND: Connected to - of Battery 12V
Battery 12V
- +: Connected to Common terminal of 5V Relay
- -: Connected to GND of Water Pump
Rain/Snow Sensor - Board
- VCC (5V): Connected to 5V of Arduino Mega 2560
- GND: Connected to GND of Arduino Mega 2560
- D0 (Digital): Connected to D5 PWM of Arduino Mega 2560
- 1: Connected to POS of YL-83 Rain Sensor - Detection Board
- 2: Connected to NEG of YL-83 Rain Sensor - Detection Board
YL-83 Rain Sensor - Detection Board
- POS: Connected to 1 of Rain/Snow Sensor - Board
- NEG: Connected to 2 of Rain/Snow Sensor - Board
SparkFun Soil Moisture Sensor
- VCC: Connected to VCC of Soil Moisture Interceptor
- GND: Connected to GND of Soil Moisture Interceptor
Soil Moisture Interceptor
- DO: Connected to D4 PWM of Arduino Mega 2560
- GND: Connected to GND of Arduino Mega 2560
- VCC: Connected to 5V of Arduino Mega 2560
Documented 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