Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Robotics & DIY

DIY 2-Axis Solar Tracker Robot: Dual Servo LDR System India

DIY 2-Axis Solar Tracker Robot: Dual Servo LDR System India

March 11, 2026 /Posted byJayesh Jain / 0

A solar tracker robot using dual servos and LDR sensors is one of the most rewarding robotics projects you can build in India. Solar trackers can improve panel energy harvest by 25-40% compared to fixed installations — and building one yourself costs a fraction of commercial systems. In this complete DIY guide, you’ll learn the circuit, code, and mechanical design for a 2-axis solar tracker that automatically follows the sun from sunrise to sunset.

Table of Contents

  1. How Solar Trackers Work
  2. Components Required
  3. LDR Sensor Circuit Design
  4. 2-Axis Mechanical Design
  5. Arduino Code for Dual Servo Control
  6. Calibration and Tuning Tips
  7. India-Specific Build Tips
  8. Frequently Asked Questions

How Solar Trackers Work

The principle is elegantly simple: four LDR (Light Dependent Resistor) sensors are arranged in a cross pattern on the solar panel. When the panel points directly at the sun, all four LDRs receive equal illumination. When the sun moves, one pair of LDRs receives more light than the other. The controller reads the difference and drives servos to re-align the panel.

A 2-axis tracker controls both azimuth (left-right, horizontal axis) and elevation (up-down, vertical axis), allowing it to follow the sun’s complete arc across the sky. This is more effective than a 1-axis tracker which only follows one plane of motion.

The key advantage of the LDR-based approach over a GPS/RTC time-based tracker is that it is self-correcting — clouds, reflections, and atmospheric refraction are automatically handled because the system responds to actual light, not a calculated sun position.

Components Required

Component Specification Qty
Servo Motor SG90 (for small panels) or MG996R (for panels up to 20W) 2
LDR Sensor 5mm standard photoresistor, 10kΩ in dark 4
Microcontroller Arduino Uno / Nano or ESP32 1
Resistors 10kΩ (for LDR voltage dividers) 4
Solar Panel 5W–20W, 12V (or 6V for small demo) 1
Power Supply 5V 2A (USB or regulator from solar panel) 1
Divider/Barrier Cross-shaped shadow divider (cardboard or 3D printed) 1
Frame Acrylic or aluminium angle bracket 1 set
TowerPro SG90 Servo Motor

TowerPro SG90 180 Degree Rotation Servo Motor

Lightweight 9g servo perfect for small solar tracker builds. 180° rotation range and easy PWM control from any Arduino or ESP32.

View on Zbotic

LDR Sensor Circuit Design

Each LDR forms a voltage divider with a 10kΩ fixed resistor. The output voltage (at the midpoint) feeds into an analog input of the Arduino:

5V ---[LDR]---+---[10kΩ]--- GND
              |
           Analog Pin (A0, A1, A2, A3)

When more light hits the LDR, its resistance falls and the analog voltage rises. Label your four sensors as:

  • LDR_TL (Top-Left) → A0
  • LDR_TR (Top-Right) → A1
  • LDR_BL (Bottom-Left) → A2
  • LDR_BR (Bottom-Right) → A3

Mount the four LDRs at the corners of the solar panel with a cross-shaped divider (roughly 3-4 cm tall) in the centre. This divider creates the shadow that lets the system detect which direction the light is coming from — without it, all four sensors always read the same value.

2-Axis Mechanical Design

The mechanical assembly is a pan-tilt platform. Here’s how to arrange it:

  1. Base servo (azimuth): Mount horizontally on a fixed base. Its output shaft rotates the entire upper assembly left and right.
  2. Tilt servo (elevation): Mount on a bracket attached to the base servo horn. Its output shaft tilts the solar panel up and down.
  3. Panel mount: Attach to the tilt servo horn. Position the LDR cross at the centre of the panel face.

