Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Arduino Based Solar Tracker Using LDR & Servo Motor
Arduino Projects

Arduino Based Solar Tracker Using LDR & Servo Motor

Mamtaz AlamBy Mamtaz AlamUpdated:November 27, 20237 Comments3 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Arduino Based Solar Tracker Using LDR & Servo Motor
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Introduction:

In this project, we are going to show you how to make an Arduino Based Solar Tracker Using LDR & Servo Motor. The Solar Panel Tracker is designed to follow the sun movement so that maximum light intensity hits on the solar panel, thus increasing the power efficiency.

We have designed a single-axis solar tracking system. In this system, the whole solar panel moves from east to west in a day to point in the direction of the sun. The use of a solar tracker circuit in the field of energy production will increase its efficiency. This system can also be successfully implemented in other solar energy-based projects like water heaters and steam turbines.


Arduino Based Solar Tracker Using LDR & Servo Motor

Components Required:

Following are the list of components required to design a Solar Tracker

  1. Arduino Uno Board
  2. Servo Motor SG90
  3. Tact Switch (Button)
  4. Resistors 10K – 3 Nos
  5. LDR – 2 Nos
  6. Breadboard
  7. Connecting Wires
  8. 5 to 12 Volt power Supply



Circuit Diagram

The circuit diagram for the Arduino Based Solar Tracker Using LDR & Servo Motor is given below. Assemble the circuit as shown below.

Arduino Based Solar Tracker Using LDR & Servo Motor


Project Design & Consideration:

  1. Fix the cardboard at the top of the Servo Motor that will face towards the SUN and rotate:

  2. Put a Blockage between the 2 LDR by keeping it at distance of at least 5 cm.


Working of the Project:

Two LDR’s (Light Dependent Resistor) LDR1 & LDR2 are connected to Analog pins of the Arduino. A solar plate is attached in parallel to the axis of the servo motor and both the sensors are kept on the solar plate as shown in the figure above. Learn about LDR Arduino working in our previous post.

The design & the arrangement is done in such a manner that the movement of the sun is from LDR1 to LDR2, as shown in the image below.

There are three cases that are to be followed:-

Case 1: Sun is in the left side
Light on LDR1 is high because the shadow of barrier falls on LDR2 so solar plate moves clockwise.


Case 2: Sun is in right Side
Light on LDR2 is high because the shadow of barrier falls on LDR1 so solar plate movie anticlockwise.

Case 3: Sun is in the Center
Light on both LDR’s is equal so, plate will not rotate in any direction.


Source Code/Program

For designing Arduino Based Solar Tracker Using LDR & Servo Motor you need to program Atmega 328 Arduino microcontroller. Below is the program that will interface servo motor & LDR with Arduino for Solar Tracking. Copy this code and upload it to your Arduino Board.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <EEPROM.h>
#include <Servo.h>
 
Servo myservo;
 
int sensor1=A1;
int sensor2=A0 ;
int calswitch=2;
 
int val1;
int val2;
 
int pos=0;
int error;
int state;
 
void setup() {
pinMode(sensor1,INPUT);
pinMode(sensor2,INPUT);
pinMode(calswitch,INPUT);
 
myservo.attach(10);
}
 
void loop() {
if(digitalRead(calswitch)==0) {
myservo.detach();
 
val1=analogRead(sensor1);
val2=analogRead(sensor2);
 
if (val1>val2) {error=val1-val2; state=0; }
else {error=val2-val1; state=1; }
 
EEPROM.write(0,error);
EEPROM.write(1,state);
 
delay(1000);
}
 
else{
myservo.attach(10);
 
val1=analogRead(sensor1);
val2=analogRead(sensor2);
 
state=EEPROM.read(1);
error=EEPROM.read(0);
 
if(state==0) { val1=val1-error;}
else { val2=val2-error;}
 
if (val1-val2>4) {myservo.write(pos); pos=pos-1; delay(10);}
else if (val2-val1>4) {myservo.write(pos); pos=pos+1; delay(10);}
else {myservo.write(pos);}
 
if (pos>90) {pos=90;}
else if (pos<0) {pos=0;}
 
}
}


Video Preview & Explanation:

Solar Panel Movement Tracker Using Arduino & Servo Motor
Watch this video on YouTube.

This project can be implemented with Solar MPPT Charge Controller to increase the efficiency of the Solar Panel output power.</p

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleControlling Stepper Motor with Joystick and Arduino
Next Article Interfacing NeoPixel LED Strip WS2812B with Arduino for Rainbow Color

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 7 Comments

7 Comments

  1. Akhilasree Nugula on October 2, 2018 8:16 PM

    Sir we have got the output…….tq for sharing sir……can you share the blockdiagram of this project

    Reply
    • Alex Newton on October 2, 2018 10:14 PM

      We don’t have block diagram but you can take help of this post. Read everything here and create your own block diagram.

      Reply
  2. shubham nayak on October 24, 2018 10:11 PM

    i have connected everything accordingly but servo motor is not working can you tell me what is the problem pls its urgent….

    Reply
    • Alex Newton on October 25, 2018 8:38 AM

      Check the program, servo pin number. And also check hardware connection, that should have same pin number.
      If still it does nt work may be servo is damaged.

      Reply
  3. Amit on November 29, 2018 4:13 PM

    i am not able to understand circuit diagram.

    Reply
  4. TAMMA on April 16, 2019 9:49 AM

    Can I implement same circuit using DC motor instead of servo motor. If possible tell me how to the code.

    Reply
  5. Jhanine on September 13, 2019 5:06 PM

    Hi. What is tactile switch for? What will happen if I dont use thw switch?

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 16, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • How to use ADS1115 16-Bit ADC Module with Arduino
    How to use ADS1115 16-Bit ADC Module with Arduino
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • Interfacing PN532 NFC RFID Module with Arduino
    Interfacing PN532 NFC RFID Module with Arduino
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.