DIY Solar Tracker Arduino Project ITA
DIY Solar Tracker Arduino Project ITA
Breadboard (generic) × 1
Resistor 1k ohm × 4
Photo resistor × 4
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:
• Arduino UNO;
• 4 220 Ω resistors;
• 4 photoresistors;
• 2 Servomotors;
• Breadboard;
• Solar Panel ;
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