For small demo builds (up to a 5W panel), SG90 servos and a 3D-printed or acrylic pan-tilt bracket work perfectly. For panels above 10W, upgrade to MG996R metal-gear servos which can handle the extra torque. Always add a counterbalance weight opposite to the panel to reduce servo load and improve tracking stability.

Servo SG90 9g

Servo SG90 9g 180 Degree

Budget-friendly SG90 servo for solar tracker elevation and azimuth axes. Good starting point for demo and school project builds.

View on Zbotic

Arduino Code for Dual Servo Control

Here is the complete Arduino sketch for the 2-axis LDR solar tracker:

#include <Servo.h>

Servo servoH;  // Horizontal (azimuth)
Servo servoV;  // Vertical (elevation)

const int LDR_TL = A0, LDR_TR = A1;
const int LDR_BL = A2, LDR_BR = A3;
const int TOLERANCE = 30;  // Dead band (tune to your hardware)
const int SERVO_DELAY = 15; // ms between steps
const int SERVO_STEP = 1;   // degrees per correction step

int posH = 90, posV = 90;   // Start at centre

void setup() {
  servoH.attach(9);
  servoV.attach(10);
  servoH.write(posH);
  servoV.write(posV);
  delay(1000);
}

void loop() {
  int tl = analogRead(LDR_TL);
  int tr = analogRead(LDR_TR);
  int bl = analogRead(LDR_BL);
  int br = analogRead(LDR_BR);

  int avgTop    = (tl + tr) / 2;
  int avgBottom = (bl + br) / 2;
  int avgLeft   = (tl + bl) / 2;
  int avgRight  = (tr + br) / 2;

  // Vertical correction
  int diffV = avgTop - avgBottom;
  if (abs(diffV) > TOLERANCE) {
    posV += (diffV > 0) ? SERVO_STEP : -SERVO_STEP;
    posV = constrain(posV, 10, 170);
    servoV.write(posV);
  }

  // Horizontal correction
  int diffH = avgLeft - avgRight;
  if (abs(diffH) > TOLERANCE) {
    posH += (diffH > 0) ? -SERVO_STEP : SERVO_STEP;
    posH = constrain(posH, 10, 170);
    servoH.write(posH);
  }

  delay(SERVO_DELAY);
}

Key parameters to tune:

  • TOLERANCE: Increase if the servos hunt/jitter. A value of 20-50 works for most builds.
  • SERVO_STEP: Smaller values (1°) give smoother but slower tracking. Larger values (2-3°) are faster but may overshoot.
  • SERVO_DELAY: Sets tracking update rate. 15-30 ms is typical.

Calibration and Tuning Tips

Getting a solar tracker to run smoothly requires a bit of field calibration:

  1. Match LDR values: Not all LDRs are identical. In a dark room, measure all four readings and note any offsets. Add correction constants to your code.
  2. Shadow divider height: Taller dividers (5-6 cm) give more sensitivity but reduce operating range. Start with 3 cm and adjust.
  3. Dead zone: The TOLERANCE constant creates a dead band. Too small → constant jitter, consuming servo life. Too large → lazy tracking and energy loss. Sweet spot is usually 15-40 ADC counts.
  4. Night-time handling: Add a threshold: if all LDR readings are below (say) 100, park the servos at a default position (east-facing at 30° elevation for India) and stop tracking until dawn.
  5. Cloud recovery: If all sensors read roughly equal (overcast), the tracker should hold its last position rather than hunting.

India-Specific Build Tips

Building a solar tracker in India comes with some unique considerations:

  • Sun path: India lies between 8°N and 37°N latitude. At tropical latitudes, the sun’s arc is nearly overhead — ensure your elevation servo can reach 85-90° at noon in summer.
  • Monsoon proofing: If building a permanent outdoor installation, use IP65-rated enclosures for electronics. Conformal coat the PCB. Use stainless steel hardware.
  • Servo corrosion: Cheap SG90 servos degrade quickly outdoors. For permanent builds, use sealed metal-gear servos.
  • Power budget: Two SG90 servos draw up to 500mA each when moving under load. A small 5V 2A UBEC powered from the solar panel’s battery handles this well.
  • LDR vs. current-sensing: For competition projects and higher accuracy, consider replacing LDRs with a small additional solar cell as the light sensor — its current output is a more linear measurement of irradiance.
