Jump to main content

Build and Test a Sun-Tracking Solar Panel

1
2
3
4
5
97 reviews

Abstract

How can you get as much power as possible out of a solar panel, even in the morning or evening when the sun is low in the sky? With a solar tracker system! While many solar panels are fixed in place on rooftops or large ground-mounted poles, a solar tracker system is motorized and lets the solar panels track the sun through the sky during the day. Are these systems worth the added complexity? How much more power do they produce? Try this project and find out! 

Summary

Areas of Science
Difficulty
Method
Time Required
Average (6-10 days)
Prerequisites

Previous experience with Arduino is recommended. See our How to Use an Arduino page for tutorials.

Material Availability

A kit is available from our partner Home Science Tools®. See the Materials section for details.

Cost
High ($100 - $150)
Safety

No issues

Credits
Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

Objective

Design and build a solar tracker system and evaluate its performance. 

Introduction

Solar power is a form of renewable energy that converts sunlight into electricity using solar panels (Figure 1). Solar panels can be mounted on rooftops or on the ground. They can even be mixed into agricultural spaces for livestock or crops using a technique called agrivoltaics (Figure 2).

Figure 1. An array of solar panels on a rooftop.
Figure 2. Sheep grazing under solar panels.

The amount of electrical power produced by a solar panel depends on the amount of sunlight hitting it. A solar panel will produce maximum power when it is perpendicular to the sun's rays (Figure 3). The sun moves east to west through the sky during the day, so solar panels will produce less power in the morning and evening when the sun is lower in the sky. The sun's position in the sky also changes from north to south throughout the year. Fixed solar panels, like those in Figures 1 and 2, are oriented to maximize the total amount of power that they produce throughout the year. These systems have the advantage of being simple and low-maintenance because they have no moving parts, but they do not produce the maximum possible amount of power.

Figure 3. Side view of a solar panel showing how it will produce maximum power when it is perpendicular to the sun's rays.

Solar trackers (Figure 4) are an alternative to fixed-mount systems. These trackers are motorized and move the panels to keep them pointed directly at the sun. Single-axis trackers have a single axis of rotation, usually to track the sun's east-west movement. Dual-axis trackers have two axes of rotation, so they can also track the sun's seasonal north-south movement. These systems will produce more power for a given solar panel size but are more complex and require maintenance since they have moving parts.

Figure 4. A solar tracker system.

In this project, you will design and build your own solar tracker system. The tracker will use two light sensors, called photoresistors, to track the sun. When both sensors are pointed directly at the sun, they will give equal readings, and the servo motor that aims the solar panel will not move. When one sensor is shaded, the motor will rotate until they both give equal readings again. You will also measure the performance of your tracker. One way to do this is to measure the voltage produced by your solar panel. The voltage will be higher when the panel is perpendicular to the sun's rays. You can track how the voltage changes throughout the day for a fixed-mount system and for your tracking system. Do you think the extra complexity of the tracking system is worth it? Try this project and find out!

If you need to learn how to use photoresistors or servo motors with an Arduino before you begin, check out these two videos:

Terms and Concepts

Questions

Bibliography

Materials and Equipment Buy Kit

Recommended Project Supplies

Get the right supplies — selected and tested to work with this project.

View Kit

Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools®, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at [email protected].

Experimental Procedure

This project follows the Scientific Method. Review the steps before you begin.
Before you begin: Review How to Use an Arduino Tutorials 1-3.

Assemble Your Circuit

Before you build and test your complete tracking system, follow the steps in this section to assemble your circuit as shown in Figures 5 and 6. You can also access a Tinkercad Circuits simulation of the circuit here. For now, you can put parts like the photoresistors directly in the breadboard, without using male-female jumper wires as extension cables to connect them to the tracker.

  1. Connect the servo motor. Assuming you have an SG90 servo motor with orange, red, and black wires (if not, you will need to look up the connections for your motor):
    1. Orange wire to Arduino pin 9
    2. Red wire to breadboard power bus
    3. Black wire to breadboard ground bus
  2. For each photoresistor:
    1. Connect one leg to the power bus
    2. Connect the other leg to one side of a 10kΩ resistor
    3. Connect the other side of the resistor to the ground bus
    4. Connect one of the Arduino's analog input pins to the middle connection between the photoresistor and fixed resistor
  3. If you purchased a solar panel with 5V or less output:
    1. Connect the negative (black) wire to the ground bus
    2. Connect the positive (red) wire to one of the Arduino's analog inputs
    3. If you purchased a solar panel with more than 5V output, do not connect it to your Arduino. You can use a multimeter to measure its output instead.
  4. Connect power from your Arduino:
    1. 5V pin to breadboard power bus
    2. GND pin to breadboard ground bus
Figure 5. Breadboard diagram for Arduino solar tracker.
Figure 6. Circuit diagram for Arduino solar tracker.

Test Your Circuit

