Arduino-Controlled Soil Moisture Sensing with Automated Water Pump
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to monitor soil moisture using the SparkFun gator:soil sensor and control a water pump based on the moisture level. The system is powered by a 12V power supply and uses an Arduino UNO as the main microcontroller to process the sensor data and control a 12V single-channel relay, which in turn controls the water pump. The circuit ensures that the water pump is activated when the soil moisture falls below a certain threshold.
Component List
SparkFun gator:soil
- Description: A soil moisture sensor that outputs an analog signal corresponding to the moisture level in the soil.
- Pins: VCC, GND, SIG
12V Power Supply
- Description: Provides the necessary power to the circuit components.
- Pins: + (Positive), - (Negative)
Arduino UNO
- Description: A microcontroller board based on the ATmega328P, used for processing sensor data and controlling the relay.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13
Water Pump
- Description: An electric pump used for pumping water, controlled by the relay.
- Pins: VCC, GND
2.1mm Barrel Jack with Terminal Block
- Description: Connects the external 12V power supply to the circuit.
- Pins: POS (Positive), NEG (Negative)
12V Single Channel Relay
- Description: An electromechanical switch used to control the high-power water pump with the low-power Arduino.
- Pins: NC (Normally Closed), COM (Common), NO (Normally Open), IN (Input), GND, VCC
Wiring Details
SparkFun gator:soil
- VCC: Connected to the 5V output from the Arduino UNO.
- GND: Connected to the common ground net in the circuit.
- SIG: Connected to the A0 analog input pin on the Arduino UNO.
12V Power Supply
- + (Positive): Connected to the POS pin of the Barrel Jack and the COM pin of the relay.
- - (Negative): Connected to the common ground net in the circuit.
Arduino UNO
- Vin: Connected to the POS pin of the Barrel Jack to receive 12V power.
- GND: Connected to the common ground net in the circuit.
- 5V: Provides power to the SparkFun gator:soil sensor.
- A0: Receives the analog signal from the SparkFun gator:soil sensor.
- D7: Controls the IN pin of the relay to switch the water pump on and off.
Water Pump
- VCC: Connected to the NO (Normally Open) pin of the relay.
- GND: Connected to the common ground net in the circuit.
2.1mm Barrel Jack with Terminal Block
- POS (Positive): Connected to the + (Positive) pin of the 12V power supply and the Vin pin of the Arduino UNO.
- NEG (Negative): Connected to the common ground net in the circuit.
12V Single Channel Relay
- VCC: Connected to the 5V output from the Arduino UNO.
- GND: Connected to the common ground net in the circuit.
- IN: Controlled by the D7 digital output pin on the Arduino UNO.
- COM (Common): Connected to the + (Positive) pin of the 12V power supply.
- NO (Normally Open): Connected to the VCC pin of the water pump.
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 is a template and does not contain any functional logic. It needs to be implemented to read the soil moisture sensor data from the A0 pin, process the data, and control the relay connected to the D7 pin accordingly.