Solar Tracker

Introducere

A solar tracking device using two servomotors to move in two directions and 4 photoresistors to always follow the strongest source of light. The solar panel built on the structure driven by the motors will follow the strongest light source and charge an LED.

Descriere generală

The 4 photoresistors change their resistance depending on how much light hits them so that when it is dark they have a high resistance and when light hits them they have a lower resistance. Using a voltage divider we can determine which side is darker or more illuminated and move the device with the servomotors accordingly so that all photoresistors have similar resistances. A solar panel will be mounted on the platform controlled by the motors and it will attempt to power an LED.

Hardware Design

Hardware Components:

  • Arduino Uno R3
  • 2 servomotors SG90
  • 4 photoresistors
  • 1 solar panel
  • resistors
  • breadboard

Software Design

int topleft; int topright; int downleft; int downright; int waittime = 1;

void setup() {

pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
TCCR1A = 0;
TCCR1A = (1 << COM1A1) | (1 << COM1B1) | (1 << WGM11);
TCCR1B = 0;
TCCR1B = (1 << WGM13) | (1 << WGM12) | (1 << CS11);
ICR1 = 40000;
OCR1A = 3000;
OCR1B = 3600;

}

void loop() {

topleft = analogRead(A0);
topright = analogRead(A1);
downleft = analogRead(A2);
downright = analogRead(A3);
if (topleft > topright) {
  OCR1A = OCR1A + 1;
  delay(waittime);
}
if (downleft > downright) {
  OCR1A = OCR1A + 1;
  delay(waittime);
}
if (topleft < topright) {
  OCR1A = OCR1A - 1;
  delay(waittime);
}
if (downleft < downright) {
  OCR1A = OCR1A - 1;
  delay(waittime);
}
if (OCR1A > 4000) {
  OCR1A = 4000;
}
if (OCR1A < 2000) {
  OCR1A = 2000;
}
if (topleft > downleft) {
  OCR1B = OCR1B - 1;
  delay(waittime);
}
if (topright > downright) {
  OCR1B = OCR1B - 1;
  delay(waittime);
}
if (topleft < downleft) {
  OCR1B = OCR1B + 1;
  delay(waittime);
}
if (topright < downright) {
  OCR1B = OCR1B + 1;
  delay(waittime);
}
if (OCR1B > 4200) {
  OCR1B = 4200;
}
if (OCR1B < 2400) {
  OCR1B = 2400;
}

}

Rezultate Obţinute

Concluzii

The solar tracker manages to follow the light well in all directions limited by the maximum rotation angle of the servomotors. Due to imbalances in the construction of the frame the tracker overshoots its movement due to the inertia of the frame and that causes a slight wiggle.

Download

pm/prj2022/agmocanu/solartracker.txt · Last modified: 2022/05/27 13:13 by bogdan_florin.cutur
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0