Solar-Powered Arduino UNO Seed Sowing Machine with Moisture Sensing and Motor Control
View and Edit Project In Cirkit Designer
Solar Powered Seed Sowing Machine Circuit Documentation
Summary
The Solar Powered Seed Sowing Machine is an automated system designed to sow seeds and maintain soil moisture at an optimal level. The system is powered by a solar panel, which charges a lithium-ion battery through a SunnyBuddy charge controller. The Arduino UNO microcontroller serves as the central processing unit, interfacing with various sensors and actuators to control the machine's operations. The circuit includes sensors for line tracking and obstacle avoidance, an ultrasonic sensor for distance measurement, and a motor driver to control two DC motors. The embedded code on the Arduino UNO manages the soil moisture sensor and activates a water pump when the soil's moisture level falls below a predefined threshold.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- Provides digital and analog I/O pins for interfacing with sensors and actuators
SunnyBuddy-v13
- Solar charge controller designed for charging single-cell LiPo batteries
- Manages power flow from the solar panel to the battery
Polymer Lithium Ion Battery - Generic
- Rechargeable battery that provides power to the circuit
- Charged by the solar panel through the SunnyBuddy charge controller
Solar Panel
- Photovoltaic panel that converts sunlight into electrical energy
- Charges the lithium-ion battery via the SunnyBuddy charge controller
HC-SR04 Ultrasonic Sensor
- Sensor that measures distance by emitting ultrasonic waves
- Used for detecting objects in the path of the machine
KY-033 Line Tracking Sensor
- Sensor that detects lines or markings on the ground
- Guides the machine along a predetermined path
DC Motor (2x)
- Electric motors that drive the machine's wheels
- Controlled by the motor driver
Motor Driver
- Electronic module that drives the DC motors
- Receives control signals from the Arduino UNO
MKE-S11 IR Infrared Obstacle Avoidance Sensor
- Sensor that detects obstacles using infrared light
- Helps the machine avoid collisions
Wiring Details
Arduino UNO
- GND connected to common ground
- Vin connected to SunnyBuddy V_BATT
- 5V connected to KY-033 Line Tracking Sensor VCC
- A1 connected to HC-SR04 Ultrasonic Sensor ECHO
- A2 connected to KY-033 Line Tracking Sensor A0
- A3 connected to HC-SR04 Ultrasonic Sensor TRIG
- D8 connected to KY-033 Line Tracking Sensor D0
- D7 connected to Motor Driver pin7
- D5 connected to Motor Driver pin2
- D3 connected to MKE-S11 IR Infrared Obstacle Avoidance Sensor SIG
SunnyBuddy-v13
- GND connected to common ground
- GNDBREAK connected to Solar Panel -
- SFSASDF connected to Solar Panel +
- V_BATT connected to Arduino UNO Vin and Polymer Lithium Ion Battery - Generic VCC
Polymer Lithium Ion Battery - Generic
- GND connected to common ground
- VCC connected to SunnyBuddy V_BATT
Solar Panel
-
- connected to SunnyBuddy SFSASDF
-
- connected to SunnyBuddy GNDBREAK
HC-SR04 Ultrasonic Sensor
- VCC not connected
- TRIG connected to Arduino UNO A3
- ECHO connected to Arduino UNO A1
- GND connected to common ground
KY-033 Line Tracking Sensor
- A0 connected to Arduino UNO A2
- D0 connected to Arduino UNO D8
- GND connected to common ground
- VCC connected to Arduino UNO 5V
DC Motor
- pin 1 connected to Motor Driver pin3 (for one motor) and pin14 (for the other motor)
- pin 2 connected to Motor Driver pin6 (for one motor) and pin11 (for the other motor)
Motor Driver
- pin3, pin6, pin11, pin14 connected to respective DC Motor pins
- pin7 connected to Arduino UNO D7
- pin2 connected to Arduino UNO D5
- pin8 connected to common ground
- pin16 connected to SunnyBuddy V_BATT
MKE-S11 IR Infrared Obstacle Avoidance Sensor
- SIG connected to Arduino UNO D3
- 5V connected to SunnyBuddy V_BATT
- GND connected to common ground
Documented Code
/*
* Solar Powered Seed Sowing Machine
* This Arduino sketch controls a soil moisture sensor and a water pump.
* The system is powered by a solar panel and a lithium-ion battery.
* When the soil moisture level drops below a threshold, the water pump is activated.
*/
const int moistureSensorPin = A0; // Soil moisture sensor connected to A0
const int relayPin = 7; // Relay module connected to digital pin 7
const int threshold = 400; // Moisture level threshold
void setup() {
pinMode(relayPin, OUTPUT); // Set relay pin as output
digitalWrite(relayPin, HIGH); // Turn off the pump initially
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int moistureLevel = analogRead(moistureSensorPin); // Read moisture level
Serial.print("Moisture Level: ");
Serial.println(moistureLevel); // Print moisture level
if (moistureLevel < threshold) {
digitalWrite(relayPin, LOW); // Turn on the pump
Serial.println("Pump ON");
} else {
digitalWrite(relayPin, HIGH); // Turn off the pump
Serial.println("Pump OFF");
}
delay(2000); // Wait for 2 seconds before next reading
}
This code is designed to run on the Arduino UNO microcontroller. It reads the moisture level from a soil moisture sensor and controls a relay to power a water pump. The relay is activated when the moisture level falls below a set threshold, indicating that the soil is dry and needs watering. The system is designed to be energy efficient, running on power supplied by a solar panel and stored in a lithium-ion battery.