Arduino Nano and ESP32-Based Smart Soil Monitoring and Irrigation System with Wireless Communication
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino Nano microcontroller interfacing with various sensors, a relay, a water pump, and an NRF24L01 wireless module. The circuit is designed to monitor soil moisture and temperature, control a water pump, and communicate wirelessly.
Component List
Arduino Nano
- Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
- Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
NRF24L01
- Description: A wireless transceiver module for low-power, high-speed communication.
- Pins: IRQ (not used), MOSI, CSN, VCC (3V), GND, CE, SCK, MISO
NPK Soil Sensor (mini)
- Description: A sensor to measure the nitrogen, phosphorus, and potassium levels in the soil.
- Pins: VCC, GND, A, B
DS18B20 1-Wire Temperature Sensor Probe Cable
- Description: A digital temperature sensor with a 1-Wire interface.
- Pins: shield, GND, DQ, VDD
RS-485 Module
- Description: A module for RS-485 communication, allowing for long-distance, reliable data transmission.
- Pins: VCC, B, A, GND, RO, RE, DE, DI
DFRobot Capacitive Soil Moisture Sensor (V1.0)
- Description: A capacitive soil moisture sensor for measuring soil moisture levels.
- Pins: A, VCC, GND
ESP32 (30 pin)
- Description: A powerful microcontroller with integrated Wi-Fi and Bluetooth.
- Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3
1-Channel Relay (5V 10A)
- Description: A relay module for controlling high-power devices.
- Pins: NC, signal, C, power, NO, ground
5V Mini Water Pump
- Description: A small water pump powered by 5V.
- Pins: positive pin, negative pin
2x 18650
- Description: A battery pack consisting of two 18650 lithium-ion cells.
- Pins: vcc, gnd
Wiring Details
Arduino Nano
- GND: Connected to GND of RS-485 Module, DS18B20, NRF24L01, 5V Mini Water Pump, DFRobot Capacitive Soil Moisture Sensor, 2x 18650, and NPK Soil Sensor.
- D2: Connected to RO of RS-485 Module.
- D3: Connected to DI of RS-485 Module and signal of 1-Channel Relay.
- D5: Connected to shield of DS18B20.
- D7: Connected to DE of RS-485 Module.
- D8: Connected to RE of RS-485 Module.
- D9: Connected to CE of NRF24L01.
- D10: Connected to CSN of NRF24L01.
- D11/MOSI: Connected to MOSI of NRF24L01.
- D12/MISO: Connected to MISO of NRF24L01.
- 5V: Connected to VCC of RS-485 Module, vcc of 2x 18650, and NO of 1-Channel Relay.
- A5: Connected to VCC of NPK Soil Sensor.
- A0: Connected to A of DFRobot Capacitive Soil Moisture Sensor.
- 3V3: Connected to VDD of DS18B20, VCC (3V) of NRF24L01, VCC of DFRobot Capacitive Soil Moisture Sensor, and power of 1-Channel Relay.
- D13/SCK: Connected to SCK of NRF24L01.
NRF24L01
- MOSI: Connected to D11/MOSI of Arduino Nano.
- CSN: Connected to D10 of Arduino Nano.
- VCC (3V): Connected to 3V3 of Arduino Nano.
- GND: Connected to GND of Arduino Nano.
- CE: Connected to D9 of Arduino Nano.
- SCK: Connected to D13/SCK of Arduino Nano.
- MISO: Connected to D12/MISO of Arduino Nano.
NPK Soil Sensor (mini)
- VCC: Connected to A5 of Arduino Nano.
- GND: Connected to GND of Arduino Nano.
- A: Connected to A of RS-485 Module.
- B: Connected to B of RS-485 Module.
DS18B20 1-Wire Temperature Sensor Probe Cable
- shield: Connected to D5 of Arduino Nano.
- GND: Connected to GND of Arduino Nano.
- VDD: Connected to 3V3 of Arduino Nano.
RS-485 Module
- VCC: Connected to 5V of Arduino Nano.
- B: Connected to B of NPK Soil Sensor.
- A: Connected to A of NPK Soil Sensor.
- GND: Connected to GND of Arduino Nano.
- RO: Connected to D2 of Arduino Nano.
- RE: Connected to D8 of Arduino Nano.
- DE: Connected to D7 of Arduino Nano.
- DI: Connected to D3 of Arduino Nano.
DFRobot Capacitive Soil Moisture Sensor (V1.0)
- A: Connected to A0 of Arduino Nano.
- VCC: Connected to 3V3 of Arduino Nano.
- GND: Connected to GND of Arduino Nano.
ESP32 (30 pin)
- D23: Connected to MOSI of NRF24L01.
- D19: Connected to MISO of NRF24L01.
- D18: Connected to SCK of NRF24L01.
- D5: Connected to CSN of NRF24L01.
- D4: Connected to CE of NRF24L01.
- GND: Connected to GND of NRF24L01.
- 3V3: Connected to VCC (3V) of NRF24L01.
1-Channel Relay (5V 10A)
- signal: Connected to D3 of Arduino Nano.
- ground: Connected to GND of Arduino Nano.
- NO: Connected to 5V of Arduino Nano.
- power: Connected to 3V3 of Arduino Nano.
- C: Connected to positive pin of 5V Mini Water Pump.
5V Mini Water Pump
- positive pin: Connected to C of 1-Channel Relay.
- negative pin: Connected to GND of Arduino Nano.
2x 18650
- vcc: Connected to 5V of Arduino Nano.
- gnd: Connected to GND of Arduino Nano.
Code
Arduino Nano Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Documentation (documentation.txt)
This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used in the microcontroller.