Single axis solar tracker project tutorial


What do you know about solar tracker? A solar tracker system is a system that follows the light according to its intensity. this is one of the most search Arduino project. there are two types of solar tracker projects available single-axis solar tracker and dual-axis solar tracker. single-axis solar tracker having one motor so it can rotate only on two dimensions. and dual-axis can rotate into 4 directions. single axis solar tracker

Hey guys, welcome back to Techatronic. we are Shahid and Adnan. I hope you all are good. This time we brought a very amazing project for you. which knowns as the Single axis solar tracker project.

Usually, solar panels are steady and always the front face of the sun rises in direction. this causes less amount of light incident on it. at the time of afternoon and evening when we will use this amazing solar tracker, it will move in the direction of the sun and catch more amount of light.



What is a Single Axis solar tracker?

The single-axis solar tracker project is a very good example of a mini project if you are looking for an electronics mini project. it is one of the most popular projects recently. single axis is just a system that follows the sunlight. by using this system you can make more power collected through the sunlight by the solar system. this system having a solar panel on it, all the systems track the light in two directions. for example, if the sun rises in the morning the system moves toward the same direction and for the evening also. now the sunset in opposite direction so the system will also move with the sun so the system can get the maximum power by the sun tracking. in solar panels make more power to more intensity. that means the solar power converted to electricity is directly proportional to the intensity of light.



How does it work?// working of single-axis solar tracker 

Single-axis solar tracker system content servo motors which help it to move in two directions in one axis. for example, it is for the x-axis then it will move in the +x axis and -x axis. and the rotating degree is dependent upon us usually we use 60 degrees in each direction. now, understands the working of this project. there is a sensor called LDR (light-dependent resistor). which decreases the resistance in the circuit when the light incident on it. there are two ldr in the circuit on both sides. so, which ldr shows the less resistance the motor will start to move in that direction. LDR gives output to the Arduino every time. and Arduino process the data comes from the  LDR and Sends instructions to the Servo motors.

I hope the above working on the project is sufficient to understand the project.



Components Used in Single Axis Solar tracker

  • Arduino Uno
  • 2 LDR
  • 2- 10K Ohm Resistor
  • 2- Servo Motor
  • Solar Panel
  • Jumper wire
  • Breadboard

Component Table / Buy Link

S.No Component Name Quantity Link
1. Arduino UNO 1
2. LDR 2
3. Solar Panel 1
4. Servo Motor 1
5. Jumper Wire 40
6. Bread board 1
7. 10k-ohm Resistor 2

Circuit Diagram for single-axis solar tracker


single-axis solar tracker circuit

Connection Table


Arduino UNO LDR
A0 LDR 1 Terminal 1
A1 LDR 2 Terminal 1
10K-ohmResistort LDR
R 1 Terminal 1 LDR 1 Terminal 1
R 2  Terminal 1 LDR 2 Terminal 1
10K-ohmResistort GND
R 1 Terminal 2 GND
R 2 Terminal 2 GND
5 V LDR 1 Terminal 2
5 V LDR 2 Terminal 2
Arduino Uno Servo Motor
Pin 9 Servo 1

single-axis solar tracker using Arduino code


#include <Servo.h> //including the library of servo motor
Servo sg90;
int initial_position = 90;
int LDR1 = A0; //connect The LDR1 on Pin A0
int LDR2 = A1; //Connect The LDR2 on pin A1
int error = 5;
int servopin=9; //You can change servo just makesure its on arduino’s PWM pin
void setup()

pinMode(LDR1, INPUT);
pinMode(LDR2, INPUT);
sg90.write(initial_position); //Move servo at 90 degree

void loop()
int R1 = analogRead(LDR1); // read LDR 1
int R2 = analogRead(LDR2); // read LDR 2
int diff1= abs(R1 – R2);
int diff2= abs(R2 – R1);

if((diff1 <= error) || (diff2 <= error)) {

} else {
if(R1 > R2)
initial_position = –initial_position;
if(R1 < R2)
initial_position = ++initial_position;


Upload the given code into the Arduino. if you have any questions regarding the solar tracker project you can ask in the comment section.


Video Sample

Arduino Ebook Buy link

Learn 10+ basic activities & sensor interfacing with our Arduino ebook. Well explained program. And brief circuit diagram WhatsApp and email support. which will help you to learn basic electronics, Arduino Coding, Sensor interfacing with Arduino, Arduino, and much more. buy Arduino Ebook to learn

4 thoughts on “Single axis solar tracker project tutorial”

Comments are closed.