0% found this document useful (0 votes)
229 views5 pages

DIY Solar Tracker Arduino Project ITA

This document provides instructions for building a DIY solar tracker using an Arduino. It lists the required components which include an Arduino UNO, breadboard, resistors, photo resistors, servo motors, and solar panel. It also includes the necessary code to have the solar tracker follow the sun's movement using the photo resistors and servo motors to adjust the panel's orientation. The tracker works by comparing the light readings from different photo resistors and rotating the servo motors to maximize sunlight on the panel.

Uploaded by

Dang Anh Duy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
229 views5 pages

DIY Solar Tracker Arduino Project ITA

This document provides instructions for building a DIY solar tracker using an Arduino. It lists the required components which include an Arduino UNO, breadboard, resistors, photo resistors, servo motors, and solar panel. It also includes the necessary code to have the solar tracker follow the sun's movement using the photo resistors and servo motors to adjust the panel's orientation. The tracker works by comparing the light readings from different photo resistors and rotating the servo motors to maximize sunlight on the panel.

Uploaded by

Dang Anh Duy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

DIY Solar Tracker Arduino Project ITA

Components and supplies

Arduino UNO & Genuino UNO × 1

Breadboard (generic) × 1

Resistor 1k ohm × 4

SG90 Micro-servo motor × 2

Photo resistor × 4

Necessary tools and machines

3D Printer (generic)
About this project
DIY Solar Tracker Arduino Project ITA

Hi everyone, in this article we are going to make a Solar Tracker ("Solar Tracker") using Arduino. A
solar tracker is a mechanical-automatic device that through sensors can understand the position of the
Sun that thanks to the motors you can follow it so as to store more solar energy. Let's see how it builds
!!

Needs:

To carry out this project we need the following materials:

• Arduino UNO;

• 4 220 Ω resistors;

• 4 photoresistors;

• 2 Servomotors;

• Breadboard;

• Solar Panel ;

JOIN THE YOUTUBE CHANNEL = https://bit.ly/2Chdph2

For more information visit this website = http://www.ingeimaks.it/solartracker.html

CODE

//Ingeimaks
#include <Servo.h>
//definiamo i servomotori orizzontale e verticale
Servo servohori;
int servoh = 0;
int servohLimitHigh = 160;
int servohLimitLow = 60;

Servo servoverti;
int servov = 0;
int servovLimitHigh = 160;
int servovLimitLow = 60;
//Pin fotoresistenze
int ldrtopl = 2; //top left
int ldrtopr = 1; //top right
int ldrbotl = 3; // bottom left
int ldrbotr = 0; // bottom right

void setup ()
{
servohori.attach(10);
servohori.write(60);
servoverti.attach(9);
servoverti.write(60);
Serial.begin(9600);
delay(500);

void loop()
{
servoh = servohori.read();
servov = servoverti.read();
//Valore Analogico delle fotoresistenza
int topl = analogRead(ldrtopl);
int topr = analogRead(ldrtopr);
int botl = analogRead(ldrbotl);
int botr = analogRead(ldrbotr);
// Calcoliamo una Media
int avgtop = (topl + topr) ; //average of top
int avgbot = (botl + botr) ; //average of bottom
int avgleft = (topl + botl) ; //average of left
int avgright = (topr + botr) ; //average of right

if (avgtop < avgbot)


{
servoverti.write(servov +1);
if (servov > servovLimitHigh)
{
servov = servovLimitHigh;
}
delay(10);
}
else if (avgbot < avgtop)
{
servoverti.write(servov -1);
if (servov < servovLimitLow)
{
servov = servovLimitLow;
}
delay(10);
}
else
{
servoverti.write(servov);
}

if (avgleft > avgright)


{
servohori.write(servoh +1);
if (servoh > servohLimitHigh)
{
servoh = servohLimitHigh;
}
delay(10);
}
else if (avgright > avgleft)
{
servohori.write(servoh -1);
if (servoh < servohLimitLow)
{
servoh = servohLimitLow;
}
delay(10);
}
else
{
servohori.write(servoh);
}
delay(50);
}

You might also like