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

Solar-Powered Arduino Algae Control System with TDS Sensor and Water Pump

View and Edit Project In Cirkit DesignerImage of Solar-Powered Arduino Algae Control System with TDS Sensor and Water Pump

Circuit Documentation

Summary

This document provides a detailed overview of an Algae Control System circuit. The system is designed to monitor water quality using a TDS sensor and control a water pump and a servo motor based on the sensor readings. The circuit is powered by a solar panel and a battery pack, and it includes an Arduino UNO microcontroller to manage the operations.

Component List

  1. Solar Panel

    • Description: Converts sunlight into electrical energy.
    • Pins: +, -
  2. Charger

    • Description: Charges the battery pack using the solar panel.
    • Pins: IN+, IN-, OUT+, OUT-
  3. Rocker Switch

    • Description: Manually controls the power flow from the solar panel to the charger.
    • Pins: input, output
  4. 4 x AAA Battery Mount

    • Description: Holds and connects four AAA batteries to provide power.
    • Pins: +, -
  5. Arduino UNO

    • Description: Microcontroller used to control the system.
    • 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
  6. TDS Sensor

    • Description: Measures the Total Dissolved Solids (TDS) in the water.
    • Pins: P1, P2, +, -, A
  7. 1 Channel Relay 5V

    • Description: Controls the water pump based on the Arduino's signal.
    • Pins: VCC, GND, IN, NC, COM, NO
  8. 5V Mini Water Pump

    • Description: Pumps water for filtration.
    • Pins: positive pin, negative pin
  9. Micro Servo 9G

    • Description: Scrapes excess algae.
    • Pins: GND, +5V, PWM
  10. Probe EC Sensor

    • Description: Measures electrical conductivity in the water.
    • Pins: to Probe

Wiring Details

Solar Panel

Charger

Rocker Switch

4 x AAA Battery Mount

Arduino UNO

TDS Sensor

1 Channel Relay 5V

5V Mini Water Pump

Micro Servo 9G

Probe EC Sensor

Documented Code

// Arduino Sketch for Algae Control System
// This code reads the TDS sensor to monitor water quality. If the TDS value
// exceeds a threshold, it activates a relay to turn on a water pump for
// filtration. Additionally, a servo motor is used to scrape excess algae.

#include <Servo.h>

// Pin definitions
const int tdsSensorPin = A0; // TDS sensor connected to analog pin A0
const int relayPin = 11;     // Relay control pin connected to digital pin 11
const int servoPin = 9;      // Servo control pin connected to digital pin 9

// TDS threshold for algae control
const int tdsThreshold = 500;

Servo myServo;

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  
  // Initialize relay pin as output
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, LOW); // Ensure relay is off
  
  // Initialize servo
  myServo.attach(servoPin);
  myServo.write(0); // Initial position
}

void loop() {
  // Read TDS sensor value
  int tdsValue = analogRead(tdsSensorPin);
  Serial.print("TDS Value: ");
  Serial.println(tdsValue);
  
  // Control water pump based on TDS value
  if (tdsValue > tdsThreshold) {
    digitalWrite(relayPin, HIGH); // Turn on water pump
  } else {
    digitalWrite(relayPin, LOW); // Turn off water pump
  }
  
  // Control servo to scrape algae
  myServo.write(90); // Move servo to 90 degrees
  delay(1000); // Wait for 1 second
  myServo.write(0); // Move servo back to 0 degrees
  delay(1000); // Wait for 1 second
  
  // Delay before next reading
  delay(2000);
}

This code initializes the TDS sensor, relay, and servo motor. It continuously reads the TDS value and controls the water pump and servo motor based on the sensor readings. The relay is used to turn the water pump on and off, while the servo motor is used to scrape excess algae.