Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Solar Panel Cleaning System with Water Pump and Servo Motor

View and Edit Project In Cirkit DesignerImage of Arduino UNO Solar Panel Cleaning System with Water Pump and Servo Motor

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 sprays water on the solar panel, and the servo motor, equipped with a sponge, rotates to clean the panel. The system is powered by a 9V battery and a 3.7V battery, with a relay used to control the water pump.

Component List

  1. Arduino UNO

    • Description: 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
  2. 9V Battery

    • Description: Provides power to the Arduino UNO.
    • Pins: -, +
  3. 5V Relay

    • Description: Electromechanical switch used to control the water pump.
    • Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC
  4. Water Pump

    • Description: Pumps water to clean the solar panel.
    • Pins: positive, negative
  5. 3.7V Battery

    • Description: Provides power to the water pump.
    • Pins: +, -
  6. Micro Servo 9G

    • Description: Small servo motor used to rotate the cleaning sponge.
    • Pins: GND, +5V, PWM
  7. Rocker Switch

    • Description: Switch used to control the power supply to the Arduino UNO.
    • Pins: 1, 2

Wiring Details

Arduino UNO

9V Battery

5V Relay

Water Pump

3.7V Battery

Micro Servo 9G

Rocker Switch

Code Documentation

/*
 * Solar Panel Cleaning System
 * This Arduino sketch controls a water pump and a servo motor to clean a solar
 * panel. The water pump will first spread water on the panel, and then the
 * servo motor with an attached sponge will rotate twice to clean the panel.
 */

#include <Servo.h>

// Pin definitions
const int relayPin = 2; // Relay control pin
const int servoPin = 4; // Servo control pin

// Create servo object
Servo myServo;

void setup() {
  // Initialize relay pin as an output
  pinMode(relayPin, OUTPUT);
  // Initialize servo
  myServo.attach(servoPin);
  // Ensure the relay is off initially
  digitalWrite(relayPin, LOW);
}

void loop() {
  // Turn on the water pump
  digitalWrite(relayPin, HIGH);
  delay(5000); // Run pump for 5 seconds
  // Turn off the water pump
  digitalWrite(relayPin, LOW);
  // Rotate the servo motor twice
  for (int i = 0; i < 2; i++) {
    myServo.write(180); // Rotate to 180 degrees
    delay(1000); // Wait for 1 second
    myServo.write(0); // Rotate back to 0 degrees
    delay(1000); // Wait for 1 second
  }
  // Wait for a while before the next cleaning cycle
  delay(60000); // Wait for 1 minute
}

This code initializes the relay and servo motor, then enters a loop where it turns on the water pump for 5 seconds, rotates the servo motor twice, and waits for 1 minute before repeating the cycle.