Before you build the support structure for your motor and solar panel, you should test your circuit to make sure that everything works properly.

  1. Download solar_tracker.ino.
  2. Read through the commented code so you understand how it works.
  3. Upload the code to your Arduino.
  4. Open the serial monitor (Tools→Serial monitor).
  5. Watch the numbers in the serial monitor. Try covering one of the photoresistors with your finger. The value for that sensor should go down.
  6. By default, when the difference between the two sensor readings is greater than 50, the servo motor should rotate.
  7. If possible, take your Arduino outside in direct sunlight while it is connected to your computer with a USB cable. If this is not possible, find a window with exposure to direct sunlight indoors. 
  8. Continue watching the serial monitor and try covering the sensors with your finger one at a time. Write down the sensor readings in direct sunlight and when shaded with your finger. 
  9. You may need to make adjustments to the margin variable in the code and/or change the default 10kΩ resistor values to get your circuit to work properly. It will depend on how strong the sun is in your area at the time of year you are doing the project and on the photoresistors you purchased (photoresistors can have a wide resistance range). Here are some tips:
    1. If your sensor values seem "saturated" (they are always very close to 1000 and do not change much when you cover them with your finger), try swapping out the 10kΩ resistors for smaller resistors.
    2. If your sensor values seem saturated in the other direction (they are always close to zero and do not change much), try swapping out the 10kΩ resistors for bigger resistors. 
    3. If the sensor values change when you cover one with your finger, but do not change enough to make the motor spin, try decreasing the margin variable from the default value of 50.
    4. If the motor moves too easily because the sensor values fluctuate too much, try increasing the margin variable.
  10. Your goal is to adjust your system so that the motor holds still when both photoresistors are directly facing the sun, and the motor rotates when one photoresistor is shaded. Continue adjusting your system as needed to achieve this behavior.

Build Your Tracker

Once you have your circuit working on a breadboard, you need to build a tracker with your solar panel and photoresistors mounted on a servo motor so they can rotate, as shown in Figures 7-12.

  1. Disconnect the photoresistors, servo motor, and solar panel from the breadboard.
  2. Cut a piece of cardboard to serve as a secure base to attach everything (Figure 7).
Figure 7. Solar tracker mounted on a cardboard base.
  1. Mount your Arduino and breadboard to the cardboard using double-sided foam tape.
  2. Build a support structure using hot glue and popsicle sticks to hold your servo motor vertically (Figure 8). Make sure the supports are securely glued to the cardboard base.
Figure 8. Popsicle stick supports for servo motor.
  1. Make sure your servo is centered at 90 degrees. You can do this by temporarily modifying your program to manually set the angle to 90 degrees with the command servo1.write(90);.
  2. Attach the servo horn to the servo.
  3. Use popsicle sticks and hot glue to create a support structure for the solar panel and attach it to the servo horn (Figure 9).
Figure 9. Popsicle stick support structure for solar panel.
  1. Cut a small piece of cardboard and mount it vertically above the solar panel (Figure 10).
Figure 10. Side view of the piece of cardboard mounted vertically above the solar panel. Only one photoresistor is visible from this angle, and the other is behind the piece of cardboard.
  1. Glue one photoresistor to each side of the piece of cardboard, facing upright (Figure 11).
Figure 11. An edge-on view of the piece of cardboard with one photoresistor visible on each side. 
  1. Reconnect all circuit components to the breadboard using male-female jumper wires. If you have a soldering iron available, you can solder for stronger connections. 
  2. Secure the wires so they do not pull loose as the servo motor rotates:
    1. Connect the wires near the breadboard to the cardboard base using zip ties, twist ties, or hot glue (Figure 12).
    2. Connect the wires near the solar panel to the popsicle stick frame.
    3. Leave a long, flexible section of wire between the two connection points. 
Figure 12. Wires near the breadboard connected to the cardboard base with a twist tie. This way, the wires are not pulled out of the breadboard when the motor rotates.
  1. Make sure your motor can rotate without any of the wires coming loose.
    1. You can do this using the Arduino sweep example code, which rotates the servo motor back and forth through its complete range. 
    2. First, test the sweep program and watch to make sure that none of the wires physically come loose.
    3. Modify the sweep example code to print out the sensor values and solar panel voltages (you can copy the relevant code from solar_tracker.ino).
    4. Run the code again and watch the serial monitor values. Make sure the readings all change if you cover the panel or one of the sensors. If any readings are constant and do not change, you may have a loose connection.
      1. Even if a wire is not visibly loose, it may not have a good electrical connection. Unplug your Arduino and make sure all connections are secure. Use additional tape or glue if necessary. 
      2. The photoresistors have thin leads that may not securely into the female ends of male-female jumper wires. Make sure they are pushed in firmly. Optionally, use needle-nose pliers to crimp their leads to the male end of a jumper wire, or solder the connections if you have a soldering iron available. 
    5. Confirm that all your connections are secure before you continue. It will be frustrating if a wire comes loose partway through your experiment!
  2. Make sure your tracker works with a flashlight or by manually rotating the piece of cardboard to make the panel track the sun. Make sure the photoresistors are properly shaded by the piece of cardboard when not aimed directly at the sun. Adjust their position if needed.

