Arduino UNO Solar Panel Cleaning System with Water Pump and Servo Motor
View and Edit Project In Cirkit Designer
Solar Panel Cleaning System Documentation
Summary
This document provides a detailed overview of a solar panel cleaning system. The system uses an Arduino UNO microcontroller to control a water pump and a servo motor. The water pump is activated via a relay, and the servo motor is used to clean the solar panel. The system is powered by a 9V battery and a 3.7V battery.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
Water Pump
- Description: A small water pump used to spray water on the solar panel.
- Pins: VCC, GND
3.7V Battery
- Description: A battery providing 3.7V power.
- Pins: +, -
12V Relay
- Description: A relay module used to control the water pump.
- Pins: NO, COM, NC, IN, DC-, DC+
Micro Servo 9G
- Description: A small servo motor used to clean the solar panel.
- Pins: GND, +5V, PWM
9V Battery
- Description: A battery providing 9V power.
- Pins: -, +
Wiring Details
Arduino UNO
- 5V is connected to +5V of the Micro Servo 9G and NO of the 12V Relay.
- GND is connected to GND of the Micro Servo 9G, COM of the 12V Relay, and - of the 9V Battery.
- Vin is connected to + of the 9V Battery.
- D7 is connected to PWM of the Micro Servo 9G.
- D2 is connected to NC of the 12V Relay.
Water Pump
- VCC is connected to DC+ of the 12V Relay.
- GND is connected to - of the 3.7V Battery.
3.7V Battery
- + is connected to DC- of the 12V Relay.
- - is connected to GND of the Water Pump.
12V Relay
- NO is connected to +5V of the Micro Servo 9G and 5V of the Arduino UNO.
- COM is connected to GND of the Micro Servo 9G and GND of the Arduino UNO.
- NC is connected to D2 of the Arduino UNO.
- IN is not connected.
- DC+ is connected to VCC of the Water Pump.
- DC- is connected to + of the 3.7V Battery.
Micro Servo 9G
- GND is connected to COM of the 12V Relay and GND of the Arduino UNO.
- +5V is connected to NO of the 12V Relay and 5V of the Arduino UNO.
- PWM is connected to D7 of the Arduino UNO.
9V Battery
- - is connected to GND of the Arduino UNO.
- + is connected to Vin of the Arduino UNO.
Code Documentation
/*
* Solar Panel Cleaning System
* This code controls a water pump and a servo motor to clean a solar panel.
* The water pump is controlled via a relay connected to pin D2.
* The servo motor is connected to pin D7.
*/
#include <Servo.h>
#define RELAY_PIN 2
#define SERVO_PIN 7
Servo cleaningServo;
void setup() {
// Initialize relay pin as output
pinMode(RELAY_PIN, OUTPUT);
// Initialize servo motor
cleaningServo.attach(SERVO_PIN);
// Start with the relay off
digitalWrite(RELAY_PIN, LOW);
}
void loop() {
// Turn on the water pump
digitalWrite(RELAY_PIN, HIGH);
delay(5000); // Pump water for 5 seconds
// Turn off the water pump
digitalWrite(RELAY_PIN, LOW);
// Move the servo to clean the panel
cleaningServo.write(0); // Move to 0 degrees
delay(2000); // Wait for 2 seconds
cleaningServo.write(180); // Move to 180 degrees
delay(2000); // Wait for 2 seconds
// Repeat the cleaning process
cleaningServo.write(0); // Move back to 0 degrees
delay(2000); // Wait for 2 seconds
// Wait before the next cleaning cycle
delay(60000); // Wait for 1 minute
}
This code initializes the relay and servo motor in the setup function. In the loop function, it turns on the water pump for 5 seconds, then moves the servo motor to clean the solar panel by rotating it from 0 to 180 degrees and back to 0 degrees. This process repeats every minute.