
How it works?
Movement:
The whole movement of the Solare tracker is made using 2 Servos.
First servo MG995 in the base which controls the horizontal move(left-right) , Second servo SG90 a smaller servo controls the vertical move(up-down).
Solar Panel:
When the sun shines onto a solar panel, energy from the sunlight is absorbed by the PV cells in the panel.
This energy creates electrical charges that move in response to an internal electrical field in the cell, causing electricity to flow.
How the LDR'S work?
LDR - Light Depended Resistor
Depending on how much light strikes the LDR it outputs analog voltage which is measured by an analog input pin on the Arduino.
The logic behind the solar tracking is simple. we have 4 LDRS placed in a square 2x2 in between them there is a barrier to prevent light from other directions to get on it. in the code we simply calculate the average value of ever side(top, bottom, left, right) and with IF() functions we check the light source position.
if ((average_right - average_left) > LIGHT_THRESHOLD && pos_sh > LOWER_LIMIT_POS) { pos_sh++; servo_horizontal.write(pos_sh); }For example: if the light source located to the right from the LDR's the average of the right side LDR's(Top Right, Bottom Right) will be higher then the left side(Top Left, Bottom Left) so the servo will go to the right by adding digress to the Horizontal Servo.

Voltage measuring using a voltage divider:
A voltage divider is a simple circuit which turns a large voltage into a smaller one. Using just two series resistors and an input voltage, we can create an output voltage that is a fraction of the input. Voltage dividers are one of the most fundamental circuits in electronics.
We need it because solar panels can output more then 5V, and because we read the voltage through Arduino analog Pin A0, we cant input to it more then 5V.
For example: if the input voltage from the solar panel is 9V, and we put it through voltage divider with 3 identical resistors connected in a row and measure the voltage after 2 resistors, we will get ~3v. in other words 1/3 of the input voltage.
like in this schematic:

Because of the Voltage divider we need to calculate the real voltage in the code. its simple:
input_voltage = analogRead(Voltage_pin);real_voltage = 3*((input_voltage*5.0)/1024);LCD I2C:
If you’ve ever tried to connect a regular LCD display to an Arduino, you might have noticed that it consumes a lot of pins on the Arduino. it requires a total of seven connections! – which is half of the Arduino’s available digital pins. but this chip converts the I2C data from an Arduino into the parallel data required for an LCD display. witch give us only 2 connections! for data(SDA, SCL) and 2 more for VCC and GND The board also comes with a small trim potentiometer to make fine adjustments to the display's contrast.
EXPANDED TECHNICAL DETAILS
Solar Pathfinding Logic
This tracker increases solar panel efficiency by up to 40% by maintaining absolute alignment with the sun's position.
- Quadrantal LDR Array: Features four Light Dependent Resistors separated by a physical cross-divider. If the sun moves, one quadrant receives more light, creating a voltage imbalance.
- Actuation Stage: The Arduino reads these analog values and commands two Servo Motors (Pitch and Yaw) to pivot the panel until the light is balanced once again.
Efficiency Analytics
- Low-Power Seek: When the sun is obscured by clouds, the motors enter a "low-duty" cycle to save power.
- Automatic Reset: At night, the system detects a total loss of light and automatically rotates the panels back to the East, awaiting the next sunrise.