Test Your Solar Tracker

  1. Plan when and where you will conduct your experiment.
    1. Ideally, this experiment should be conducted outdoors in full sunlight. If weather conditions do not permit this, you can conduct the experiment indoors from a sunny window, or use a high-wattage incandescent light bulb (100W or greater) to simulate the sun.
    2. You will need to test your solar tracker system on multiple different days as close together as possible to avoid seasonal variation in the sun's position in the sky. If you have to wait a few days for more sunny weather, that is OK, but you should not wait weeks or months between data collection days. 
    3. Avoid leaving your Arduino or other electronics out in the rain. 
    4. You will need access to your Arduino and a computer to record the solar panel voltage throughout the day. If you do not want to leave a computer outside, you can power your Arduino with a wall adapter and use a multimeter to measure the solar panel's voltage.
  2. Create a data table like Table 1. Modify the rows and columns based on the times of day and number of days where you can collect data.
  3. To collect data for a fixed solar panel, you can simply unplug your servo motor, or modify the code to manually set the servo motor angle to 90 degrees instead of changing it based on the photoresistor readings. 
  4. To collect data for your solar tracker, run your solar_tracker.ino code (with any modifications you made in previous sections).
  5. Make a graph of your data with voltage on the y-axis and time on the x-axis.
  6. How does voltage produced for your tracking system compare to the fixed solar panel? Do you think the added complexity of the tracking system is worth it? There are many other things you can do with this project - see the Variations section for more ideas. 
Swipe left to see more
Swipe left to see more
Voltage (fixed panel) Voltage (tracking panel)
Time of day Day 1 Day 2 ... Average Day 1 Day 2 ... Average
8:00 AM
9:00 AM
10:00 AM
...

Table 1. Table for recording solar panel voltage.

icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Global Goals

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Affordable and Clean Energy: Ensure access to affordable, reliable, sustainable and modern energy.

Variations

  • Voltage output is not the same thing as power output. Look up how to measure the power output of a solar panel and collect power measurements as well. You will need to learn about electrical voltage, current, resistance, power, and the units used to measure them.
  • Can you measure the total power consumed by the Arduino (which will include everything the Arduino powers, such as the servo motor, and any electrical power wasted as heat)? Do any improvements in power output from the solar panel make up for the power consumption of the Arduino?
  • Turn this into an engineering design project. How can you improve the performance or efficiency of your tracking system? Can you add other features, like LEDs or an LCD screen, to show the real-time power output without requiring a multimeter or a computer?
  • Can you build a dual-axis solar tracker? You will need two servo motors and four photoresistors.
  • Can you do your own agrivoltaics project? Can you optimize both solar power output and shading for a certain species of plant?

Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Does the idea of harvesting the enormous power of the sun interest you? If you find this exciting, then you should think about installing solar photovoltaic panels on your house to collect free electricity from the sun. But how energy efficient is your home already? Can it get better? How many panels would your house need? What would the system look like? You can get the answers to these questions and more from your local solar energy systems engineer. These engineers help their residential and… Read more
Career Profile
Would you like knowing that what you do every day helps the environment and saves money? Well, that is what solar photovoltaic installers do. They outfit buildings and large solar energy farms with photovoltaic systems that convert free sunlight into clean and renewable energy. This is an exciting, emerging field that will enable you to combine a passion for the environment with mechanical and electrical skills. Read more
Career Profile
Just as a potter forms clay, or a steel worker molds molten steel, electrical and electronics engineers gather and shape electricity and use it to make products that transmit power or transmit information. Electrical and electronics engineers may specialize in one of the millions of products that make or use electricity, like cell phones, electric motors, microwaves, medical instruments, airline navigation system, or handheld games. Read more
Career Profile
How much energy do you think all the houses and buildings in the United States consume? It turns out they eat up 40% of all the energy that the U.S. uses in a year. The figure is high because all those houses and buildings need to be heated, cooled, lit, ventilated, and supplied with heated water and electricity to run all sorts of electrical devices, appliances, and computers. Energy efficiency engineers help reduce the energy that houses and buildings use. This saves families and businesses… Read more
Home Science Tools®

Contact Us

Our kits are developed in partnership with Home Science Tools®. If you have purchased a kit for this project, Home Science Tools® is pleased to answer any questions.

In your email, please follow these instructions:
  1. Include your Home Science Tools® order number.
  2. Please describe how you need help as thoroughly as possible:

    Examples

    Good Question I'm trying to do Experimental Procedure step #5, "Scrape the insulation from the wire. . ." How do I know when I've scraped enough?
    Good Question I'm at Experimental Procedure step #7, "Move the magnet back and forth . . ." and the LED is not lighting up.
    Bad Question I don't understand the instructions. Help!
    Good Question I am purchasing my materials. Can I substitute a 1N34 diode for the 1N25 diode called for in the material list?
    Bad Question Can I use a different part?

Contact Support

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Finio, Ben. "Build and Test a Sun-Tracking Solar Panel." Science Buddies, 5 Nov. 2025, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Energy_p045/energy-power/solar-tracker. Accessed 14 June 2026.

APA Style

Finio, B. (2025, November 5). Build and Test a Sun-Tracking Solar Panel. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Energy_p045/energy-power/solar-tracker


Last edit date: 2025-11-05
Top
Free science fair projects.