Servo Mount Holder Bracket

Servo Mount Holder Bracket for SG90/MG90 (Pack of 2)

Pan-tilt compatible servo mounting brackets for building the 2-axis solar tracker frame. Works with SG90 and MG90 servos.

View on Zbotic

100pcs 5mm LED Assorted Kit

100pcs 5mm Light Assorted DIY LEDs Kit

Handy LED kit for adding status indicators to your solar tracker (tracking active, night mode, fault indication).

View on Zbotic

Frequently Asked Questions

How much energy gain does a 2-axis solar tracker provide in India?

In most parts of India, a 2-axis tracker increases solar energy capture by 30-40% compared to a fixed south-facing tilted panel. The gain is higher in northern states with greater seasonal sun angle variation and lower in equatorial southern states where the sun is more overhead.

Can I use LM393 comparators instead of analog reading?

Yes. LM393-based LDR modules give a digital output (HIGH/LOW) when one sensor is brighter than another. This simplifies the code but removes fine control — you can only move the servo at a fixed rate, not proportionally to the error. For a smooth tracker, analog reading (ADC) is preferred.

Why does my tracker jitter continuously?

The most common causes are: TOLERANCE set too low, LDR mismatch, or vibrations from mechanical play in the servo horn. Increase TOLERANCE to 40-60, check that LDRs are matched, and add thread-lock to horn screws.

Can this design work for a 100W solar panel?

Not directly with SG90 servos — a 100W panel weighs 5-8 kg and requires industrial-grade actuators. Scale up to linear actuators or worm-gear motors with encoder feedback for panels above 50W. The LDR sensor logic remains the same.

Is it worth adding an RTC to this design?

Yes, for production builds. An RTC + sun position algorithm can serve as a primary tracker (especially useful on cloudy days) while the LDR system handles fine correction. This hybrid approach is what commercial solar trackers use.

Get Your Solar Tracker Components

Zbotic.in stocks all the components you need to build a 2-axis solar tracker — servo motors, Arduino boards, LDR modules, mounting hardware, and more, all shipped fast across India. Start your solar robotics project today.

Shop Robotics Components

Tags: DIY robot, dual servo, LDR sensor, solar energy India, solar tracker
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Capacitive vs Resistive Touchs...
blog capacitive vs resistive touchscreen which is better for diy 597682
blog rain gauge sensor tipping bucket setup with arduino 597688
Rain Gauge Sensor: Tipping Buc...

Related posts

Svg%3E
Read more

Caterpillar Track Robot: Tank-Drive Build for All Terrain

April 1, 2026 0
When wheels lose grip on sand, gravel, grass, or loose surfaces, caterpillar tracks keep moving. A tank-track robot distributes its... Continue reading
Svg%3E
Read more

RC Car to Robot: Convert a Toy Car into an Autonomous Robot

April 1, 2026 0
That old RC toy car gathering dust can be transformed into an Arduino-controlled autonomous robot with just a few electronic... Continue reading
Svg%3E
Read more

Robotic Arm Kit India: Best Options for Students and Hobbyists

April 1, 2026 0
If you are a student or hobbyist looking to get into robotics, a robotic arm kit is one of the... Continue reading
Svg%3E
Read more

Sumo Robot: Competition Build Guide India

April 1, 2026 0
Sumo robot competitions are among the most exciting events in Indian robotics, pitting small autonomous robots against each other in... Continue reading
Svg%3E
Read more

Robot Arm Build: 6-DOF Servo Arm with Arduino Control

April 1, 2026 0
Building a 6-DOF robot arm with servo motors and Arduino is one of the most rewarding robotics projects you can... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now