solar tracker is a mechanical-automatic device that through sensors it can understand the position of the Sun and moves according to this position and this happen by motors that can follow it so as to store more solar energy
Because this idea allows us to get as much solar energy as possible and thus get a great deal of electricity generated
I inspired this idea from online projects and i always wanted to make this project in college but i didn't have chance to make it
in this project i used all i learned in diploma like the following :
1- i used fusion 360 to design the project Which contains 3 fils (project Base - servo places - solar base ) and after that i used grabcad website to download the electronics and put them in the drawing to increase the accuracy of their placement. like (bush button - LCD display - arduino - bread board- 2 Potentiometer )
2- i used also fritzing program to draw my electronics circuit
3- i used laser cutter software to prepare my design to cut and engrave in laser machine (the materials i used in laser cutter machine is plywood)
4- i used prusa slicer to convert STL format to Gcode and set some things on the design like layer height and adding supports or not and control choose the number of infill and choose print settings 0.2 mm or 0.3 mm and make sure of time and how much filament grams i used (the materials i used in 3D printer machine is black PLA filament)
5- i used also arduino software to write my code and use serial monitor
I used laser cutter machine to cut and engrave (project base & solar base design)
After completing the design of the solar tracker on fusion 360 software, the design is saved in DXF format then we take this design and put on laser works program and adjust the settings for the cut - scan (cut speed is 25 power is 65 ,scan speed is 300 power is 25 ) then download of the file to laser cutter device but before
that must go to the laser cutter device and adjust some things on it
1.move the machine head to the
top-left corner of the machine.
2.Checking machine focus by
pressing the Pulse button for less than a second.
3.Set the effective cutting area
for your job. This can be done by moving the laser pointing nozzle to the
top-left point of the cut area you’ll be using and pressing Origin
4. Now We’ll make the machine move
like it’s cutting a rectangular piece of wood that can contain our design size
but without emitting a laser and this to make sure that the effective cutting
area will be capable of containing our design.
5. You can also Calculate the
estimated working time for your job.
6. Close the Laser Cutter lid door.
and Now you can run the job
I used 3D printer to print (vertical and horizontal servo holder)
After completing the design of the solar tracker on fusion 360 software, the design is saved in STL format then we take this design and put on prusa slicer program and adjust the settings
After making sure of the previous setting I changed the filament to black PLA next i upload the design to memory card in GCODE format note: you should Make sure that the filament temperature range includes the 210°C
Steps:
1- Insert the memory card to the machine
2- wait for a second until “Card Inserted” message appear
3- Click the control knob to access the Main Menu Then Select your file name
4- During the printing process, you can increase the printer speed by rotating the control knob This should increase the feed rate percentage.
my circuit components :
1- Arduino uno the controller
2- (2) Potentiometer will control of the direction of the 2 servo manually will connect to Arduino as analog INPUT Pin(A4-GND-5V) for vertical servo and (A5-GND-5V) pins for horizontal servo
3- Push button will change the mode of the circuit from manual to automatic and vice versa will connect to Arduino as digital INPUT Pin(2-GND)
4- (4) LDR sense the amount of sunlight falling on them. Four LDRs are divided into top, bottom, left , right and send date to Arduino as analog INPUT pin(A0-A1-A2-A3)
5- (4) 220 ohm resistor will connect between (GND) & (LDR) & (ANALOG INPUT OF ARDUINO)
6- Jumpers for Connections
7- Bread board
8- (2) servo one of them will control the vertical direction of solar panel pins (GND-5V- 9) and the second will control the horizontal direction pins (GND-5V-10) and connected as ACTION COMPONENTS
9- Power supply 9V will supply the Arduino and servo motors
10- Solar panel
11- LCD screen
12-Voltage regulator l7805cv
Voltage regulator l7805c
to supply the motors and Arduino together I used 9V.2A adapter
arduino works on 5 volt using 5V pin as power input but servo motors some times need high currant than the Arduino could supply to them and this can make short circuit in Arduino so we will use a simple (l7805cv) voltage regulator to reduce the volt from 9V to 5V And prevent short circuit note : you have to connect all grounds together in the middle pin in (l7805cv)
#include <Servo.h> //First I include the library of servo motors
int mode = 0;
int buttonState1 = 0;
int prevButtonState1 = 0;
int potpin = A4; // analog pin used to connect the potentiometer
int potpin2 = A5; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
Servo servohori;
int servoh = 0;
int servohLimitHigh = 120;
int servohLimitLow = 35;
Servo servoverti;
int servov = 75;
int servovLimitHigh = 120;
int servovLimitLow = 35;
//Pin fotoresistenze
int ldrtopl = A2; //top left LDR
int ldrtopr = A1; //top right LDR
int ldrbotl = A3; // bottom left LDR
int ldrbotr = A0; // bottom right LDR
after that I integrated every variable I have like next:
push button-(2) Potentiometer - (4)LDR sensor – (2) servo
void setup ()
{
pinMode(2, INPUT_PULLUP); //Mode switch Button
pinMode(A1, INPUT);
pinMode(A2, INPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(A5, INPUT);
pinMode(A6, INPUT);
servohori.attach(10); //Potentiometer for right-left movement
servohori.write(60);
servoverti.attach(9); // Potentiometer for up-down movement
servoverti.write(60);
Serial.begin(9600);
delay(500);
}
void loop()
{
char Mode;
buttonState1 = digitalRead(2);
if (buttonState1 != prevButtonState1) {
if (buttonState1 == HIGH) { //Change mode and light up the correct indicator
if (mode == 1) {
mode = 0;
} else {
mode = 1;
}
}
}
prevButtonState1 = buttonState1;
delay(50); // Wait for 50 millisecond(s)
if (mode == 0) {
Mode = 'M';
Serial.println(Mode); //send Mode "Manual" to serial port
manualsolartracker();
} else { // mode automatic
Mode = 'A';
Serial.println(Mode);
automaticsolartracker(); //send Mode "Automatic" to serial port
}
}
void automaticsolartracker() {
servoh = servohori.read();
servov = servoverti.read();
int topl = analogRead(ldrtopl);
delay(50);
int topr = analogRead(ldrtopr);
delay(50);
int botl = analogRead(ldrbotl);
delay(50);
int botr = analogRead(ldrbotr);
delay(50);
int avgtop = (topl + topr) / 2 ; //average of top solar panel
int avgbot = (botl + botr) / 2 ; //average of bottom solar panel
int avgleft = (topl + botl) / 2 ; //average of left solar panel
int avgright = (topr + botr) / 2 ; //average of right solar panel
// calculate the average of every direction
if (avgtop < avgbot)
{
servoverti.write(servov - 5);
if (servov > servovLimitHigh)
{
servov = servovLimitHigh;
}
delay(10);
}
else if (avgbot < avgtop)
{
servoverti.write(servov + 5);
if (servov < servovLimitLow)
{
servov = servovLimitLow;
}
delay(10);
// after that We'll compare the average of each direction and will move the servo motor in direction of the less LDR resistor
}
else
{
servoverti.write(servov);
}
if (avgleft > avgright)
{
servohori.write(servoh + 5);
if (servoh > servohLimitHigh)
{
servoh = servohLimitHigh;
}
delay(10);
}
else if (avgright > avgleft)
{
servohori.write(servoh - 5);
if (servoh < servohLimitLow)
{
servoh = servohLimitLow;
}
delay(10);
}
else
{
servohori.write(servoh);
}
delay(50);
}
void manualsolartracker() {
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 35, 120); // scale it to use it with the servo (value between 35 and 120) To prevent the project base from colliding with the solar panel
servoverti.write(val); // sets the servo position according to the scaled value
delay(15);
val = analogRead(potpin2);
val = map(val, 0, 1023, 35, 120);
servohori.write(val);
delay(15);
}
1- I connected the physical components together in home and test them after a lot of debug I go to lab to ask my instructor to help me in code
2- cut & printer the design I made on fusion 360
3- integrate the 3D printed parts together and put in them the physical components of the manual mode the (2) Potentiometer & push button
4- integrate the laser cut parts with 3D printer parts together and put in them the physical components that I tasted using a lot of Screws & nuts
5- test the circuit again with the code
6- after some help from my instructor in code this time the code work well
At the beginning of the project, I ask Sherif for his opinion and feedback and he told me to put a voltage sensor to read the voltage that comes from solar panel but it didn’t work because I need another analog pin because I used all analog pins in Arduino .
I helped shadi in his design & integrate the parts together , and help gendy in his project of week 8
Shadi also help me by printing for me some things I needed in my project
Menna Elbadry and Ahmed Khaled and sherif helped me in my code and big thank for them
i got some stuck in design and got to videos of week 2 and 3 to solve it and faced a problem in code that the servo was going in wrong direction i search in YouTube to solve the problem but it didn’t work so I ask the Instructor for help and it work well after that
and got stuck in wiring some components like how much resistor ohm need to put with LDR sensor so I search in google and find the solutions
1- I will change the Arduino uno to Arduino mega because he has more analog pins
2- I will make LCD screen work and display of the voltage sensor